[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-179-g8b7e551

Sandro Tosi morph at debian.org
Sun Apr 24 10:00:35 UTC 2011


The following commit has been merged in the master branch:
commit 434f974ccdcaef82d51e3b69186b1770899559a6
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Apr 24 11:00:16 2011 +0200

    check if there are no reports (or a problem occurred), than don't try to parse the bugs list; thanks to Erik de Castro Lopo for the report; Closes: #622338
    
    In the same diff, we also removed a dead cod branch, since no SYSTEM entry has
    namefmt value associated.

diff --git a/debian/changelog b/debian/changelog
index a3e91ed..e026651 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,12 @@ reportbug (5.1) UNRELEASED; urgency=low
   * reportbug/debianbts.py
     - add support for 'wheezy' tag; thanks to Mehdi Dogguy for the report;
       Closes: #623375
+  * reportbug/ui/text_ui.py
+    - check if there are no reports (or a problem occurred), than don't try to
+      parse the bugs list; thanks to Erik de Castro Lopo for the report;
+      Closes: #622338
 
- -- Sandro Tosi <morph at debian.org>  Thu, 21 Apr 2011 00:14:41 +0200
+ -- Sandro Tosi <morph at debian.org>  Sun, 24 Apr 2011 10:59:22 +0200
 
 reportbug (5.0) unstable; urgency=low
 
diff --git a/reportbug/ui/text_ui.py b/reportbug/ui/text_ui.py
index 16b3122..247045f 100644
--- a/reportbug/ui/text_ui.py
+++ b/reportbug/ui/text_ui.py
@@ -529,16 +529,13 @@ def handle_bts_query(package, bts, timeout, mirrors=None, http_proxy="",
             package, timeout, bts, mirrors=mirrors, version=version,
             source=source, http_proxy=http_proxy, archived=archived)
 
-        if debianbts.SYSTEMS[bts].has_key('namefmt'):
-            package2 = debianbts.SYSTEMS[bts]['namefmt'] % package
-            (count2, title2, hierarchy2) = \
-                     debianbts.get_reports(package2, timeout, bts,
-                                           mirrors=mirrors, source=source,
-                                           http_proxy=http_proxy,
-                                           version=version)
-            count = count+count2
-            for entry in hierarchy2:
-                hierarchy.append( (package2+' '+entry[0], entry[1]) )
+        # If there's no report, then skip all the rest
+        if not count:
+            ui.run_wrapper(nullfunc)
+            if hierarchy == None:
+                raise NoPackage
+            else:
+                raise NoBugs
 
         # remove unneeded info from bugs hierarchy, we leave only bug number and subject
         # format "#<bug no> [???] [pkg name] subject <all the rest>
@@ -607,6 +604,9 @@ def handle_bts_query(package, bts, timeout, mirrors=None, http_proxy="",
                               'n': 'Abort.'})
         if res == 'n':
             raise NoNetwork
+    except NoPackage:
+        long_message('No record of this package found.', title=title)
+        raise NoPackage
 
 def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
                 http_proxy, timeout, screen, title, package, mbox_reader_cmd):

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list