]> git.saurik.com Git - apt.git/blame - test/integration/test-pin-non-existent-package
merge with debian-sid 0.8.15.1
[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'
9164e147 10insertpackage 'unstable' 'arch' 'i386' '1.0'
5b7d1ee6
DK
11
12setupaptarchive
13
14testcandidate() {
15 msgtest "Test that the Candidate for $1 is" $2
e2bba11c
DK
16 if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then
17 msgpass
18 else
19 echo
20 aptcache policy $1
21 msgfail
22 fi
5b7d1ee6
DK
23}
24
25testcandidate apt '0.8.15'
26testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
27testequal 'Reading package lists...
28Building dependency tree...
290 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
30
31echo 'Package: apt
32Pin: release a=unstable
33Pin-Priority: -1' > rootdir/etc/apt/preferences
34
35testcandidate apt '(none)'
36testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
37testequal 'Reading package lists...
38Building dependency tree...
390 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
40
41echo '
42Package: doesntexist
43Pin: release a=unstable
44Pin-Priority: 1000' >> rootdir/etc/apt/preferences
45
e2bba11c
DK
46testcandidate apt '(none)'
47
48echo '
49Package: apt
50Pin: release a=unstable
51Pin-Priority: 1000' >> rootdir/etc/apt/preferences
52
5b7d1ee6
DK
53testcandidate apt '(none)'
54testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
55
56testequal 'Reading package lists...
57Building dependency tree...
580 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
9164e147
DK
59
60echo 'Package: arch:amd64
61Pin: release a=unstable
62Pin-Priority: -1' > rootdir/etc/apt/preferences
63
64testcandidate arch '1.0'
65
66echo '
67Package: arch:i386
68Pin: release a=unstable
69Pin-Priority: -1' >> rootdir/etc/apt/preferences
70
71testcandidate arch '(none)'
72