diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2024-01-03 16:25:35 +0000 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2024-01-03 16:59:11 +0000 |
| commit | afcdbcf895284efd76903b2b3ba5cc849059ce50 (patch) | |
| tree | 23aacb3d405c71fadbd3a41a25d02fb67d845811 /test/integration/test-pdiff-usage | |
| parent | c82f96210eb62c92d31ded7073f4cf5371cc9485 (diff) | |
Do not store .diff_Index files in update
Nowadays we only download the index file if we have a non-current file
on disk which we want to patch. If that is the case, any index file for
patches we could have stored is by definition outdated, so storing those
files just takes up disk space.
At least, that is the case if we have a Release file – if we don't this
commit introduces a needless redownload for such repositories but such
repositories are an error by default and if they can't be bothered to
provide a Release file its very unlikely they actually ship diffs, so
adding detection code for this seems pointless at best.
Diffstat (limited to 'test/integration/test-pdiff-usage')
| -rwxr-xr-x | test/integration/test-pdiff-usage | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 38e455b00..cf3a2f2d9 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -38,14 +38,7 @@ wasmergeused() { #apt update "$@" 2>&1 | tee rootdir/tmp/testsuccess.output msgtest 'No intermediate patch files' 'still exist' - local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')" - if [ -z "$EDS" ]; then - msgpass - else - echo - echo "$EDS" - msgfail - fi + testempty --nomsg find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*' -o -name '*.diff_Index' -o -name '*.diff_Index.xz' if echo "$*" | grep -q -- '-o test::cannot-use-pdiff=1'; then msgtest 'Check if pdiff was' 'not used' @@ -389,21 +382,25 @@ testcase() { testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0 "$@" } generatepartialleftovers() { + local PREFIX="$1" + shift for f in "$@"; do - cat "${PKGFILE}" "${PKGFILE}" > "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${f}" - printf '\n\nInvalid\nStanza: yes\n\n' >> "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${f}" + cat "${PKGFILE}" "${PKGFILE}" > "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${PREFIX}${f}" + printf '\n\nInvalid\nStanza: yes\n\n' >> "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${PREFIX}${f}" done + printf '\n\nInvalid\nStanza: yes\n\n' >> "rootdir/var/lib/apt/lists-bak/localhost:${APTHTTPPORT}_${PREFIX}Packages.diff_Index" + printf '\n\nInvalid\nStanza: yes\n\n' >> "rootdir/var/lib/apt/lists-bak/localhost:${APTHTTPPORT}_${PREFIX}Packages.diff_Index.xz" } -partialleftovers() { generatepartialleftovers 'Packages' 'Packages-patched'; } +partialleftovers() { generatepartialleftovers '' 'Packages' 'Packages-patched'; } 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() { generatepartialleftovers "Packages.${LOWCOSTEXT}" "Packages-patched.${LOWCOSTEXT}"; } +partialleftovers() { generatepartialleftovers '' "Packages.${LOWCOSTEXT}" "Packages-patched.${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() { generatepartialleftovers "redirectme_Packages.${LOWCOSTEXT}" "redirectme_Packages-patched.${LOWCOSTEXT}"; } +partialleftovers() { generatepartialleftovers 'redirectme_' "Packages.${LOWCOSTEXT}" "Packages-patched.${LOWCOSTEXT}"; } # redirect the InRelease file only – the other files are auto-redirected by apt webserverconfig 'aptwebserver::redirect::replace::/redirectme/I' "http://0.0.0.0:${APTHTTPPORT}/I" rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme" |
