]> git.saurik.com Git - apt.git/blame - test/integration/test-dpkg-assert-multi-arch
releasing version 0.8.16~exp10
[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'
12
13setupaptarchive
14
15testqualifier() {
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
22echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
23echo '#! /bin/sh
24if echo "$*" | grep -q -- "--assert-multi-arch"; then
25 return 2;
26fi
27return $*' > ./dpkg-wrapper
28chmod +x ./dpkg-wrapper
29
30testqualifier 'native-pkg' 'native-pkg'
31testqualifier 'native-pkg:amd64' 'native-pkg'
32testqualifier 'foreign-pkg' 'foreign-pkg:i386'
33testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
34testqualifier 'same-lib' 'same-lib'
35testqualifier 'same-lib:amd64' 'same-lib'
36testqualifier 'same-lib:i386' 'same-lib:i386'
37
38# multiarch dpkg (new interface version)
39
40echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
41echo '#! /bin/sh
42if echo "$*" | grep -q -- "--assert-multi-arch"; then
43 return 0;
44fi
45return $*' > ./dpkg-wrapper
46
47testqualifier 'native-pkg' 'native-pkg:amd64'
48testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
49testqualifier 'foreign-pkg' 'foreign-pkg:i386'
50testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
51testqualifier 'same-lib' 'same-lib:amd64'
52testqualifier 'same-lib:amd64' 'same-lib:amd64'
53testqualifier 'same-lib:i386' 'same-lib:i386'