]> 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 buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
13 buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable'
14
15 setupaptarchive
16
17 testqualifier() {
18 msgtest 'Test for correct qualifier mode' $2
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
27 }
28
29 # non-multiarch or "ubuntus" old multiarchified dpkg
30 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
31 echo '#! /bin/sh
32 if echo "$*" | grep -q -- "--assert-multi-arch"; then
33 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
34 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
35 return 2;
36 fi
37 return $*' > ./dpkg-wrapper
38 chmod +x ./dpkg-wrapper
39
40 testqualifier 'native-pkg' 'native-pkg'
41 testqualifier 'native-pkg:amd64' 'native-pkg'
42 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
43 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
44 testqualifier 'same-lib' 'same-lib'
45 testqualifier 'same-lib:amd64' 'same-lib'
46 testqualifier 'same-lib:i386' 'same-lib:i386'
47 testqualifier 'all-pkg' 'all-pkg'
48 testqualifier 'all-pkg:amd64' 'all-pkg'
49 testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
50 testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
51 insertinstalledpackage 'all-pkg' 'amd64' '1.0'
52 insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
53 testqualifier 'all-pkg' 'all-pkg'
54 testqualifier 'all-pkg:amd64' 'all-pkg'
55 testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
56 testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
57
58 # multiarch dpkg (new interface version)
59
60 rm rootdir/var/lib/dpkg/status
61 touch rootdir/var/lib/dpkg/status
62 echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
63 echo '#! /bin/sh
64 if echo "$*" | grep -q -- "--assert-multi-arch"; then
65 return 0;
66 fi
67 return $*' > ./dpkg-wrapper
68
69 testqualifier 'native-pkg' 'native-pkg:amd64'
70 testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
71 testqualifier 'foreign-pkg' 'foreign-pkg:i386'
72 testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
73 testqualifier 'same-lib' 'same-lib:amd64'
74 testqualifier 'same-lib:amd64' 'same-lib:amd64'
75 testqualifier 'same-lib:i386' 'same-lib:i386'
76 testqualifier 'all-pkg' 'all-pkg:all'
77 testqualifier 'all-pkg:amd64' 'all-pkg:all'
78 testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
79 testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
80 insertinstalledpackage 'all-pkg' 'amd64' '1.0'
81 insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
82 testqualifier 'all-pkg' 'all-pkg:all'
83 testqualifier 'all-pkg:amd64' 'all-pkg:all'
84 testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
85 testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'