]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/archive.py: source for policy queue uploads may be in target suite
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 15 Aug 2012 20:22:22 +0000 (22:22 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 15 Aug 2012 20:22:22 +0000 (22:22 +0200)
Note that this patch breaks binNMUs to suites where the source is only
available in a enhanced suite.

daklib/archive.py

index 2badae7252693c6cc57ec025c695ba28e36ea51d..bc67c2d9a7492278417c69e0d22bb4aee0d687f1 100644 (file)
@@ -1127,17 +1127,18 @@ class ArchiveUpload(object):
             if policy_queue is not None:
                 redirected_suite = policy_queue.suite
 
+            source_suites = self.session.query(Suite).filter(Suite.suite_id.in_([suite.suite_id, redirected_suite.suite_id])).subquery()
+
             source_component_func = lambda source: self._source_override(overridesuite, source).component
             binary_component_func = lambda binary: self._binary_component(overridesuite, binary)
 
-            (db_source, db_binaries) = self._install_to_suite(redirected_suite, source_component_func, binary_component_func, extra_source_archives=[suite.archive])
+            (db_source, db_binaries) = self._install_to_suite(redirected_suite, source_component_func, binary_component_func, source_suites=source_suites, extra_source_archives=[suite.archive])
 
             if policy_queue is not None:
                 self._install_policy(policy_queue, suite, db_changes, db_source, db_binaries)
 
             # copy to build queues
             if policy_queue is None or policy_queue.send_to_build_queues:
-                source_suites = self.session.query(Suite).filter_by(suite_id=suite.suite_id).subquery()
                 for build_queue in suite.copy_queues:
                     self._install_to_suite(build_queue.suite, source_component_func, binary_component_func, source_suites=source_suites, extra_source_archives=[suite.archive])