summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-09-29 15:34:22 +0200
committerHolger Levsen <holger@layer-acht.org>2016-09-29 15:34:22 +0200
commit1d94871858ec182edfee5442c31ab3a32a7cc8ac (patch)
tree1108a924e736d9c74b394a78a6f3976a50e705c0
parentd8a0ba4a3f1fa23f2f8ed1511d2d78bdfcb988b0 (diff)
downloadjenkins.debian.net-1d94871858ec182edfee5442c31ab3a32a7cc8ac.tar.xz
reproducible Debian: don't try to delete directories when removing obsolete history pages
-rwxr-xr-xbin/reproducible_html_breakages.py9
1 files changed, 5 insertions, 4 deletions
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