[dak/master 27/29] Reject uploads that contain a native tarball and a diff.
Signed-off-by: Chris Lamb <lamby@debian.org>
---
daklib/srcformats.py | 2 ++
tests/test_srcformats.py | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/daklib/srcformats.py b/daklib/srcformats.py
index a8237c3..0a74c19 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 1e35c6c..9fec4a8 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
--
1.6.3.3
Reply to: