]> git.saurik.com Git - apt.git/blob - test/integration/test-dpkg-assert-multi-arch
* apt-pkg/deb/dpkgpm.cc:
[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 -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
18 if [ "$GIVEN" = "$2" ]; then
19 msgpass
20 else
21 echo
22 echo "$GIVEN"
23 msgfail
24 fi
25 }
26
27 # non-multiarch or "ubuntus" old multiarchified dpkg
28 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
29 echo '#! /bin/sh
30 if echo "$*" | grep -q -- "--assert-multi-arch"; then
31 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
32 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
33 return 2;
34 fi
35 return $*' > ./dpkg-wrapper
36 chmod +x ./dpkg-wrapper
37
38 testqualifier 'native-pkg' 'native-pkg'
39 testqualifier 'native-pkg:amd64' 'native-pkg'
40 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
41 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
42 testqualifier 'same-lib' 'same-lib'
43 testqualifier 'same-lib:amd64' 'same-lib'
44 testqualifier 'same-lib:i386' 'same-lib:i386'
45
46 # multiarch dpkg (new interface version)
47
48 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
49 echo '#! /bin/sh
50 if echo "$*" | grep -q -- "--assert-multi-arch"; then
51 return 0;
52 fi
53 return $*' > ./dpkg-wrapper
54
55 testqualifier 'native-pkg' 'native-pkg:amd64'
56 testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
57 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
58 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
59 testqualifier 'same-lib' 'same-lib:amd64'
60 testqualifier 'same-lib:amd64' 'same-lib:amd64'
61 testqualifier 'same-lib:i386' 'same-lib:i386'