diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-05-15 14:37:33 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-05-15 14:37:33 +0200 |
commit | bc1c9081e826c2c7f265f23d388ba868d5011f6a (patch) | |
tree | 4e4b234c82b24d6b7ab00bc31c1e974b3ac12320 /test | |
parent | 2af2eb53e867bfcc0422aaf3c93c79eb2c93e9cc (diff) |
Never parse Version/Architecture tags in a Translation-$lang file
Version/Architecture information in a Translation-$lang file is
not allowed, so don't try to parse it. This is a fix for a bugreport
where a Translation-en file contained the content of the regular
Packages file (probably due to local FS corruption). This lead to
strange error messages on file download.
Thanks to Thomas Reusch for the report.
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-apt-translation-has-no-packages | 41 |
1 files changed, 41 insertions, 0 deletions
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 000000000..bb2353a33 --- /dev/null +++ b/test/integration/test-apt-translation-has-no-packages @@ -0,0 +1,41 @@ +#!/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 +# comming 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" + +if [ ! -x ${BUILDDIRECTORY}/apt ]; then + msgmsg "No ${BUILDDIRECTORY}/apt" + msgskip + exit 0 +fi + +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 +testequal "foo: + Installed: (none) + Candidate: 1.0 + Version table: + 1.0 0 + 500 file:$APTARCHIVE/ unstable/main amd64 Packages" aptcache policy foo |