From 1d94871858ec182edfee5442c31ab3a32a7cc8ac Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 29 Sep 2016 15:34:22 +0200 Subject: reproducible Debian: don't try to delete directories when removing obsolete history pages --- bin/reproducible_html_breakages.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bin/reproducible_html_breakages.py') diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py index 788526cc..9da58b16 100755 --- a/bin/reproducible_html_breakages.py +++ b/bin/reproducible_html_breakages.py @@ -248,10 +248,11 @@ def alien_history(): actual_packages = [x[0] for x in result] bad_files = [] for f in sorted(os.listdir(HISTORY_PATH)): - if f.rsplit('.', 1)[0] not in actual_packages: - bad_files.append(os.path.join(HISTORY_PATH, f)) - os.remove(os.path.join(HISTORY_PATH, f)) - log.warning('%s should not be there so it has been removed.', os.path.join(HISTORY_PATH, f)) + full_path = os.path.join(HISTORY_PATH, f) + if f.rsplit('.', 1)[0] not in actual_packages and not os.path.isdir(full_path): + bad_files.append(full_path) + os.remove(full_path) + log.warning('%s should not be there so it has been removed.', full_path) return bad_files -- cgit v1.2.3-54-g00ecf