]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/checks.py
daklib/checks.py: make version check slightly more verbose
[dak.git] / daklib / checks.py
index 209a0945c14ef950953bab4ca9f4337d8593a08d..5c93ec3f65d9ec4801c5afd74bb659a689701867 100644 (file)
@@ -175,9 +175,6 @@ class BinaryCheck(Check):
         for bn in binary_names:
             if bn not in upload.changes.binary_names:
                 raise Reject('Package {0} is not mentioned in Binary field in changes'.format(bn))
-        for bn in upload.changes.binary_names:
-            if bn not in binary_names:
-                raise Reject('Binary field in changes has {0}, but was not found in upload'.format(bn))
 
         return True
 
@@ -318,15 +315,12 @@ class ACLCheck(Check):
 
         if 'source' not in upload.changes.architectures:
             raise Reject('DM uploads must include source')
-        distributions = upload.changes.distributions
-        for dist in distributions:
-            if dist not in ('unstable', 'experimental', 'squeeze-backports'):
-                raise Reject("Uploading to {0} is not allowed for DMs.".format(dist))
         for f in upload.changes.files.itervalues():
             if f.section == 'byhand' or f.section[:4] == "raw-":
                 raise Reject("Uploading byhand packages is not allowed for DMs.")
 
         # Reject NEW packages
+        distributions = upload.changes.distributions
         assert len(distributions) == 1
         suite = session.query(Suite).filter_by(suite_name=distributions[0]).one()
         overridesuite = suite
@@ -521,7 +515,7 @@ class VersionCheck(Check):
             source_version = upload.changes.source.dsc['Version']
             v = self._highest_source_version(session, source_name, suite)
             if v is not None and version_compare(source_version, v) != expected_result:
-                raise Reject('Version check failed (source={0}, version={1}, suite={2})'.format(source_name, source_version, suite.suite_name))
+                raise Reject('Version check failed (source={0}, version={1}, other-version={2}, suite={3})'.format(source_name, source_version, v, suite.suite_name))
 
         for binary in upload.changes.binaries:
             binary_name = binary.control['Package']
@@ -529,7 +523,7 @@ class VersionCheck(Check):
             architecture = binary.control['Architecture']
             v = self._highest_binary_version(session, binary_name, suite, architecture)
             if v is not None and version_compare(binary_version, v) != expected_result:
-                raise Reject('Version check failed (binary={0}, version={1}, suite={2})'.format(binary_name, binary_version, suite.suite_name))
+                raise Reject('Version check failed (binary={0}, version={1}, other-version={2}, suite={3})'.format(binary_name, binary_version, v, suite.suite_name))
 
     def per_suite_check(self, upload, suite):
         session = upload.session