From 636c7dc17286d93d788c741d15fd756aeda066d5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:07:13 +0200 Subject: Adding upstream version 1.8.2.3. Signed-off-by: Daniel Baumann --- .../test-apt-translation-has-no-packages | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/integration/test-apt-translation-has-no-packages (limited to 'test/integration/test-apt-translation-has-no-packages') diff --git a/test/integration/test-apt-translation-has-no-packages b/test/integration/test-apt-translation-has-no-packages new file mode 100755 index 0000000..3c07af3 --- /dev/null +++ b/test/integration/test-apt-translation-has-no-packages @@ -0,0 +1,35 @@ +#!/bin/sh +# +# Due to corruption (local or network) a user might end up with a +# Translation-$lang file on disk that is actually a Packages file. In this +# case apt used to generate invalid package versions out of the +# Translation-$lang file (i.e. apt-cache policy foo) would show a version +# coming out of a Translation file. Downloading this versions fails as +# there is no acquire method available for the package +# +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture "amd64" + +buildsimplenativepackage 'foo' 'all' '1.0' +setupaptarchive + +APTARCHIVE="$(readlink -f ./aptarchive)" + +# corrupt the Translation-en file to look like a regular Packages file +rm rootdir/var/cache/apt/*.bin +cp "$APTARCHIVE/dists/unstable/main/binary-amd64/Packages" \ + rootdir/var/lib/apt/lists/*Translation-en + +# ensure that there is no Version for the package foo generated out of +# the corrupted Translation-en file +testsuccessequal "foo: + Installed: (none) + Candidate: 1.0 + Version table: + 1.0 500 + 500 file:$APTARCHIVE unstable/main all Packages" aptcache policy foo -- cgit v1.2.3