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