From: Chris Lamb Date: Tue, 27 Oct 2009 10:56:45 +0000 (+0000) Subject: Use loop to check for illegal duplication of file types in .dsc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f44d28c3e082a636aa3fee1d07b4d104b1e819cc;p=dak Use loop to check for illegal duplication of file types in .dsc Signed-off-by: Chris Lamb --- diff --git a/daklib/utils.py b/daklib/utils.py index c4f93fe5..f0df5984 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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([