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>
master
Adam D. Barratt 12 years ago
parent 319f5ef9eb
commit da69fb39ca

@ -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…
Cancel
Save