[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 6.0-97-ga91b4ea

Sandro Tosi morph at debian.org
Sun Feb 19 19:00:41 UTC 2012


The following commit has been merged in the master branch:
commit a91b4ead3ddcb83c49206bef1ea81209fa5779d7
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Feb 19 19:34:30 2012 +0100

    correctly report the installation status for each dependency packages, not just the last status applied to each pkgs; thanks to Piotr Engelking for the report; Closes: #657753

diff --git a/debian/changelog b/debian/changelog
index 522badd..c4569dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,8 +14,12 @@ reportbug (6.3.2) UNRELEASED; urgency=low
       requests, so reportbug won't crash if proper values (for section and
       priority) is not found; thanks to James McCoy for the report;
       Closes: #658748
+  * reportbug/utils.py
+    - correctly report the installation status for each dependency packages, not
+      just the last status applied to each pkgs; thanks to Piotr Engelking for
+      the report; Closes: #657753
 
- -- Sandro Tosi <morph at debian.org>  Sun, 19 Feb 2012 18:45:30 +0100
+ -- Sandro Tosi <morph at debian.org>  Sun, 19 Feb 2012 19:28:59 +0100
 
 reportbug (6.3.1) unstable; urgency=low
 
diff --git a/reportbug/utils.py b/reportbug/utils.py
index b707ec5..f68f0cd 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -652,7 +652,7 @@ def get_dependency_info(package, depends, rel="depends on"):
     for (pack, status, vers, desc, provides) in deplist:
         if provides:
             pack += ' [' + provides + ']'
-        deplist2.append((pack, vers))
+        deplist2.append((pack, vers, status))
     deplist = deplist2
 
     # now we can compute the max possible value for each column, that can be the
@@ -664,7 +664,7 @@ def get_dependency_info(package, depends, rel="depends on"):
     widthp = min(maxp, 73-maxv)
     widthv = min(maxv, 73-widthp)
 
-    for (pack, vers) in deplist:
+    for (pack, vers, status) in deplist:
         # we format the string specifying to align it in a field of a given
         # dimension (the first {width*}) but also limit its size (the second
         # {width*}
diff --git a/test/test_utils.py b/test/test_utils.py
index d9820ac..c158ed8 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -303,6 +303,16 @@ class TestBugreportBody(unittest2.TestCase):
         result = utils.get_dependency_info('reportbug', [['awk']])
         self.assertIn('awk', result)
 
+
+    def test_bts657753(self):
+        # check that non-existing deps gets a correct installation info
+        # and not just the last one applied to anyone
+        result = utils.get_dependency_info('reportbug',
+                                           (('reportbug',), ('nonexisting',)))
+        for line in result.split('\n'):
+            if 'nonexisting' in line:
+                self.assertFalse(line.startswith('ii'))
+
     def test_bts650659(self):
         # verify that the dependency list doesn't have tailing white spaces
 

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list