From ac4d913fff3393d836839b750856a77a3f5c5650 Mon Sep 17 00:00:00 2001 From: Simone Rossetto Date: Tue, 21 Feb 2012 14:08:45 +0100 Subject: [PATCH] Fix for unsupported negative value in pin priorities. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsb_release.py b/lsb_release.py index 9208858..d65e933 100644 --- a/lsb_release.py +++ b/lsb_release.py @@ -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'): -- 2.30.2