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

Sandro Tosi morph at debian.org
Wed Aug 24 20:27:16 UTC 2011


The following commit has been merged in the master branch:
commit d1143886dc013ef5c022dc571c2a2e78ae30b86b
Author: Sandro Tosi <morph at debian.org>
Date:   Wed Aug 24 19:10:21 2011 +0200

    ignore if we can't compare the version of a currently installed package; thanks to Josh Triplett for the report; Closes: #638575

diff --git a/debian/changelog b/debian/changelog
index 448fe69..2fc03bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,8 +9,11 @@ reportbug (6.2) UNRELEASED; urgency=low
   * debian/desktop
     - remove deprecated 'Application' category + add GenericName; thanks to Pino
       Toscano for the report and patch; Closes: #638964
+  * reportbug/checkversions.py
+    - ignore if we can't compare the version of a currently installed package;
+      thanks to Josh Triplett for the report; Closes: #638575
 
- -- Sandro Tosi <morph at debian.org>  Tue, 23 Aug 2011 22:14:40 +0200
+ -- Sandro Tosi <morph at debian.org>  Wed, 24 Aug 2011 19:08:30 +0200
 
 reportbug (6.1) unstable; urgency=low
 
diff --git a/reportbug/checkversions.py b/reportbug/checkversions.py
index 918e1cd..61cfc20 100644
--- a/reportbug/checkversions.py
+++ b/reportbug/checkversions.py
@@ -124,7 +124,7 @@ class IncomingParser(sgmllib.SGMLParser):
 def compare_versions(current, upstream):
     """Return 1 if upstream is newer than current, -1 if current is
     newer than upstream, and 0 if the same."""
-    if not upstream: return 0
+    if not current or not upstream: return 0
     rc = os.system('dpkg --compare-versions %s lt %s' % (current, upstream))
     rc2 = os.system('dpkg --compare-versions %s gt %s' % (current, upstream))
     if not rc:
diff --git a/test/test_checkversions.py b/test/test_checkversions.py
index 16abde8..9a45f80 100644
--- a/test/test_checkversions.py
+++ b/test/test_checkversions.py
@@ -14,6 +14,7 @@ class TestCheckversions(unittest2.TestCase):
         self.assertEqual(checkversions.compare_versions('123', None), 0)
         self.assertEqual(checkversions.compare_versions('1.2.3', '1.2.3'), 0)
         self.assertEqual(checkversions.compare_versions(None, None), 0)
+        self.assertEqual(checkversions.compare_versions('', '1.2.3'), 0)
 
         self.assertEqual(checkversions.compare_versions('1.2.4', '1.2.3'), -1)
 
@@ -25,5 +26,6 @@ class TestCheckversions(unittest2.TestCase):
         self.assertEqual(checkversions.later_version('123', None), '123')
         self.assertEqual(checkversions.later_version('1.2.3', '1.2.3'), '1.2.3')
         self.assertIsNone(checkversions.later_version(None, None))
+        self.assertEqual(checkversions.later_version('', '1.2.3'), '')
 
         self.assertEqual(checkversions.later_version('1.2.4', '1.2.3'), '1.2.4')

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list