]> err.no Git - dak/commitdiff
Use loop to check for illegal duplication of file types in .dsc
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 10:56:45 +0000 (10:56 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 10:56:45 +0000 (10:56 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/utils.py

index c4f93fe5f651cc2b8bc5c6b82861a548f554aebc..f0df5984522227d7fc470c1d0b4eaeeb7bbd66c2 100755 (executable)
@@ -390,13 +390,13 @@ def check_dsc_files(dsc_filename, dsc=None, dsc_files=None):
             has['more_orig_tar'] += 1
         else:
             reject("%s: unexpected source file '%s'" % (dsc_filename, f))
-    if has['orig_tar'] > 1:
-        rejmsg.append("%s: lists multiple .orig tarballs." % (dsc_filename))
-    if has['native_tar'] > 1:
-        rejmsg.append("%s: lists multiple native tarballs." % (dsc_filename))
-    if has['debian_tar'] > 1 or has['debian_diff'] > 1:
-        rejmsg.append("%s: lists multiple debian diff/tarballs." % (dsc_filename))
 
+    # Check for multiple files
+    for file_type in ('orig_tar', 'native_tar', 'debian_tar', 'debian_diff'):
+        if has[file_type] > 1:
+            rejmsg.append("%s: lists multiple %s" % (dsc_filename, file_type))
+
+    # Source format specific tests
     for format in srcformats:
         if format.re_format.match(dsc['format']):
             rejmsg.extend([