mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-12 03:41:08 +00:00
Perform basic sanity checking when reading hints files
The only test currently implemented is to ensure that any prospective hint contains at least one item beyond the hint name. This prevents lines in a hint file consisting simply of e.g. "easy" being added to the hint list and causing later processing to abort with an error. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
c992787918
commit
8ee72661f0
@ -813,6 +813,9 @@ class Britney(object):
|
||||
break
|
||||
elif l[0] not in self.HINTS[who]:
|
||||
continue
|
||||
elif len(l) == 1:
|
||||
# All current hints require at least one argument
|
||||
self.__log("Malformed hint found in %s: '%s'" % (filename, line), type="W")
|
||||
elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]:
|
||||
for package in l[1:]:
|
||||
hints.add_hint('%s %s' % (l[0], package), who)
|
||||
|
Loading…
x
Reference in New Issue
Block a user