]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/archive.py
daklib/archive.py (_binary_override): evaluate component mapping
[dak.git] / daklib / archive.py
index 7dcc1af035c015c3d8c84a61bc518ac1980bb1d3..7243f31a884f36684044a767f19369a06b263a2e 100644 (file)
@@ -740,17 +740,20 @@ class ArchiveUpload(object):
         @return: C{True} if the upload is NEW, C{False} otherwise
         """
         session = self.session
+        new = False
 
         # Check for missing overrides
         for b in self.changes.binaries:
             override = self._binary_override(suite, b)
             if override is None:
-                return True
+                self.warnings.append('binary:{0} is NEW.'.format(b.control['Package']))
+                new = True
 
         if self.changes.source is not None:
             override = self._source_override(suite, self.changes.source)
             if override is None:
-                return True
+                self.warnings.append('source:{0} is NEW.'.format(self.changes.source.control['Source']))
+                new = True
 
         # Check if we reference a file only in a tainted archive
         files = self.changes.files.values()
@@ -764,7 +767,10 @@ class ArchiveUpload(object):
             in_untainted_archive = (query_untainted.first() is not None)
 
             if in_archive and not in_untainted_archive:
-                return True
+                self.warnings.append('{0} is only available in NEW.'.format(f.filename))
+                new = True
+
+        return new
 
     def _final_suites(self):
         session = self.session
@@ -797,8 +803,12 @@ class ArchiveUpload(object):
         if suite.overridesuite is not None:
             suite = self.session.query(Suite).filter_by(suite_name=suite.overridesuite).one()
 
+        mapped_component = get_mapped_component(binary.component)
+        if mapped_component is None:
+            return None
+
         query = self.session.query(Override).filter_by(suite=suite, package=binary.control['Package']) \
-                .join(Component).filter(Component.component_name == binary.component) \
+                .join(Component).filter(Component.component_name == mapped_component.component_name) \
                 .join(OverrideType).filter(OverrideType.overridetype == binary.type)
 
         try: