[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Stop using undefined reject function in check_dsc_files

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

  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
    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.
 daklib/utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/daklib/utils.py b/daklib/utils.py
index 1b878e2..ce72a2c 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'):

Reply to: