X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4f8f5e3d8de21d578c6acd46896fcf62447a7cfd..4ff5e237d5685be187a75c563b86e80ea3e7cc01:/test/integration/test-dpkg-assert-multi-arch diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index 532cfd26a..a99f320b3 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' 'i386' @@ -10,31 +10,36 @@ buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' -buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' +buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign' setupaptarchive testqualifier() { - msgtest 'Test for correct qualifier mode' $2 - GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" + msgtest 'Test with' $1 'for correct qualifier mode' $2 + #aptget install $1 -qq -o Debug::pkgDPkgPM=1 || true + aptget install $1 -qq -o Debug::pkgDPkgPM=1 -o Dpkg::ExplicitLastConfigure=1 -o PackageManager::Configure=all > testqualifier.output 2>&1 || true + GIVEN="$(grep -v -- '--unpack' testqualifier.output | sed -ne 's/^.*--[rpc][^ ]* \([^ ]*\).*$/\1/p')" if [ "$GIVEN" = "$2" ]; then msgpass else - echo - echo "$GIVEN" + cat >&2 testqualifier.output + echo >&2 + echo >&2 "$GIVEN" msgfail fi } -# non-multiarch or "ubuntus" old multiarchified dpkg +msgmsg 'non-multiarch or "ubuntus" old multiarchified dpkg' echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper -echo '#! /bin/sh -if echo "$*" | grep -q -- "--assert-multi-arch"; then +cat > ./dpkg-wrapper <&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch' echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch' - return 2; + exit 2 fi -return $*' > ./dpkg-wrapper +exec "\$@" +EOF chmod +x ./dpkg-wrapper testqualifier 'native-pkg' 'native-pkg' @@ -49,22 +54,30 @@ testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg' testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg' +testqualifier 'always-all-pkg-' 'always-all-pkg' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg' -# multiarch dpkg (new interface version) - +msgmsg 'multiarch dpkg (new interface version)' rm rootdir/var/lib/dpkg/status touch rootdir/var/lib/dpkg/status echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper -echo '#! /bin/sh -if echo "$*" | grep -q -- "--assert-multi-arch"; then - return 0; +cat > ./dpkg-wrapper < ./dpkg-wrapper +exec "\$@" +EOF +chmod +x ./dpkg-wrapper testqualifier 'native-pkg' 'native-pkg:amd64' testqualifier 'native-pkg:amd64' 'native-pkg:amd64' @@ -78,8 +91,14 @@ testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg:all' testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg:amd64' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64' +testqualifier 'always-all-pkg-' 'always-all-pkg:all' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all'