From 3fe1419433f195d57b948b100b218cf14a2841d0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jul 2020 19:55:58 +0200 Subject: Detect pkg-config-dpkghook failure in tests to avoid fallback dpkg (>= 1.20.3) has better support for its own DPKG_ROOT resulting in architectures for the root being reported rather than the host system. Sadly the hookscript from pkg-config is not prepared for this resulting in our `dpkg --add-architecture` calls failing in the hook after dpkg has successfully added the architecture internally. The failure triggered fallback handling in the tests to work with an older version of dpkg with a different multi-arch implementation. So instead of doing the fallback, we ignore the failure if it seems like pkg-config-dpkghook is involved only producing a bunch of warnings to hint at this problem, but otherwise make the tests work again as it is a post-invoke script. References: #824774 --- test/integration/framework | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 44dedb10b..e30fa066c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -585,10 +585,14 @@ configdpkg() { # the arch apt treats as native might be foreign for dpkg for ARCH in ${ARCHS}; do if [ "${ARCH}" != "${DPKGARCH}" ]; then - if ! dpkg --add-architecture ${ARCH} >/dev/null 2>&1; then - # old-style used e.g. in Ubuntu-P – and as it seems travis - echo "DPKG::options:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg - echo "DPKG::options:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + if ! dpkg --add-architecture ${ARCH} >rootdir/tmp/dpkgaddarch.output 2>&1; then + if grep -q 'pkg-config-dpkghook' rootdir/tmp/dpkgaddarch.output; then + msgwarn 'Ignoring failure of dpkg --add-architecture as it is likely due to pkg-config-dpkghook (see #824774)' + else + # old-style used e.g. in Ubuntu-P – and as it seems travis + echo "DPKG::options:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + echo "DPKG::options:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + fi fi fi done -- cgit v1.2.3