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