Browse Source

Also delete empty parent directories.

test/deployment
Mark Hindley 7 months ago
parent
commit
f1ece16301
  1. 8
      amprolla_update.py

8
amprolla_update.py

@ -6,6 +6,7 @@ Perform incremental updates
"""
from os.path import join, isfile, dirname
from errno import ENOTEMPTY
from pathlib import Path
from multiprocessing import Pool, Manager, get_context
import sys
@ -93,6 +94,13 @@ def get_release_diffs(conn_pool, remote_path, local_path):
continue
warn("%s not present in upstream Release file, removing." % f)
f.unlink()
try:
f.parent.rmdir()
except OSError as e:
if e.errno != ENOTEMPTY:
raise(e)
else:
warn("Parent directory also empty, removing.")
diffs = compare_dict(remote_files,
parse_release(local_rel_text)) if local_rel_text \

Loading…
Cancel
Save