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