]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/queue.py
use service name
[dak.git] / daklib / queue.py
index b3e26d7bed50945dc1a47b4cf525c0fb7f309a64..dfbe36853490c8b9b99c72eebb50daa45d60c9de 100755 (executable)
@@ -59,7 +59,7 @@ from lintian import parse_lintian_output, generate_reject_messages
 # module
 import warnings
 warnings.filterwarnings('ignore', \
-    "apt_pkg-.ParseSection\(\) is deprecated. Please see apt_pkg\.TagSection\(\) for the replacement\.", \
+    "apt_pkg.ParseSection\(\) is deprecated. Please see apt_pkg\.TagSection\(\) for the replacement\.", \
     DeprecationWarning)
 warnings.filterwarnings('ignore', \
     "Attribute 'Find' of the 'apt_pkg\.TagSection' object is deprecated, use 'find' instead\.", \
@@ -772,6 +772,30 @@ class Upload(object):
                 if not re_valid_pkg_name.match(prov):
                     self.rejects.append("%s: Invalid Provides field content %s." % (f, prov))
 
+        # If there is a Built-Using field, we need to check we can find the
+        # exact source version
+        built_using = control.Find("Built-Using")
+        if built_using:
+            try:
+                entry["built-using"] = []
+                for dep in apt_pkg.parse_depends(built_using):
+                    bu_s, bu_v, bu_e = dep[0]
+                    # Check that it's an exact match dependency and we have
+                    # some form of version
+                    if bu_e != "=" or len(bu_v) < 1:
+                        self.rejects.append("%s: Built-Using contains non strict dependency (%s %s %s)" % (f, bu_s, bu_e, bu_v))
+                    else:
+                        # Find the source id for this version
+                        bu_so = get_sources_from_name(bu_s, version=bu_v, session = session)
+                        if len(bu_so) != 1:
+                            self.rejects.append("%s: Built-Using (%s = %s): Cannot find source package" % (f, bu_s, bu_v))
+                        else:
+                            entry["built-using"].append( (bu_so[0].source, bu_so[0].version, ) )
+
+            except ValueError, e:
+                self.rejects.append("%s: Cannot parse Built-Using field: %s" % (f, str(e)))
+
+
         # Check the section & priority match those given in the .changes (non-fatal)
         if     control.Find("Section") and entry["section"] != "" \
            and entry["section"] != control.Find("Section"):