#!/bin/sh
set -e
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
setupenvironment
configarchitecture 'i386'
# No Release file at all, so no records about Translation files
# (fallback to guessing)
find aptarchive \( -name 'Release' -o -name 'InRelease' \) -delete
-configallowinsecurerepositories "true";
+echo 'Acquire::AllowInsecureRepositories "true";' > rootdir/etc/apt/apt.conf.d/allow-insecure-repositories.conf
msgtest 'Download of en as forced language' 'without Index'
testwarning --nomsg aptget update -o Acquire::Languages=en
rm -rf rootdir/var/lib/apt/lists
mkdir -p rootdir/var/lib/apt/lists
-touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
+touch rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-ast_DE
msgtest 'Download of builtin files' 'without Index'
testwarning --nomsg aptget update
rm -rf rootdir/var/lib/apt/lists
mkdir -p rootdir/var/lib/apt/lists
-touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
+touch rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_unstable_main_i18n_Translation-ast_DE
msgtest 'Download of nothing (even builtin) if none is forced' 'without Index'
testwarning --nomsg aptget update -o Acquire::Languages=none