]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-624218-Translation-file-handling
merged from the debian-sid branch
[apt.git] / test / integration / test-bug-624218-Translation-file-handling
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'i386'
8
9buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable'
10
11setupaptarchive
12
13changetowebserver
14
15rm -rf rootdir/var/lib/apt/lists
16
17msgtest 'No download of non-existent locals' 'with Index'
18LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
19rm -rf rootdir/var/lib/apt/lists
20
21msgtest 'Download of existent locals' 'with Index'
22LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
23rm -rf rootdir/var/lib/apt/lists
24
25msgtest 'Download of en in LC_ALL=C' 'with Index'
26LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
27rm -rf rootdir/var/lib/apt/lists
28
29msgtest 'Download of en as forced language' 'with Index'
30aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
31rm -rf rootdir/var/lib/apt/lists
32
33msgtest 'Download of nothing else in forced language' 'with Index'
34aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
35rm -rf rootdir/var/lib/apt/lists
36
37msgtest 'Download no Translation- if forced language is non-existent' 'with Index'
38aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass
39rm -rf rootdir/var/lib/apt/lists
40
41msgtest 'Download of nothing if none is forced' 'with Index'
42aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
43rm -rf rootdir/var/lib/apt/lists
44
45sed -i '/i18n\/Translation-.*$/ d' $(find aptarchive -name 'Release')
46signreleasefiles
47
48msgtest 'Download of en as forced language' 'without Index'
49aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
50rm -rf rootdir/var/lib/apt/lists
51
52msgtest 'Download of nothing else in forced language' 'without Index'
53aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
54rm -rf rootdir/var/lib/apt/lists
55
56msgtest 'Download of ast_DE as forced language' 'without Index'
57aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-ast_DE$' && msgpass || msgfail
58rm -rf rootdir/var/lib/apt/lists
59
60msgtest 'Download of nothing else in forced language' 'without Index'
61aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-[^a][^s]' && msgfail || msgpass
62rm -rf rootdir/var/lib/apt/lists
63
64msgtest 'Download of nothing if none is forced' 'without Index'
65aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
66rm -rf rootdir/var/lib/apt/lists
67
68mkdir -p rootdir/var/lib/apt/lists
69touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
70
71msgtest 'Download of builtin files' 'without Index'
72aptget update | grep -q -e 'Translation-ast_DE' && msgpass || msgfail
73rm -rf rootdir/var/lib/apt/lists
74
75mkdir -p rootdir/var/lib/apt/lists
76touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
77
78msgtest 'Download of nothing (even builtin) if none is forced' 'without Index'
79aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
80rm -rf rootdir/var/lib/apt/lists