summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-07-07 19:55:58 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-07-07 19:55:58 +0200
commit3fe1419433f195d57b948b100b218cf14a2841d0 (patch)
treefe45e0384378b91e1245943433ed2ecdf7747ee9 /test/integration/framework
parentd9b9484b4af2a21c3f5dea6ec10a3128e7304d07 (diff)
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
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework12
1 files changed, 8 insertions, 4 deletions
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