]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/policy.py: handle mapped components
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 6 Aug 2012 15:03:02 +0000 (17:03 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 11:43:05 +0000 (13:43 +0200)
daklib/policy.py

index 78d58d67aaa2f1cb5ced663e8b7365cbabca1e0e..3a1cb32ca2ad0c7e4955549c6b8ea3c92ca9d84c 100644 (file)
@@ -17,7 +17,7 @@
 """module to process policy queue uploads"""
 
 from .config import Config
-from .dbconn import BinaryMetadata, Component, MetadataKey, Override, OverrideType
+from .dbconn import BinaryMetadata, Component, MetadataKey, Override, OverrideType, get_mapped_component
 from .fstransactions import FilesystemTransaction
 from .regexes import re_file_changes, re_file_safe
 
@@ -126,18 +126,20 @@ class PolicyQueueUploadHandler(object):
     def _source_override(self, component_name):
         package = self.upload.source.source
         suite = self._overridesuite
+        component = get_mapped_component(component_name, self.session)
         query = self.session.query(Override).filter_by(package=package, suite=suite) \
             .join(OverrideType).filter(OverrideType.overridetype == 'dsc') \
-            .join(Component).filter(Component.component_name == component_name)
+            .filter(Override.component == component)
         return query.first()
 
     def _binary_override(self, binary, component_name):
         package = binary.package
         suite = self._overridesuite
         overridetype = binary.binarytype
+        component = get_mapped_component(component_name, self.session)
         query = self.session.query(Override).filter_by(package=package, suite=suite) \
             .join(OverrideType).filter(OverrideType.overridetype == overridetype) \
-            .join(Component).filter(Component.component_name == component_name)
+            .filter(Override.component == component)
         return query.first()
 
     def _binary_metadata(self, binary, key):