]> git.saurik.com Git - apt.git/blame - test/integration/test-dpkg-assert-multi-arch
* apt-pkg/deb/dpkgpm.cc:
[apt.git] / test / integration / test-dpkg-assert-multi-arch
CommitLineData
86fc2ca8
DK
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'
3a5ec305
DK
12buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
13buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable'
86fc2ca8
DK
14
15setupaptarchive
16
17testqualifier() {
18 msgtest 'Test for correct qualifier mode' $2
67b5d3dc
DK
19 GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
20 if [ "$GIVEN" = "$2" ]; then
21 msgpass
22 else
23 echo
24 echo "$GIVEN"
25 msgfail
26 fi
86fc2ca8
DK
27}
28
29# non-multiarch or "ubuntus" old multiarchified dpkg
30echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
31echo '#! /bin/sh
32if echo "$*" | grep -q -- "--assert-multi-arch"; then
67b5d3dc
DK
33 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
34 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
86fc2ca8
DK
35 return 2;
36fi
37return $*' > ./dpkg-wrapper
38chmod +x ./dpkg-wrapper
39
40testqualifier 'native-pkg' 'native-pkg'
41testqualifier 'native-pkg:amd64' 'native-pkg'
42testqualifier 'foreign-pkg' 'foreign-pkg:i386'
43testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
44testqualifier 'same-lib' 'same-lib'
45testqualifier 'same-lib:amd64' 'same-lib'
46testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
47testqualifier 'all-pkg' 'all-pkg'
48testqualifier 'all-pkg:amd64' 'all-pkg'
49testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
50testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
51insertinstalledpackage 'all-pkg' 'amd64' '1.0'
52insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
53testqualifier 'all-pkg' 'all-pkg'
54testqualifier 'all-pkg:amd64' 'all-pkg'
55testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
56testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
86fc2ca8
DK
57
58# multiarch dpkg (new interface version)
59
3a5ec305
DK
60rm rootdir/var/lib/dpkg/status
61touch rootdir/var/lib/dpkg/status
86fc2ca8
DK
62echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
63echo '#! /bin/sh
64if echo "$*" | grep -q -- "--assert-multi-arch"; then
65 return 0;
66fi
67return $*' > ./dpkg-wrapper
68
69testqualifier 'native-pkg' 'native-pkg:amd64'
70testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
71testqualifier 'foreign-pkg' 'foreign-pkg:i386'
72testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
73testqualifier 'same-lib' 'same-lib:amd64'
74testqualifier 'same-lib:amd64' 'same-lib:amd64'
75testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
76testqualifier 'all-pkg' 'all-pkg:all'
77testqualifier 'all-pkg:amd64' 'all-pkg:all'
78testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
79testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
80insertinstalledpackage 'all-pkg' 'amd64' '1.0'
81insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
82testqualifier 'all-pkg' 'all-pkg:all'
83testqualifier 'all-pkg:amd64' 'all-pkg:all'
84testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
85testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'