[Qa-jenkins-scm] [jenkins.debian.net] 02/05: reproducible: html_notes: also clean up old issues page

Holger Levsen holger at moszumanska.debian.org
Sat Jul 4 10:05:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 927e8117674a080eb744b284f2962a174f082a3c
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sun Jun 28 17:56:05 2015 +0000

    reproducible: html_notes: also clean up old issues page
---
 bin/reproducible_html_notes.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 51a0c99..5776c3d 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:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list