]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-814139-pickup-of-different-cache-states
Don't download "optional" files not in Release :/.
[apt.git] / test / integration / test-bug-814139-pickup-of-different-cache-states
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture 'amd64'
9
10 insertinstalledpackage 'build-essential' 'amd64' '1'
11
12 buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar'
13 buildsimplenativepackage 'bar' 'all' '1' 'stable'
14
15 setupaptarchive
16
17 cp rootdir/var/lib/dpkg/status status.backup
18
19 testrun() {
20 cp status.backup rootdir/var/lib/dpkg/status
21 cleanup
22 testdpkgnotinstalled 'bar'
23 testsuccess aptget build-dep foo -y
24 testdpkginstalled 'bar'
25 cleanup
26 cd downloaded
27 testsuccess aptget source foo
28 testsuccess test -s foo_1.tar.* -a -s foo_1.dsc
29 rm foo_1.tar.* foo_1.dsc
30 testsuccess test -d foo-1
31 rm -rf foo-1
32 cd ..
33 cleanup
34 testsuccess aptget install foo -y
35 }
36
37 msgmsg 'Caches fully up-to-date'
38 cleanup() {
39 rm -f rootdir/var/cache/apt/*.bin
40 testsuccess aptcache gencaches
41 }
42 testrun
43
44 msgmsg 'pkgcache.bin is missing'
45 cleanup() {
46 rm -f rootdir/var/cache/apt/*.bin
47 testsuccess aptcache gencaches
48 rm rootdir/var/cache/apt/pkgcache.bin
49 }
50 testrun
51
52 msgmsg 'Caches are not writeable'
53 rm rootdir/var/cache/apt/*.bin
54 addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;'
55 chmod 555 rootdir/var/cache/apt
56 testsuccess aptcache gencaches
57 cleanup() {
58 testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555'
59 }
60 testrun