diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
commit | 851b6a097165af4d51c0db01b5e05256e5006896 (patch) | |
tree | 5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-sourceslist-lang-plusminus-options | |
parent | Initial commit. (diff) | |
download | apt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz apt-851b6a097165af4d51c0db01b5e05256e5006896.zip |
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-sourceslist-lang-plusminus-options')
-rwxr-xr-x | test/integration/test-sourceslist-lang-plusminus-options | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/test/integration/test-sourceslist-lang-plusminus-options b/test/integration/test-sourceslist-lang-plusminus-options new file mode 100755 index 0000000..abdb647 --- /dev/null +++ b/test/integration/test-sourceslist-lang-plusminus-options @@ -0,0 +1,88 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +testlangs() { + msgtest 'Test acquired languages for' "$1" + local LANGS="$2" + shift 2 + rm -f gotlangs.list + aptget indextargets --no-release-info 'Identifier: Translations' "$@" --format '$(LANGUAGE)' | sort -u > gotlangs.list + if [ -z "$LANGS" ]; then + echo -n | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail + else + echo -n "$LANGS" | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail + fi +} +echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'default' 'en' + +echo 'Acquire::Languages "environment,en";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'default config' 'en' + +echo 'Acquire::Languages "en,en,en";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'duplicated config' 'en' + +echo 'Acquire::Languages "none";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'none config' '' + +echo 'Acquire::Languages "en,none,de,de_DE";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'english + german config' 'en,de,de_DE' + +echo 'deb [lang=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=pt' 'pt' + +echo 'deb [lang=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=en' 'en' + +echo 'deb [lang=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=de_DE' 'de_DE' + +echo 'deb [lang=none] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=none' '' +testequal 'amd64 +all' aptget indextargets --no-release-info 'Identifier: Packages' --format '$(ARCHITECTURE)' + +echo 'deb [lang+=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=pt' 'en,de,de_DE,pt' + +echo 'deb [lang+=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=en' 'en,de,de_DE' + +echo 'deb [lang+=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=de_DE' 'en,de,de_DE' + +echo 'deb [lang-=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=pt' 'en,de,de_DE' + +echo 'deb [lang-=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=en' 'de,de_DE' + +echo 'deb [lang-=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=de_DE' 'en,de' + +echo 'deb http://example.org/debian stable rocks +deb http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'english + german config multicomponent' 'en,de,de_DE' + +echo 'deb http://example.org/debian stable rocks +deb [lang=pt] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent one lang= combined' 'en,de,de_DE,pt' +testlangs 'multicomponent one lang= rocks' 'en,de,de_DE' 'Component: rocks' +testlangs 'multicomponent one lang= solid' 'pt' 'Component: solid' + +echo 'deb [lang=pt] http://example.org/debian stable rocks +deb [lang=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent different lang= combined' 'de,pt' +testlangs 'multicomponent different lang= rocks' 'pt' 'Component: rocks' +testlangs 'multicomponent different lang= solid' 'de' 'Component: solid' + +echo 'deb [lang+=pt] http://example.org/debian stable rocks +deb [lang-=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent different lang+-= combined' 'en,de,de_DE,pt' +testlangs 'multicomponent different lang+-= rocks' 'en,de,de_DE,pt' 'Component: rocks' +testlangs 'multicomponent different lang+-= solid' 'en,de_DE' 'Component: solid' |