4 TESTDIR
=$(readlink -f $(dirname $0))
7 configarchitecture
'i386'
9 buildsimplenativepackage
'coolstuff' 'all' '1.0' 'unstable'
15 rm -rf rootdir
/var
/lib
/apt
/lists
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
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
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
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
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
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
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
47 translationslisted
'with full Index'
50 # No Release file at all, so no records about Translation files
51 # (fallback to guessing)
52 find aptarchive
-name 'Release' -or -name 'InRelease' | xargs rm -f
53 configallowinsecurerepositories
"true";
55 msgtest
'Download of en as forced language' 'without Index'
56 aptget update
-o Acquire
::Languages
=en
| grep -q -e 'Translation-en ' && msgpass
|| msgfail
57 rm -rf rootdir
/var
/lib
/apt
/lists
59 msgtest
'Download of nothing else in forced language' 'without Index'
60 aptget update
-o Acquire
::Languages
=en
| grep -q -e 'Translation-[^e][^n] ' && msgfail
|| msgpass
61 rm -rf rootdir
/var
/lib
/apt
/lists
63 msgtest
'Download of ast_DE as forced language' 'without Index'
64 aptget update
-o Acquire
::Languages
=ast_DE
| grep -q -e 'Translation-ast_DE$' && msgpass
|| msgfail
65 rm -rf rootdir
/var
/lib
/apt
/lists
67 msgtest
'Download of nothing else in forced language' 'without Index'
68 aptget update
-o Acquire
::Languages
=ast_DE
| grep -q -e 'Translation-[^a][^s]' && msgfail
|| msgpass
69 rm -rf rootdir
/var
/lib
/apt
/lists
71 msgtest
'Download of nothing if none is forced' 'without Index'
72 aptget update
-o Acquire
::Languages
=none
| grep -q -e 'Translation' && msgfail
|| msgpass
73 rm -rf rootdir
/var
/lib
/apt
/lists
75 mkdir -p rootdir
/var
/lib
/apt
/lists
76 touch rootdir
/var
/lib
/apt
/lists
/localhost
:8080_dists_unstable_main_i18n_Translation
-ast_DE
78 msgtest
'Download of builtin files' 'without Index'
79 aptget update
| grep -q -e 'Translation-ast_DE' && msgpass
|| msgfail
80 rm -rf rootdir
/var
/lib
/apt
/lists
82 mkdir -p rootdir
/var
/lib
/apt
/lists
83 touch rootdir
/var
/lib
/apt
/lists
/localhost
:8080_dists_unstable_main_i18n_Translation
-ast_DE
85 msgtest
'Download of nothing (even builtin) if none is forced' 'without Index'
86 aptget update
-o Acquire
::Languages
=none
| grep -q -e 'Translation' && msgfail
|| msgpass
87 rm -rf rootdir
/var
/lib
/apt
/lists