From 0c64998e41928d8bb4a4c28b2e0fd4447c68e6c0 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 31 Jul 2015 09:19:51 +0200 Subject: [PATCH] Strip off Multi-Arch qualifiers in reverse dependency calculation See also http://bugs.debian.org/794194 --- britney_util.py | 3 ++- tests/test_autopkgtest.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/britney_util.py b/britney_util.py index f08d4ee..feceb16 100644 --- a/britney_util.py +++ b/britney_util.py @@ -238,7 +238,8 @@ def register_reverses(packages, provides, check_doubles=True, iterator=None, # go through the list for p in dependencies: for a in p: - dep = a[0] + # strip off Multi-Arch qualifiers like :any or :native + dep = a[0].split(':')[0] # register real packages if dep in packages and (not check_doubles or pkg not in packages[dep][RDEPENDS]): packages[dep][RDEPENDS].append(pkg) diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index 0cc135d..00122c6 100644 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -432,6 +432,21 @@ lightgreen 2 i386 lightgreen 2 self.assertEqual(self.pending_requests, '') self.assertEqual(self.amqp_requests, set()) + def test_multiarch_dep(self): + '''multi-arch dependency''' + + self.data.add('rainbow', False, {'Depends': 'lightgreen:any'}, + testsuite='autopkgtest') + + self.do_test( + [('lightgreen', {'Version': '2'}, 'autopkgtest')], + # FIXME: while we only submit requests through AMQP, but don't consider + # their results, we don't expect this to hold back stuff. + VALID_CANDIDATE, + [r'\blightgreen\b.*>1 to .*>2<', + r'autopkgtest for lightgreen 2: .*amd64.*in progress.*i386.*in progress', + r'autopkgtest for rainbow 1: .*amd64.*in progress.*i386.*in progress']) + def test_no_amqp_config(self): '''Run without autopkgtest requests'''