]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-612958-use-dpkg-multiarch-config
* apt-pkg/deb/deblistparser.cc:
[apt.git] / test / integration / test-bug-612958-use-dpkg-multiarch-config
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386'
8 setupaptarchive
9
10 insertinstalledpackage 'libapt' 'i386' '1.0'
11 insertinstalledpackage 'libapt' 'amd64' '1.0'
12 insertinstalledpackage 'libapt' 'armel' '1.0'
13
14 testpass() {
15 rm rootdir/var/cache/apt/*.bin
16 msgtest 'Test architecture handling' "$1 with $2"
17 aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail
18 }
19
20 testfail() {
21 rm rootdir/var/cache/apt/*.bin
22 msgtest 'Test architecture handling' "$1 with $2"
23 aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass
24 }
25
26 testpass 'no config' 'i386'
27 testfail 'no config' 'amd64'
28 testfail 'no config' 'armel'
29
30 CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch
31 echo '#clear APT::Architectures;' >> $CONFFILE
32 echo 'APT::Architectures:: "i386";' >> $CONFFILE
33 echo 'APT::Architectures:: "amd64";' >> $CONFFILE
34
35 testpass 'apt config' 'i386'
36 testpass 'apt config' 'amd64'
37 testfail 'apt config' 'armel'
38
39 echo 'APT::Architectures:: "armel";' >> $CONFFILE
40
41 testpass 'apt config' 'armel'
42
43 rm $CONFFILE
44
45 echo '#clear APT::Architectures;' >> $CONFFILE
46 echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
47
48 echo '#! /bin/sh
49 echo "amd64"' > ./dpkg-printer
50 chmod +x ./dpkg-printer
51
52 testpass 'dpkg config' 'i386'
53 testpass 'dpkg config' 'amd64'
54 testfail 'dpkg config' 'armel'
55
56 echo '#! /bin/sh
57 echo "amd64 armel"' > ./dpkg-printer
58
59 testpass 'dpkg config' 'armel'