diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-07-15 21:17:11 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-07-15 21:59:10 +0200 |
commit | 87f99f6fa701d2557811134380c1f232cf07a422 (patch) | |
tree | 1ebbbb1ffb490f936aa3bf8b97aea9f9052bebeb /test/integration/framework | |
parent | f883d2c3675eae2700e4cd1532c1a236cae69a4e (diff) |
tests: activate dpkg multi-arch even if test is single arch
Most tests are either multiarch, do not care for the specific
architecture or do not interact with dpkg, so really effect by this is
only test-external-installation-planner-protocol, but its a general
issue that while APT can be told to treat any architecture as native
dpkg has the native architecture hardcoded so if we run tests we must
make sure that dpkg knows about the architecture we will treat as
"native" in apt as otherwise dpkg will refuse to install packages from
such an architecture.
This reverts f883d2c3675eae2700e4cd1532c1a236cae69a4e as it complicates
the test slightly for no practical gain after the generic fix.
Diffstat (limited to 'test/integration/framework')
-rw-r--r-- | test/integration/framework | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/integration/framework b/test/integration/framework index 21f41aa17..27239cce4 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -482,17 +482,21 @@ configdpkg() { rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg if command dpkg --assert-multi-arch >/dev/null 2>&1 ; then local ARCHS="$(getarchitectures)" - if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then - DPKGARCH="$(dpkg --print-architecture)" - 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 - fi + local DPKGARCH="$(dpkg --print-architecture)" + # this ensures that even if multi-arch isn't active in the view + # of apt, given that dpkg can't be told which arch is native + # 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 fi - done + fi + done + # if multi-arch make sure dpkg can detect itself as capable of it + if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then # dpkg doesn't really check the version as long as it is fully installed, # but just to be sure we choose one above the required version |