]> git.saurik.com Git - apt.git/blame - test/integration/test-pin-non-existent-package
- ensure that only the first specific stanza for a package is used
[apt.git] / test / integration / test-pin-non-existent-package
CommitLineData
5b7d1ee6
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture "i386"
8
9insertpackage 'unstable' 'apt' 'i386' '0.8.15'
10
11setupaptarchive
12
13testcandidate() {
14 msgtest "Test that the Candidate for $1 is" $2
e2bba11c
DK
15 if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then
16 msgpass
17 else
18 echo
19 aptcache policy $1
20 msgfail
21 fi
5b7d1ee6
DK
22}
23
24testcandidate apt '0.8.15'
25testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
26testequal 'Reading package lists...
27Building dependency tree...
280 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
29
30echo 'Package: apt
31Pin: release a=unstable
32Pin-Priority: -1' > rootdir/etc/apt/preferences
33
34testcandidate apt '(none)'
35testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
36testequal 'Reading package lists...
37Building dependency tree...
380 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
39
40echo '
41Package: doesntexist
42Pin: release a=unstable
43Pin-Priority: 1000' >> rootdir/etc/apt/preferences
44
e2bba11c
DK
45testcandidate apt '(none)'
46
47echo '
48Package: apt
49Pin: release a=unstable
50Pin-Priority: 1000' >> rootdir/etc/apt/preferences
51
5b7d1ee6
DK
52testcandidate apt '(none)'
53testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
54
55testequal 'Reading package lists...
56Building dependency tree...
570 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade