4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64'
9 insertpackage 'testing' 'foo' 'all' '1'
11 getcodenamefromsuite() { echo -n 'stretch'; }
12 setupaptarchive --no-update
13 APTARCHIVE="$(readlink -f './aptarchive')"
14 ln -s "${APTARCHIVE}/dists
/testing
" "${APTARCHIVE}/dists
/stretch
"
15 ln -s "${APTARCHIVE}/dists
/testing
" "${APTARCHIVE}/dists
/zurg
"
17 testfailure apt show foo
18 testsuccess apt update
19 testsuccess apt show foo
21 rm -rf rootdir/var/lib/apt/lists
22 sed -i -e 's#testing#stretch#g' rootdir/etc/apt/sources.list.d/*
23 testsuccess apt update
24 testsuccess apt show foo
26 rm -rf rootdir/var/lib/apt/lists
27 sed -i -e 's#stretch#zurg#g' rootdir/etc/apt/sources.list.d/*
28 testwarningmsg "W
: Conflicting distribution
: file:$APTARCHIVE zurg InRelease
(expected zurg but got stretch
)" apt update
29 testsuccess apt show foo
31 # check that 'foo/bar' is rewritten to 'foo' while we are at it
32 rm -rf rootdir/var/lib/apt/lists
33 sed -i -e 's#zurg#stretch/updates#g' rootdir/etc/apt/sources.list.d/*
34 testfailure apt update
35 testfailure apt show foo
36 ln -s "${APTARCHIVE}/dists
/testing
" "${APTARCHIVE}/dists
/stretch
/updates
"
37 testsuccess apt update
38 testsuccess apt show foo
40 # … but only if needed
41 rm -rf rootdir/var/lib/apt/lists
42 sed -i -e 's#stretch#buster#g' rootdir/etc/apt/sources.list.d/*
43 sed -i -e 's#^Codename: stretch$#Codename: buster/updates#g' $(find ./aptarchive -name 'Release')
45 testfailure apt update
46 testfailure apt show foo
47 ln -s "${APTARCHIVE}/dists
/testing
" "${APTARCHIVE}/dists
/buster
"
48 testsuccess apt update
49 testsuccess apt show foo
51 # changing codenames gets a warning, too
52 rm -rf rootdir/var/lib/apt/lists
53 sed -i -e 's#buster#testing#g' rootdir/etc/apt/sources.list.d/*
54 testsuccess apt update
55 testsuccess apt show foo
56 sed -i -e 's#^Codename: buster#Codename: zurg#g' $(find ./aptarchive -name 'Release')
58 testwarningmsg "W
: Conflicting distribution
: file:$APTARCHIVE testing
/updates InRelease
(expected buster
/updates but got zurg
/updates
)" apt update
59 testsuccess apt show foo
60 testsuccess apt update
61 testsuccess apt show foo