]> git.saurik.com Git - apt.git/blob - test/integration/test-dpkg-assert-multi-arch
merged from lp:~donkult/apt/experimental/
[apt.git] / test / integration / test-dpkg-assert-multi-arch
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'
12
13 setupaptarchive
14
15 testqualifier() {
16 msgtest 'Test for correct qualifier mode' $2
17 GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -- '--configure' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
18 test "$GIVEN" = "$2" && msgpass || msgfail
19 }
20
21 # non-multiarch or "ubuntus" old multiarchified dpkg
22 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
23 echo '#! /bin/sh
24 if echo "$*" | grep -q -- "--assert-multi-arch"; then
25 return 2;
26 fi
27 return $*' > ./dpkg-wrapper
28 chmod +x ./dpkg-wrapper
29
30 testqualifier 'native-pkg' 'native-pkg'
31 testqualifier 'native-pkg:amd64' 'native-pkg'
32 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
33 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
34 testqualifier 'same-lib' 'same-lib'
35 testqualifier 'same-lib:amd64' 'same-lib'
36 testqualifier 'same-lib:i386' 'same-lib:i386'
37
38 # multiarch dpkg (new interface version)
39
40 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
41 echo '#! /bin/sh
42 if echo "$*" | grep -q -- "--assert-multi-arch"; then
43 return 0;
44 fi
45 return $*' > ./dpkg-wrapper
46
47 testqualifier 'native-pkg' 'native-pkg:amd64'
48 testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
49 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
50 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
51 testqualifier 'same-lib' 'same-lib:amd64'
52 testqualifier 'same-lib:amd64' 'same-lib:amd64'
53 testqualifier 'same-lib:i386' 'same-lib:i386'