From d0c59ca05415c09d05d5945f22cc3cd68363fe71 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Mon, 6 Aug 2012 17:03:02 +0200 Subject: [PATCH] daklib/policy.py: handle mapped components --- daklib/policy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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): -- 2.39.5