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