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

Sandro Tosi morph at debian.org
Sun Dec 4 15:56:15 UTC 2011


The following commit has been merged in the master branch:
commit 9939d35f91851a30db49108322884c028e34338f
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Dec 4 16:04:09 2011 +0100

    remove tailing white spaces from dependencies list; thanks to Nelson A. de Oliveira for the report and patch; Closes: #650659

diff --git a/debian/changelog b/debian/changelog
index e569365..d98eea0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,11 @@ reportbug (6.3.1) UNRELEASED; urgency=low
       prevent spurious blank lines in bug pseudoheaders section; thanks to
       Andreas Beckmann and Jonathan Nieder for the report; Closes: #649956
       #650723
+  * reportbug/utils.py
+    - remove tailing white spaces from dependencies list; thanks to Nelson A. de
+      Oliveira for the report and patch; Closes: #650659
 
- -- Sandro Tosi <morph at debian.org>  Sun, 04 Dec 2011 14:18:01 +0100
+ -- Sandro Tosi <morph at debian.org>  Sun, 04 Dec 2011 16:01:55 +0100
 
 reportbug (6.3) unstable; urgency=low
 
diff --git a/reportbug/utils.py b/reportbug/utils.py
index e36802f..b707ec5 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -668,9 +668,10 @@ def get_dependency_info(package, depends, rel="depends on"):
         # 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*}
-        info = '{0:3.3} {1:{widthp}.{widthp}}  {2:{widthv}.{widthv}}\n'.format(
+        info = '{0:3.3} {1:{widthp}.{widthp}}  {2:{widthv}.{widthv}}'.format(
             status, pack, vers, widthp=widthp, widthv=widthv)
-        depinfo += info
+        # remove tailing white spaces
+        depinfo += info.rstrip() + '\n'
 
     return depinfo
 
diff --git a/test/test_utils.py b/test/test_utils.py
index 65060c8..d9820ac 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -303,6 +303,19 @@ class TestBugreportBody(unittest2.TestCase):
         result = utils.get_dependency_info('reportbug', [['awk']])
         self.assertIn('awk', result)
 
+    def test_bts650659(self):
+        # verify that the dependency list doesn't have tailing white spaces
+
+        status = utils.get_package_status('reportbug')
+        (pkgversion, pkgavail, depends, recommends, conffiles, maintainer,
+         installed, origin, vendor, reportinfo, priority, desc, src_name,
+         fulldesc, state, suggests, section) = status
+
+        for l in [depends, recommends, suggests]:
+            result = utils.get_dependency_info('reportbug', l)
+            for line in result.split('\n'):
+                self.assertEqual(line.rstrip(), line)
+
     def test_cleanup_msg(self):
 
         message = """Subject: unblock: reportbug/4.12.6

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list