From 9b3cf7b8bdd96df4e9d34c661fc78f4f552a2dd6 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 13:30:29 +0000 Subject: [PATCH] Reject uploads that contain a native tarball and a diff. Signed-off-by: Chris Lamb --- daklib/srcformats.py | 2 ++ tests/test_srcformats.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/daklib/srcformats.py b/daklib/srcformats.py index a8237c3d..0a74c192 100644 --- a/daklib/srcformats.py +++ b/daklib/srcformats.py @@ -37,6 +37,8 @@ class FormatOne(SourceFormat): def reject_msgs(cls, has): if not (has['native_tar_gz'] or (has['orig_tar_gz'] and has['debian_diff'])): yield "no .tar.gz or .orig.tar.gz+.diff.gz in 'Files' field." + if has['native_tar_gz'] and has['debian_diff']: + yield "native package with diff makes no sense" if (has['orig_tar_gz'] != has['orig_tar']) or \ (has['native_tar_gz'] != has['native_tar']): yield "contains source files not allowed in format %s" % cls.name diff --git a/tests/test_srcformats.py b/tests/test_srcformats.py index 1e35c6c5..9fec4a87 100755 --- a/tests/test_srcformats.py +++ b/tests/test_srcformats.py @@ -53,6 +53,11 @@ class FormatOneTestCase(SourceFormatTestCase): 'native_tar_gz': 1, 'more_orig_tar': 1, }) + self.assertRejected({ + 'native_tar': 1, + 'native_tar_gz': 1, + 'debian_diff': 1, + }) class FormatTreeTestCase(SourceFormatTestCase): fmt = srcformats.FormatThree -- 2.39.5