mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
hints: fix up hint parsing code for age-days
string.split()'s second argument specifies the maximum number of times the string should be split, not the maximum number of elements in the result. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
0971adec29
commit
a1838a5037
4
hints.py
4
hints.py
@ -44,14 +44,14 @@ class Hint:
|
||||
self._type = hint[0]
|
||||
self._packages = hint[1:]
|
||||
else:
|
||||
self._type, self._packages = hint.split(' ', 2)
|
||||
self._type, self._packages = hint.split(' ', 1)
|
||||
|
||||
if self._type == 'age-days':
|
||||
if isinstance(hint, list):
|
||||
self._days = self._packages[0]
|
||||
self._packages = self._packages[1:]
|
||||
else:
|
||||
self._days, self._packages = self._packages.split(' ', 2)
|
||||
self._days, self._packages = self._packages.split(' ', 1)
|
||||
|
||||
self._packages = [HintItem(x) for x in self._packages]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user