From b7a1076f18022cbeb7baf4d82ab8bae0f725a573 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 13 Mar 2016 01:02:30 +0100 Subject: don't use Desc.URI to calculate .diff/Index filenames The URI descibing an item can change via mirrors/redirectors which causes the .diff/Index files to get the wrong names in storage. Git-Dch: Ignore --- test/integration/test-pdiff-usage | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 2318448f5..11c8c4cc1 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -65,7 +65,7 @@ testrun() { configcompression '.' 'gz' # see if the code deals properly with leftover partial files - touch rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_Packages + partialleftovers msgmsg "Testcase: apply with one patch: $*" find aptarchive -name 'Packages*' -type f -delete @@ -279,7 +279,20 @@ testcase() { testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0 "$@" testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0 "$@" } +partialleftovers() { touch "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_Packages"; } aptautotest_apt_update() { aptautotest_aptget_update "$@"; testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_Packages"; } testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=false +partialleftovers() { touch "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_Packages.$LOWCOSTEXT"; } aptautotest_apt_update() { aptautotest_aptget_update "$@"; testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_Packages.$LOWCOSTEXT"; } testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=true + + +partialleftovers() { touch "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_redirectme_Packages.$LOWCOSTEXT"; } +webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/" +rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme" +aptautotest_apt_update() { + aptautotest_aptget_update "$@" + testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_redirectme_Packages.$LOWCOSTEXT" + testempty find rootdir/var/lib/apt/lists -type f \! \( -name lock -o -name '*_redirectme_*' \) +} +testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=true -- cgit v1.2.3