]>
git.saurik.com Git - apt.git/blob - test/integration/test-apt-keep-downloaded-pkgs
4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'native'
10 buildsimplenativepackage 'pkg1' 'all' '1.0' 'stable'
11 buildsimplenativepackage 'pkg2' 'all' '1.0' 'stable'
12 buildsimplenativepackage 'pkg3' 'all' '1.0' 'stable'
13 buildsimplenativepackage 'pkg4' 'all' '1.0' 'stable'
15 # local (file) installs
18 # ensure that install from local sources does not remove debs
19 testsuccess aptget install pkg1 -o APT::Keep-Downloaded-Packages=false
20 testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb
22 # now switch to http and downloading debs
24 testsuccess aptget update
26 # ensure that the downloaded pkg is kept with "keep
=true
"
27 testsuccess aptget install pkg2 -o APT::Keep-Downloaded-Packages=true
28 testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb
29 testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb
31 # ensure that the downloaded pkg is removed when requested
32 testsuccess aptget install pkg3 -o APT::Keep-Downloaded-Packages=false
33 testsuccess test -f aptarchive/pool/pkg3_1.0_all.deb
34 # this was there before, keep it
35 testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb
36 # this got installed so we can remove it now
37 testfailure test -f rootdir/var/cache/apt/archives/pkg3_1.0_all.deb
40 # ensure that install from the download dir does not delete packages
41 mv aptarchive/pool/pkg4_1.0_all.deb rootdir/var/cache/apt/archives
42 testsuccess aptget install $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb -o APT::Keep-Downloaded-Packages=false
43 testsuccess test -f $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb