summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/reproducible_html_notes.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 51a0c990..5776c3de 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -299,6 +299,7 @@ def gen_html_issue(issue, suite):
affected_pkgs=affected,
suite=suite, suite_links=suite_links)
+
def purge_old_notes(notes):
removed_pages = []
to_rebuild = []
@@ -324,6 +325,23 @@ def purge_old_notes(notes):
gen_packages_html(to_rebuild)
+def purge_old_issues(issues):
+ for root, dirs, files in os.walk(ISSUES_PATH):
+ if not files:
+ continue
+ for file in files:
+ try:
+ issue = file.rsplit('_', 1)[0]
+ except ValueError:
+ log.critical('/'.join([root, file]) + ' does not seems like '
+ + 'a file that should be there')
+ sys.exit(1)
+ if issue not in issues:
+ log.warning('removing ' + '/'.join([root, file]) + '...')
+ #os.remove('/'.join([root, file]))
+ log.warning('\t not removing for real now, please enable this')
+
+
def iterate_over_notes(notes):
num_notes = str(len(notes))
i = 0
@@ -413,6 +431,7 @@ if __name__ == '__main__':
iterate_over_issues(issues)
index_issues(issues)
purge_old_notes(notes)
+ purge_old_issues(issues)
gen_packages_html(notes) # regenerate all rb-pkg/ pages
for suite in SUITES:
for arch in ARCHES: