Browse Source

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
tags/debian/2.1.7
David Kalnischkies 2 months ago
parent
commit
3fe1419433
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      test/integration/framework

+ 8
- 4
test/integration/framework View File

@@ -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


Loading…
Cancel
Save