]> git.saurik.com Git - apt.git/blame - test/integration/test-pin-non-existent-package
add --sha512 option + documentation for apt-ftparchive
[apt.git] / test / integration / test-pin-non-existent-package
CommitLineData
00c6e1a3
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture "i386"
8
a02f0c29 9insertpackage 'unstable' 'rapt' 'i386' '0.8.15'
00c6e1a3
MV
10insertpackage 'unstable' 'arch' 'i386' '1.0'
11
12setupaptarchive
13
14testcandidate() {
15 msgtest "Test that the Candidate for $1 is" $2
16 if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then
17 msgpass
18 else
19 echo
20 aptcache policy $1
21 msgfail
22 fi
23}
24
a02f0c29 25testcandidate rapt '0.8.15'
25b86db1
DK
26testsuccessequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
27testsuccessequal 'Reading package lists...
00c6e1a3 28Building dependency tree...
2a884c61 29Calculating upgrade...
a02f0c29 300 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
00c6e1a3 31
a02f0c29 32echo 'Package: rapt
00c6e1a3
MV
33Pin: release a=unstable
34Pin-Priority: -1' > rootdir/etc/apt/preferences
35
a02f0c29 36testcandidate rapt '(none)'
25b86db1
DK
37testsuccessequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
38testsuccessequal 'Reading package lists...
00c6e1a3 39Building dependency tree...
2a884c61 40Calculating upgrade...
a02f0c29 410 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
00c6e1a3
MV
42
43echo '
44Package: doesntexist
45Pin: release a=unstable
46Pin-Priority: 1000' >> rootdir/etc/apt/preferences
47
a02f0c29 48testcandidate rapt '(none)'
00c6e1a3
MV
49
50echo '
a02f0c29 51Package: rapt
00c6e1a3
MV
52Pin: release a=unstable
53Pin-Priority: 1000' >> rootdir/etc/apt/preferences
54
a02f0c29 55testcandidate rapt '(none)'
25b86db1 56testsuccessequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
00c6e1a3 57
25b86db1 58testsuccessequal 'Reading package lists...
00c6e1a3 59Building dependency tree...
2a884c61 60Calculating upgrade...
a02f0c29 610 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
00c6e1a3
MV
62
63echo 'Package: arch:amd64
64Pin: release a=unstable
65Pin-Priority: -1' > rootdir/etc/apt/preferences
66
67testcandidate arch '1.0'
68
69echo '
70Package: arch:i386
71Pin: release a=unstable
72Pin-Priority: -1' >> rootdir/etc/apt/preferences
73
74testcandidate arch '(none)'
75