avoid duplicate files when building a zip
This commit is contained in:
parent
d4c8375702
commit
81bd7fab55
1 changed files with 3 additions and 4 deletions
|
@ -56,14 +56,13 @@ def execute(argv):
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
dist_zip, runtime_deps, target_cpu, target_os = argv
|
dist_zip, runtime_deps, target_cpu, target_os = argv
|
||||||
dist_files = []
|
dist_files = set()
|
||||||
with open(runtime_deps) as f:
|
with open(runtime_deps) as f:
|
||||||
for dep in f.readlines():
|
for dep in f.readlines():
|
||||||
dep = dep.strip()
|
dep = dep.strip()
|
||||||
if dep not in dist_files:
|
dist_files.add(dep)
|
||||||
dist_files += [dep]
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
mac_zip_results = execute(['zip', '-r', '-y', dist_zip] + dist_files)
|
execute(['zip', '-r', '-y', dist_zip] + list(dist_files))
|
||||||
else:
|
else:
|
||||||
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED) as z:
|
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED) as z:
|
||||||
for dep in dist_files:
|
for dep in dist_files:
|
||||||
|
|
Loading…
Add table
Reference in a new issue