+translationslisted() {
+ msgtest 'No download of non-existent locals' "$1"
+ export LC_ALL=""
+ testsuccess --nomsg aptget update -o Acquire::Languages=en
+ testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+
+ msgtest 'Download of existent locals' "$1"
+ testsuccess --nomsg aptget update
+ cp rootdir/tmp/testsuccess.output testsuccess.output
+ testsuccess grep -q -e 'Translation-en ' testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+
+ msgtest 'Download of en in LC_ALL=C' "$1"
+ export LC_ALL=C
+ testsuccess --nomsg aptget update
+ cp rootdir/tmp/testsuccess.output testsuccess.output
+ testsuccess grep -q -e 'Translation-en ' testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+ unset LC_ALL
+
+ msgtest 'Download of en as forced language' "$1"
+ testsuccess --nomsg aptget update -o Acquire::Languages=en
+ cp rootdir/tmp/testsuccess.output testsuccess.output
+ testsuccess grep -q -e 'Translation-en ' testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+
+ msgtest 'Download of nothing else in forced language' "$1"
+ testsuccess --nomsg aptget update -o Acquire::Languages=en
+ testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+
+ msgtest 'Download no Translation- if forced language is non-existent' "$1"
+ testsuccess --nomsg aptget update -o Acquire::Languages=ast_DE
+ testfailure grep -q -e 'Translation-' rootdir/tmp/testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+
+ msgtest 'Download of nothing if none is forced' "$1"
+ testsuccess --nomsg aptget update -o Acquire::Languages=none
+ testfailure grep -q -e 'Translation' rootdir/tmp/testsuccess.output
+ rm -rf rootdir/var/lib/apt/lists
+}
+
+translationslisted 'with full Index'
+
+# No Release file at all, so no records about Translation files
+# (fallback to guessing)
+find aptarchive \( -name 'Release' -o -name 'InRelease' \) -delete
+configallowinsecurerepositories "true";