summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-08 14:18:00 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-08 16:42:15 +0100
commitbaa89efdfcbdb4e1e108862d96d79be13f5cf114 (patch)
tree2a404bafb2a0e0b907ba382308e3ab5296fdb4bc /bin
parentd49f21c35b4da0125f70d378ca70b8aa67c17e41 (diff)
downloadjenkins.debian.net-baa89efdfcbdb4e1e108862d96d79be13f5cf114.tar.xz
reproducible: reproducible_html_notes.py: add purge_old_notes()
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_html_notes.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 28081ffa..e7b28d07 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -170,6 +170,16 @@ def gen_html_issue(issue):
return issue_html.substitute(issue=issue, urls=url, description=desc,
affected_pkgs=affected)
+
+def purge_old_notes(notes):
+ presents = os.listdir(NOTES_PATH)
+ for page in presents:
+ pkg = page.rsplit('_')[0]
+ log.debug('checking if ' + page + ' (from ' + pkg + ') is still needed')
+ if pkg not in notes:
+ log.info('There are no notes for ' + pkg + '. Removing old page.')
+ os.remove(NOTES_PATH + '/' + page)
+
def iterate_over_notes(notes):
num_notes = str(len(notes))
i = 0
@@ -226,4 +236,4 @@ if __name__ == '__main__':
iterate_over_notes(notes)
iterate_over_issues(issues)
index_issues(issues)
-
+ purge_old_notes(notes)