diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-06-28 17:56:05 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-07-04 12:03:13 +0200 |
commit | 927e8117674a080eb744b284f2962a174f082a3c (patch) | |
tree | 1e4056e847875df0c04d6c286a47fd0443f3249c /bin | |
parent | 17ed5c4df639ed14ab7137f50f7fa6e9d49bd99e (diff) | |
download | jenkins.debian.net-927e8117674a080eb744b284f2962a174f082a3c.tar.xz |
reproducible: html_notes: also clean up old issues page
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_html_notes.py | 19 |
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: |