]>
Commit | Line | Data |
---|---|---|
86fc2ca8 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
86fc2ca8 DK |
6 | setupenvironment |
7 | configarchitecture 'amd64' 'i386' | |
8 | ||
9 | buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' | |
10 | buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' | |
11 | buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' | |
3a5ec305 | 12 | buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' |
2a2a7ef4 | 13 | buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign' |
86fc2ca8 DK |
14 | |
15 | setupaptarchive | |
16 | ||
17 | testqualifier() { | |
2a2a7ef4 | 18 | msgtest 'Test with' $1 'for correct qualifier mode' $2 |
b4450f1d | 19 | #aptget install $1 -qq -o Debug::pkgDPkgPM=1 || true |
28557f94 | 20 | aptget install $1 -qq -o Debug::pkgDPkgPM=1 -o Dpkg::ExplicitLastConfigure=1 -o PackageManager::Configure=all > testqualifier.output 2>&1 || true |
27f38567 | 21 | GIVEN="$(grep -v -- '--unpack' testqualifier.output | sed -ne 's/^.*--[rpc][^ ]* \([^ ]*\).*$/\1/p')" |
67b5d3dc DK |
22 | if [ "$GIVEN" = "$2" ]; then |
23 | msgpass | |
24 | else | |
b4450f1d DK |
25 | cat >&2 testqualifier.output |
26 | echo >&2 | |
27 | echo >&2 "$GIVEN" | |
67b5d3dc DK |
28 | msgfail |
29 | fi | |
86fc2ca8 DK |
30 | } |
31 | ||
eb191ca3 | 32 | msgmsg 'non-multiarch or "ubuntus" old multiarchified dpkg' |
86fc2ca8 | 33 | echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper |
eb191ca3 DK |
34 | cat > ./dpkg-wrapper <<EOF |
35 | #! /bin/sh | |
36 | if echo "\$*" | grep -q -- "--assert-multi-arch"; then | |
67b5d3dc DK |
37 | echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch' |
38 | echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch' | |
eb191ca3 | 39 | exit 2 |
86fc2ca8 | 40 | fi |
eb191ca3 DK |
41 | exec "\$@" |
42 | EOF | |
86fc2ca8 DK |
43 | chmod +x ./dpkg-wrapper |
44 | ||
45 | testqualifier 'native-pkg' 'native-pkg' | |
46 | testqualifier 'native-pkg:amd64' 'native-pkg' | |
47 | testqualifier 'foreign-pkg' 'foreign-pkg:i386' | |
48 | testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' | |
49 | testqualifier 'same-lib' 'same-lib' | |
50 | testqualifier 'same-lib:amd64' 'same-lib' | |
51 | testqualifier 'same-lib:i386' 'same-lib:i386' | |
3a5ec305 DK |
52 | testqualifier 'all-pkg' 'all-pkg' |
53 | testqualifier 'all-pkg:amd64' 'all-pkg' | |
54 | testqualifier 'all-foreign-pkg' 'all-foreign-pkg' | |
55 | testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' | |
56 | insertinstalledpackage 'all-pkg' 'amd64' '1.0' | |
2a2a7ef4 | 57 | insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' |
3a5ec305 DK |
58 | testqualifier 'all-pkg' 'all-pkg' |
59 | testqualifier 'all-pkg:amd64' 'all-pkg' | |
60 | testqualifier 'all-foreign-pkg' 'all-foreign-pkg' | |
61 | testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' | |
2a2a7ef4 DK |
62 | insertinstalledpackage 'always-all-pkg' 'all' '1.0' |
63 | insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' | |
64 | testqualifier 'all-pkg-' 'all-pkg' | |
65 | testqualifier 'all-foreign-pkg-' 'all-foreign-pkg' | |
66 | testqualifier 'always-all-pkg-' 'always-all-pkg' | |
67 | testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg' | |
86fc2ca8 | 68 | |
eb191ca3 | 69 | msgmsg 'multiarch dpkg (new interface version)' |
3a5ec305 DK |
70 | rm rootdir/var/lib/dpkg/status |
71 | touch rootdir/var/lib/dpkg/status | |
86fc2ca8 | 72 | echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper |
eb191ca3 DK |
73 | cat > ./dpkg-wrapper <<EOF |
74 | #! /bin/sh | |
75 | if echo "\$*" | grep -q -- "--assert-multi-arch"; then | |
76 | exit 0 | |
77 | fi | |
78 | exec "\$@" | |
79 | EOF | |
80 | chmod +x ./dpkg-wrapper | |
86fc2ca8 DK |
81 | |
82 | testqualifier 'native-pkg' 'native-pkg:amd64' | |
83 | testqualifier 'native-pkg:amd64' 'native-pkg:amd64' | |
84 | testqualifier 'foreign-pkg' 'foreign-pkg:i386' | |
85 | testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' | |
86 | testqualifier 'same-lib' 'same-lib:amd64' | |
87 | testqualifier 'same-lib:amd64' 'same-lib:amd64' | |
88 | testqualifier 'same-lib:i386' 'same-lib:i386' | |
3a5ec305 DK |
89 | testqualifier 'all-pkg' 'all-pkg:all' |
90 | testqualifier 'all-pkg:amd64' 'all-pkg:all' | |
91 | testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' | |
92 | testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' | |
93 | insertinstalledpackage 'all-pkg' 'amd64' '1.0' | |
2a2a7ef4 | 94 | insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' |
3a5ec305 DK |
95 | testqualifier 'all-pkg' 'all-pkg:all' |
96 | testqualifier 'all-pkg:amd64' 'all-pkg:all' | |
97 | testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' | |
98 | testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' | |
2a2a7ef4 DK |
99 | insertinstalledpackage 'always-all-pkg' 'all' '1.0' |
100 | insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' | |
101 | testqualifier 'all-pkg-' 'all-pkg:amd64' | |
102 | testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64' | |
103 | testqualifier 'always-all-pkg-' 'always-all-pkg:all' | |
104 | testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all' |