From: Ansgar Burchardt Date: Mon, 6 Aug 2012 15:03:02 +0000 (+0200) Subject: daklib/policy.py: handle mapped components X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=d0c59ca05415c09d05d5945f22cc3cd68363fe71;p=dak.git daklib/policy.py: handle mapped components --- diff --git a/daklib/policy.py b/daklib/policy.py index 78d58d67..3a1cb32c 100644 --- a/daklib/policy.py +++ b/daklib/policy.py @@ -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):