From: Guillem Jover <guillem@debian.org>
Date: Thu, 11 Feb 2016 09:27:13 +0000 (+0100)
Subject: Stop using undefined reject function in check_dsc_files
X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=9395800a53935a9bed300bc16d2e3c2440d3d7ac;p=dak.git

Stop using undefined reject function in check_dsc_files

When there's an unknown file in a source package, the function spits
this:

  ,---
  Processing raised an exception: global name 'reject' is not defined.
  Traceback (most recent call last):
    File "/srv/ftp-master.debian.org/dak/dak/daklib/archive.py", line 966, in check
      chk().check(self)
    File "/srv/ftp-master.debian.org/dak/dak/daklib/checks.py", line 497, in check
      rejects = utils.check_dsc_files(dsc_fn, control, source.files.keys())
    File "/srv/ftp-master.debian.org/dak/dak/daklib/utils.py", line 343, in check_dsc_files
      reject("%s: unexpected source file '%s'" % (dsc_filename, f))
  NameError: global name 'reject' is not defined
  `---

Just set the reject message and break from the loop.
---

diff --git a/daklib/utils.py b/daklib/utils.py
index 1b878e22..ce72a2c7 100644
--- a/daklib/utils.py
+++ b/daklib/utils.py
@@ -340,7 +340,8 @@ def check_dsc_files(dsc_filename, dsc, dsc_files):
 
         # File does not match anything in lookup table; reject
         if not matched:
-            reject("%s: unexpected source file '%s'" % (dsc_filename, f))
+            rejmsg.append("%s: unexpected source file '%s'" % (dsc_filename, f))
+            break
 
     # Check for multiple files
     for file_type in ('orig_tar', 'orig_tar_sig', 'native_tar', 'debian_tar', 'debian_diff'):