Browse Source

Merge branch 'delete_removed_upstream' into test/deployment

test/deployment
Mark Hindley 7 months ago
parent
commit
2756dc70f1
  1. 13
      amprolla_update.py

13
amprolla_update.py

@ -6,6 +6,7 @@ Perform incremental updates
"""
from os.path import join, isfile, dirname
from pathlib import Path
from multiprocessing import Pool, Manager, get_context
import sys
import urllib3
@ -85,9 +86,17 @@ def get_release_diffs(conn_pool, remote_path, local_path):
write_file(remote_rel.data, join(local_path, release_file))
write_file(remote_rel_text.encode(), join(local_path, 'Release'))
diffs = compare_dict(parse_release(remote_rel_text),
remote_files = parse_release(remote_rel_text)
for f in [p for p in Path(local_path).rglob('*/*') if not p.is_dir()]:
if str(f.relative_to(local_path)) in remote_files:
continue
warn("%s not present in upstream Release file, removing." % f)
f.unlink()
diffs = compare_dict(remote_files,
parse_release(local_rel_text)) if local_rel_text \
else { k:((v),) for (k,v) in parse_release(remote_rel_text).items()}
else { k:((v),) for (k,v) in remote_files.items() }
break
else:

Loading…
Cancel
Save