Browse Source

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

suites/jessie-proposed-backports
Sandro Tosi 11 years ago
parent
commit
d1143886dc
  1. 5
      debian/changelog
  2. 2
      reportbug/checkversions.py
  3. 2
      test/test_checkversions.py

5
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@debian.org> Tue, 23 Aug 2011 22:14:40 +0200
-- Sandro Tosi <morph@debian.org> Wed, 24 Aug 2011 19:08:30 +0200
reportbug (6.1) unstable; urgency=low

2
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:

2
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')

Loading…
Cancel
Save