From 2b0369a5d1673d9e40f2af4db7677b040a26ee58 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 12 Sep 2021 16:08:52 +0200 Subject: Read and work with canonical file-URIs from sources.lists We allow file (and other file-based methods) URIs to either be given as file:///path or as file:/path, but in various places of the acquire system we perform string comparisons on URIs which do not handle this expecting the canonical representation produced by our URI code. That used to be hidden by us quoting and dequoting the URIs in the system, but as we don't do this anymore we have to be a bit more careful on input. Ideally we would do less of these comparisons, but for now lets be content with inserting a canonicalisation early on to prevent hangs in the acquire system. --- test/integration/test-method-mirror | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/integration/test-method-mirror') diff --git a/test/integration/test-method-mirror b/test/integration/test-method-mirror index 81a5585fd..ce44b86e3 100755 --- a/test/integration/test-method-mirror +++ b/test/integration/test-method-mirror @@ -148,7 +148,16 @@ Ign:2 http://localhost:${APTHTTPPORT}/failure2 stable InRelease Ign:3 http://localhost:${APTHTTPPORT}/failure unstable InRelease 404 Not Found" head -n 5 aptupdate.output -changetohttpswebserver +msgmsg 'do not hang on' 'file:///' +sed -i -e 's#file:/tmp#file:///tmp#' rootdir/etc/apt/sources.list.d/apt-test-unstable-deb* +testrun '*_localhost_*' '*_aptarchive_mirror.txt_*' +testsuccessequal "Get:1 file:${APTARCHIVE}/mirror.txt Mirrorlist [$(stat -c%s 'aptarchive/mirror.txt') B] +Ign:2 http://localhost:${APTHTTPPORT}/failure2 stable InRelease + 404 Not Found +Ign:3 http://localhost:${APTHTTPPORT}/failure unstable InRelease + 404 Not Found" head -n 5 aptupdate.output + +changetohttpswebserver --no-rewrite rm -f rootdir/etc/apt/sources.list.d/*-stable-* msgmsg 'fallback mirrors are used if needed' 'random' echo "http://localhost:${APTHTTPPORT}/failure2 priority:1 @@ -241,7 +250,7 @@ Reading package lists... Building dependency tree... Reading state information... All packages are up to date." apt update -sed -i -e "s#+file:${APTARCHIVE}#+http://localhost:${APTHTTPPORT}#" rootdir/etc/apt/sources.list.d/* +sed -i -e "s#+file:\(//\|\)${APTARCHIVE}#+http://localhost:${APTHTTPPORT}#" rootdir/etc/apt/sources.list.d/* testsuccess apt update testrundownload 'foo=2' -- cgit v1.2.3-70-g09d2