X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=daklib%2Fqueue.py;h=a64df472d25a1d710f2ac9929892832be2ff697c;hb=8964d542a2c0cc755a45d98db45d884fdc68de3c;hp=3e2e6ef58d56458ca2a7114a4cda5da006eaa674;hpb=98711aaaba0f4e55e7c92cf91149df0db5d412a6;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index 3e2e6ef5..a64df472 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -1225,14 +1225,14 @@ class Upload(object): # through lintians output later to see if its a fatal tag we detected, or not. # So we only run lintian once on all tags, even if we might reject on some, but not # reject on others. - # Additionally built up a hash of tags - tags = {} + # Additionally build up a set of tags + tags = set() (fd, temp_filename) = utils.temp_filename() temptagfile = os.fdopen(fd, 'w') for tagtype in lintiantags: for tag in lintiantags[tagtype]: temptagfile.write(tag) - tags[tag]=1 + tags.add(tag) temptagfile.close() # So now we should look at running lintian at the .changes file, capturing output @@ -1252,31 +1252,32 @@ class Upload(object): # W: tzdata: binary-without-manpage usr/sbin/tzconfig for line in output.split('\n'): m = re_parse_lintian.match(line) - if m: - etype = m.group(1) - epackage = m.group(2) - etag = m.group(3) - etext = m.group(4) - - # So lets check if we know the tag at all. - if tags.has_key(etag): - if etype == 'O': - # We know it and it is overriden. Check that override is allowed. - if lintiantags['warning'][etag]: - # The tag is overriden, and it is allowed to be overriden. - # Continue as if it isnt there. - next - elif lintiantags['error'][etag]: - # The tag is overriden - but is not allowed to be - self.rejects.append("%s: Overriden tag %s found, but this tag may not be overwritten." % (epackage, etag)) - return - else: - # Tag is known, it is not overriden, direct reject. - self.rejects.append("%s: Found lintian output: '%s %s', automatically rejected package." % (epackage, etag, etext)) - # Now tell if they *might* override it. - if lintiantags['wayout'][etag]: - self.rejects.append("%s: If you have a good reason, you may override this lintian tag. Laziness to fix your crap is NOT A GOOD REASON, sod off" % (epackage)) - return + if m is None: + continue + + etype = m.group(1) + epackage = m.group(2) + etag = m.group(3) + etext = m.group(4) + + # So lets check if we know the tag at all. + if etag not in tags: + continue + + if etype == 'O': + # We know it and it is overriden. Check that override is allowed. + if lintiantags['warning'][etag]: + # The tag is overriden, and it is allowed to be overriden. + # Don't add a reject message. + elif lintiantags['error'][etag]: + # The tag is overriden - but is not allowed to be + self.rejects.append("%s: Overriden tag %s found, but this tag may not be overwritten." % (epackage, etag)) + else: + # Tag is known, it is not overriden, direct reject. + self.rejects.append("%s: Found lintian output: '%s %s', automatically rejected package." % (epackage, etag, etext)) + # Now tell if they *might* override it. + if lintiantags['wayout'][etag]: + self.rejects.append("%s: If you have a good reason, you may override this lintian tag. Laziness to fix your crap is NOT A GOOD REASON, sod off" % (epackage)) ########################################################################### def check_urgency(self):