From: Ansgar Burchardt <ansgar@debian.org>
Date: Mon, 18 Jan 2016 19:28:31 +0000 (+0100)
Subject: Reject arch:all binNMUs
X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=368b5f9e628e664fef3cfce060943a0e7d168c59;p=dak.git

Reject arch:all binNMUs

While arch:all binNMUs might work for some packages, they still tend
to create problems due to versioned dependencies using

  arch-all-package (= ${source:Version})

as these will be broken by the binNMU.  To avoid these, we reject
arch:all binNMUs for now.
---

diff --git a/daklib/archive.py b/daklib/archive.py
index 3477f333..fc31b6a5 100644
--- a/daklib/archive.py
+++ b/daklib/archive.py
@@ -961,6 +961,7 @@ class ArchiveUpload(object):
                     checks.BinaryCheck,
                     checks.BinaryTimestampCheck,
                     checks.SingleDistributionCheck,
+                    checks.ArchAllBinNMUCheck,
                     ):
                 chk().check(self)
 
diff --git a/daklib/checks.py b/daklib/checks.py
index e17a191e..9916cc75 100644
--- a/daklib/checks.py
+++ b/daklib/checks.py
@@ -725,6 +725,16 @@ class NoSourceOnlyCheck(Check):
 
         return True
 
+class ArchAllBinNMUCheck(Check):
+    """Check for arch:all binNMUs"""
+    def check(self, upload):
+        changes = upload.changes
+
+        if 'all' in changes.architectures and changes.changes.get('Binary-Only') == 'yes':
+            raise Reject('arch:all binNMUs are not allowed.')
+
+        return True
+
 class LintianCheck(Check):
     """Check package using lintian"""
     def check(self, upload):