From f44d28c3e082a636aa3fee1d07b4d104b1e819cc Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 10:56:45 +0000 Subject: [PATCH] Use loop to check for illegal duplication of file types in .dsc Signed-off-by: Chris Lamb --- daklib/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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([ -- 2.39.5