[Piuparts-commits] [piuparts] 02/09: dwke: restrict processing to sections passed on the command line

Holger Levsen holger at moszumanska.debian.org
Sun Feb 9 20:59:28 UTC 2014


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

holger pushed a commit to branch develop
in repository piuparts.

commit d5794b35e947b7a27a7ac06a6878f0510db0860f
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Feb 9 16:49:09 2014 +0100

    dwke: restrict processing to sections passed on the command line
    
    for debugging+development only, default (no arguments) means process all sections
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 master-bin/detect_well_known_errors.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index f615e21..efbc2ce 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -485,9 +485,9 @@ def process_section(section, config, problem_list,
 
     return (del_cnt, add_cnt, failures)
 
-def detect_well_known_errors(config, problem_list, recheck, recheck_failed):
+def detect_well_known_errors(sections, config, problem_list, recheck, recheck_failed):
 
-    for section in config['sections'].split():
+    for section in sections:
         try:
             print time.strftime("%a %b %2d %H:%M:%S %Z %Y", time.localtime())
             print "%s:" % section
@@ -532,6 +532,9 @@ is summarized into html ".tpl" files in <html_dir>/<section>, which are then
 incorporated by piuparts-report into the final web reports.
 """)
 
+    parser.add_argument('sections', nargs='*', metavar='SECTION',
+            help="limit processing to the listed SECTION(s)")
+
     parser.add_argument('--recheck', dest='recheck', action='store_true',
                help="recheck all log files (delete cache)")
 
@@ -546,9 +549,13 @@ incorporated by piuparts-report into the final web reports.
     if conf["proxy"]:
         os.environ["http_proxy"] = conf["proxy"]
 
+    sections = args.sections
+    if not sections:
+        sections = conf['sections'].split()
+
     problem_list = create_problem_list(conf['known-problem-directory'])
 
-    detect_well_known_errors(conf, problem_list, args.recheck,
+    detect_well_known_errors(sections, conf, problem_list, args.recheck,
                              args.recheck_failed)
 
 # vi:set et ts=4 sw=4 :

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



More information about the Piuparts-commits mailing list