diff --git a/britney.py b/britney.py index 941989d..6d66d74 100755 --- a/britney.py +++ b/britney.py @@ -781,7 +781,11 @@ class Britney(object): # that have built on this architecture. if value[SOURCE] not in oodsrcs: source_version = source_sources[value[SOURCE]][VERSION] - target_version = target_sources[value[SOURCE]][VERSION] + try: + target_version = target_sources[value[SOURCE]][VERSION] + except KeyError: + self.__log("merge_binaries: pkg %s has no source, NBS?" % pkg) + continue if source_version != target_version: current_arch = value[ARCHITECTURE] built = False diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index d0c8f14..f857f4c 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -1216,6 +1216,22 @@ class T(TestBase): {'lightgreen': [('old-version', '1'), ('new-version', '2')]} ) + def test_nbs(self): + '''source-less binaries do not cause harm''' + + # NBS in testing + self.data.add('liboldgreen0', False, add_src=False) + # NBS in unstable + self.data.add('liboldgreen1', True, add_src=False) + self.do_test( + [('libgreen1', {'Version': '2', 'Source': 'green'}, 'autopkgtest')], + {'green': (True, {'green 2': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING-ALWAYSFAIL'}, + 'lightgreen 1': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING-ALWAYSFAIL'}, + 'darkgreen 1': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING-ALWAYSFAIL'}, + }), + }, + {'green': [('old-version', '1'), ('new-version', '2')]}) + ################################################################ # Tests for hint processing ################################################################