diff --git a/britney.py b/britney.py index af8af0f..9d42876 100755 --- a/britney.py +++ b/britney.py @@ -188,6 +188,7 @@ import os import sys import time import optparse +import copy import apt_pkg @@ -1040,9 +1041,11 @@ class Britney(object): """Merge sources from `source' into partial suite `target'.""" source_sources = self.sources[source] target_sources = self.sources[target] + # we need complete copies here, as we might later find some binaries + # which are only in unstable for pkg, value in source_sources.items(): if pkg not in target_sources: - target_sources[pkg] = value + target_sources[pkg] = copy.deepcopy(value) def merge_binaries(self, source, target, arch): """Merge `arch' binaries from `source' into partial suite `target'.""" diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index e563689..00af277 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -873,6 +873,21 @@ class T(TestBase): self.assertEqual(self.pending_requests, {}) self.assertEqual(self.amqp_requests, set()) + def test_same_version_binary_in_unstable(self): + '''binary from new architecture in unstable with testing version''' + + # i386 is in testing already, but amd64 just recently built and is in unstable + self.data.add_src('brown', False, {'Testsuite': 'autopkgtest'}) + self.data.add('brown', False, {'Architecture': 'i386'}, add_src=False) + self.data.add('brown', True, {'Architecture': 'amd64'}, add_src=False) + + exc = self.do_test( + # we need some other package to create unstable Sources + [('lightgreen', {'Version': '2'}, 'autopkgtest')], + {'brown': (True, {})} + )[1] + self.assertEqual(exc['brown']['item-name'], 'brown/amd64') + def test_package_pair_running(self): '''Two packages in unstable that need to go in together (running)'''