]>
Commit | Line | Data |
---|---|---|
bc1c9081 MV |
1 | #!/bin/sh |
2 | # | |
3 | # Due to corruption (local or network) a user might end up with a | |
4 | # Translation-$lang file on disk that is actually a Packages file. In this | |
5 | # case apt used to generate invalid package versions out of the | |
6 | # Translation-$lang file (i.e. apt-cache policy foo) would show a version | |
3a8776a3 | 7 | # coming out of a Translation file. Downloading this versions fails as |
bc1c9081 MV |
8 | # there is no acquire method available for the package |
9 | # | |
10 | set -e | |
11 | ||
12 | TESTDIR=$(readlink -f $(dirname $0)) | |
13 | . $TESTDIR/framework | |
14 | ||
15 | setupenvironment | |
16 | configarchitecture "amd64" | |
17 | ||
18 | if [ ! -x ${BUILDDIRECTORY}/apt ]; then | |
19 | msgmsg "No ${BUILDDIRECTORY}/apt" | |
25b86db1 | 20 | msgskip |
bc1c9081 MV |
21 | exit 0 |
22 | fi | |
23 | ||
24 | buildsimplenativepackage 'foo' 'all' '1.0' | |
25 | setupaptarchive | |
26 | ||
63c71412 | 27 | APTARCHIVE="$(readlink -f ./aptarchive)" |
bc1c9081 MV |
28 | |
29 | # corrupt the Translation-en file to look like a regular Packages file | |
30 | rm rootdir/var/cache/apt/*.bin | |
63c71412 | 31 | cp "$APTARCHIVE/dists/unstable/main/binary-amd64/Packages" \ |
bc1c9081 MV |
32 | rootdir/var/lib/apt/lists/*Translation-en |
33 | ||
34 | # ensure that there is no Version for the package foo generated out of | |
35 | # the corrupted Translation-en file | |
25b86db1 | 36 | testsuccessequal "foo: |
bc1c9081 MV |
37 | Installed: (none) |
38 | Candidate: 1.0 | |
39 | Version table: | |
76b004d1 | 40 | 1.0 500 |
1dd20368 | 41 | 500 file:$APTARCHIVE unstable/main all Packages" aptcache policy foo |