X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=blobdiff_plain;f=daklib%2Fpolicy.py;h=aa5f12f0ac141e10e04552c11449ff842618cea2;hp=dad9e9d1ec20c685848dac377ae23ecf87e70942;hb=391f5ec09a119131dc846b796ca791f4cecc69e4;hpb=2b8e14db14a20525fc6bb4b38fee86d99e4d382c diff --git a/daklib/policy.py b/daklib/policy.py index dad9e9d1..aa5f12f0 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, Suite, get_mapped_component +from .dbconn import BinaryMetadata, Component, MetadataKey, Override, OverrideType, Suite, get_mapped_component, get_mapped_component_name from .fstransactions import FilesystemTransaction from .regexes import re_file_changes, re_file_safe from .packagelist import PackageList @@ -87,7 +87,7 @@ class UploadCopy(object): for byhand in self.upload.byhand: src = os.path.join(queue.path, byhand.filename) dst = os.path.join(directory, byhand.filename) - if not os.path.exists(dst) or not ignore_existing: + if os.path.exists(src) and (not os.path.exists(dst) or not ignore_existing): fs.copy(src, dst, mode=mode, symlink=symlink) # copy .changes @@ -287,8 +287,9 @@ class PolicyQueueUploadHandler(object): # see daklib.archive.source_component_from_package_list # which we cannot use here as we might not have a Package-List # field for old packages + mapped_components = [ get_mapped_component_name(c) for c in components ] query = self.session.query(Component).order_by(Component.ordering) \ - .filter(Component.component_name.in_(components)) + .filter(Component.component_name.in_(mapped_components)) source_component = query.first().component_name override = self._source_override(source_component)