4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
10 insertpackage
'unstable' 'foo' 'all' '1.0'
12 setupaptarchive
--no-update
14 APTARCHIVE
=$(readlink -f ./aptarchive)
16 # make Packages *only* accessable by-hash for this test
17 mkdir -p aptarchive
/dists
/unstable
/main
/binary
-i386/by
-hash/SHA512
18 (cd aptarchive
/dists
/unstable
/main
/binary
-i386/by
-hash/SHA512
&&
19 mv ..
/..
/Packages
* .
&&
20 ln -s Packages.gz
$(sha512sum Packages.gz|cut -f1 -d' ') )
23 mkdir -p aptarchive
/dists
/unstable
/main
/source
/by
-hash/SHA512
24 (cd aptarchive
/dists
/unstable
/main
/source
/by
-hash/SHA512
&&
25 ln -s ..
/..
/Sources.gz
$(sha512sum ../../Sources.gz|cut -f1 -d' ')
28 # we moved the Packages file away, normal update won't work
29 testfailure aptget upate
31 # ensure we do not know about "foo"
32 testfailureequal
"Reading package lists...
33 Building dependency tree...
34 E: Unable to locate package foo" aptget
install -q -s foo
36 # ensure we can apt-get update by hash
37 testsuccess aptget update
-o APT
::Acquire
::By
-Hash=1 -o Acquire
::Languages
=none
40 testsuccessequal
"Inst foo (1.0 unstable [all])
41 Conf foo (1.0 unstable [all])" aptget
install -qq -s foo
43 # add magic string to Release file ...
44 MAGIC
="Acquire-By-Hash: true"
45 sed -i "s#Suite: unstable#Suite: unstable\n$MAGIC#" aptarchive
/dists
/unstable
/Release
47 # ... and verify that it fetches by hash now
48 testsuccess aptget update
-o Acquire
::Languages
=none