]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/queue.py
An empty output is handled fine.
[dak.git] / daklib / queue.py
index 037ad62773991da4a518b564ffd878e445aab083..f52fe3638eab71f153634348a431d58b540711cf 100755 (executable)
@@ -54,6 +54,7 @@ from summarystats import SummaryStats
 from utils import parse_changes, check_dsc_files
 from textutils import fix_maintainer
 from binary import Binary
+from lintian import parse_lintian_output
 
 ###############################################################################
 
@@ -1310,25 +1311,11 @@ class Upload(object):
             utils.warn("lintian failed for %s [return code: %s]." % (self.pkg.changes_file, result))
             utils.warn(utils.prefix_multi_line_string(output, " [possible output:] "))
 
-        if len(output) == 0:
-            return
-
         def log(*txt):
             if self.logger:
                 self.logger.log([self.pkg.changes_file, "check_lintian"] + list(txt))
 
-        # We have output of lintian, this package isn't clean. Lets parse it and see if we
-        # are having a victim for a reject.
-        # W: tzdata: binary-without-manpage usr/sbin/tzconfig
-        for line in output.split('\n'):
-            m = re_parse_lintian.match(line)
-            if m is None:
-                continue
-
-            etype = m.group(1)
-            epackage = m.group(2)
-            etag = m.group(3)
-            etext = m.group(4)
+        for etype, epackage, etag, etext in parse_lintian_output(output):
 
             # So lets check if we know the tag at all.
             if etag not in tags:
@@ -1336,11 +1323,11 @@ class Upload(object):
 
             if etype == 'O':
                 # We know it and it is overriden. Check that override is allowed.
-                if etag in lintiantags['warning']:
+                if etag in lintiantags['nonfatal']:
                     # The tag is overriden, and it is allowed to be overriden.
                     # Don't add a reject message.
                     pass
-                elif etag in lintiantags['error']:
+                elif etag in lintiantags['fatal']:
                     # 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))
                     log("ftpmaster does not allow tag to be overridable", etag)
@@ -1348,7 +1335,7 @@ class Upload(object):
                 # 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 etag in lintiantags['warning']:
+                if etag in lintiantags['nonfatal']:
                     log("auto rejecting", "overridable", etag)
                     self.rejects.append("%s: If you have a good reason, you may override this lintian tag." % (epackage))
                 else:
@@ -2039,7 +2026,7 @@ distribution."""
         """
         h = Holding()
         utils.move(os.path.join(h.holding_dir, self.pkg.changes_file),
-                   queue.path, perms=int(queue.changesperms, 8))
+                   queue.path, perms=int(queue.change_perms, 8))
         for f in self.pkg.files.keys():
             utils.move(os.path.join(h.holding_dir, f), queue.path, perms=int(queue.perms, 8))