3 # Ensure that we do not modify file:/// uris (regression test for
8 TESTDIR
=$(readlink -f $(dirname $0))
12 configarchitecture
"amd64"
13 configcompression
'bz2' 'gz'
16 insertpackage
'unstable' 'foo' 'all' '1'
17 insertsource
'unstable' 'foo' 'all' '1'
19 setupaptarchive
--no-update
21 # ensure the archive is not writable
22 addtrap
'prefix' 'chmod 750 aptarchive/dists/unstable/main/binary-all;'
23 chmod 550 aptarchive
/dists
/unstable
/main
/binary
-all
25 testsuccess aptget update
27 # the release files aren't an IMS-hit, but the indexes are
28 redatereleasefiles
'+1 hour'
30 # we don't download the index if it isn't updated
31 testsuccess aptget update
-o Debug
::pkgAcquire
::Auth
=1
32 # file:/ isn't shown in the log, so see if it was downloaded anyhow
33 cp -a rootdir
/tmp
/testsuccess.output rootdir
/tmp
/update.output
34 canary
="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-all/Packages.bz2 | sha512sum |cut -f1 -d' ')"
35 testfailure
grep -- "$canary" rootdir
/tmp
/update.output
38 # foo is still available
39 testsuccess aptget
install -s foo
40 testsuccess aptcache showsrc foo
41 testsuccess aptget
source foo
--print-uris
45 # the release file is new again, the index still isn't, but it is somehow gone now from disk
46 redatereleasefiles
'+2 hour'
47 find rootdir
/var
/lib
/apt
/lists
-name '*_Packages*' -delete
49 testsuccess aptget update
-o Debug
::pkgAcquire
::Auth
=1
50 # file:/ isn't shown in the log, so see if it was downloaded anyhow
51 cp -a rootdir
/tmp
/testsuccess.output rootdir
/tmp
/update.output
52 canary
="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-all/Packages.bz2 | sha512sum |cut -f1 -d' ')"
53 testsuccess
grep -- "$canary" rootdir
/tmp
/update.output