4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'i386'
10 configcompression
'.' 'gz'
12 insertpackage
'unstable' 'foo' 'all' '1.0'
14 setupaptarchive
--no-update
16 # make Packages *only* accessible 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' ')
29 rm -rf rootdir
/var
/lib
/apt
/lists
30 # we moved the Packages file away, normal update won't work
31 testfailure aptget update
"$@"
32 # ensure we do not know about "foo"
33 testfailureequal
"Reading package lists...
34 Building dependency tree...
35 E: Unable to locate package foo" aptget
install -q -s foo
38 ensureitsbroken
-o Acquire
::By
-Hash=1
41 rm -rf rootdir
/var
/lib
/apt
/lists
42 testsuccess aptget update
-o Acquire
::Languages
=none
"$@"
43 testsuccessequal
"Inst foo (1.0 unstable [all])
44 Conf foo (1.0 unstable [all])" aptget
install -qq -s foo
46 msgmsg
'Test by-hash via' 'config option'
47 ensureitworks
-o Acquire
::By
-Hash=force
49 msgmsg
'Test by-hash via' 'release option'
50 cp -a aptarchive
/dists aptarchive
/dists.bak
51 # add magic string to Release file ...
52 sed -i '/^Suite: / a \
53 Acquire-By-Hash: yes' aptarchive
/dists
/unstable
/Release
56 ensureitsbroken
-o Acquire
::By
-Hash=0
58 msgmsg
'Test by-hash via' 'sources option'
59 sed -i "s#^\(deb\(-src\)\?\) #\1 [by-hash=yes] #" rootdir
/etc
/apt
/sources.list.d
/*
61 #ensureitsbroken -o Acquire::By-Hash=0
63 rm -rf aptarchive
/dists
64 cp -a aptarchive
/dists.bak aptarchive
/dists
65 #ensureitworks -o Acquire::By-Hash=force
66 ensureitsbroken
-o Acquire
::By
-Hash=1
67 ensureitsbroken
-o Acquire
::By
-Hash=0
69 sed -i "s#^\(deb\(-src\)\?\) \[by-hash=yes\] #\1 [by-hash=force] #" rootdir
/etc
/apt
/sources.list.d
/*
71 #ensureitsbroken -o Acquire::By-Hash=0