Fix for unsupported negative value in pin priorities.
authorSimone Rossetto <simros85@gmail.com>
Tue, 21 Feb 2012 13:08:45 +0000 (14:08 +0100)
committerDidier Raboud <odyx@debian.org>
Mon, 27 Feb 2012 12:38:44 +0000 (13:38 +0100)
 The priorities of repositories can be negative as reported in apt_preferences
 manpage "P < 0 prevents the version from being installed". The lsb_release.py
 script matches only positive values generating an invalid output for negative
 priorities.

Closes: #540208
lsb_release.py

index 92088584734702f102197da2fc63bf6b50770125..d65e9337088463eacd6b33e34b723440e3a7fa7f 100644 (file)
@@ -154,7 +154,7 @@ def parse_apt_policy():
     policy = commands.getoutput('LANG=C apt-cache policy 2>/dev/null')
     for line in policy.split('\n'):
         line = line.strip()
-        m = re.match(r'(\d+)', line)
+        m = re.match(r'(-?\d+)', line)
         if m:
             priority = int(m.group(1))
         if line.startswith('release'):