]> git.saurik.com Git - apt.git/blame - test/integration/test-sourceslist-lang-plusminus-options
stop handling items in doomed transactions
[apt.git] / test / integration / test-sourceslist-lang-plusminus-options
CommitLineData
463c8d80
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
463c8d80 6setupenvironment
89544479 7configarchitecture 'amd64'
463c8d80
DK
8
9testlangs() {
10 msgtest 'Test acquired languages for' "$1"
11 local LANGS="$2"
12 shift 2
13 rm -f gotlangs.list
c2a4a8dd 14 aptget indextargets --no-release-info 'Created-By: Translations' "$@" --format '$(LANGUAGE)' | sort -u > gotlangs.list
463c8d80
DK
15 if [ -z "$LANGS" ]; then
16 echo -n | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail
17 else
18 echo -n "$LANGS" | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail
19 fi
20}
21echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
22testlangs 'default' 'en'
23
24echo 'Acquire::Languages "environment,en";' > rootdir/etc/apt/apt.conf.d/langs.conf
25testlangs 'default config' 'en'
26
27echo 'Acquire::Languages "en,en,en";' > rootdir/etc/apt/apt.conf.d/langs.conf
28testlangs 'duplicated config' 'en'
29
30echo 'Acquire::Languages "none";' > rootdir/etc/apt/apt.conf.d/langs.conf
31testlangs 'none config' ''
32
33echo 'Acquire::Languages "en,none,de,de_DE";' > rootdir/etc/apt/apt.conf.d/langs.conf
34testlangs 'english + german config' 'en,de,de_DE'
35
36echo 'deb [lang=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
37testlangs 'lang=pt' 'pt'
38
39echo 'deb [lang=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
40testlangs 'lang=en' 'en'
41
42echo 'deb [lang=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
43testlangs 'lang=de_DE' 'de_DE'
44
45echo 'deb [lang=none] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
46testlangs 'lang=none' ''
1dd20368
DK
47testequal 'amd64
48all' aptget indextargets --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)'
463c8d80
DK
49
50echo 'deb [lang+=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
51testlangs 'lang+=pt' 'en,de,de_DE,pt'
52
53echo 'deb [lang+=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
54testlangs 'lang+=en' 'en,de,de_DE'
55
56echo 'deb [lang+=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
57testlangs 'lang+=de_DE' 'en,de,de_DE'
58
59echo 'deb [lang-=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
60testlangs 'lang-=pt' 'en,de,de_DE'
61
62echo 'deb [lang-=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
63testlangs 'lang-=en' 'de,de_DE'
64
65echo 'deb [lang-=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
66testlangs 'lang-=de_DE' 'en,de'
67
68echo 'deb http://example.org/debian stable rocks
69deb http://example.org/debian stable solid' > rootdir/etc/apt/sources.list
70testlangs 'english + german config multicomponent' 'en,de,de_DE'
71
72echo 'deb http://example.org/debian stable rocks
73deb [lang=pt] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list
74testlangs 'multicomponent one lang= combined' 'en,de,de_DE,pt'
75testlangs 'multicomponent one lang= rocks' 'en,de,de_DE' 'Component: rocks'
76testlangs 'multicomponent one lang= solid' 'pt' 'Component: solid'
77
78echo 'deb [lang=pt] http://example.org/debian stable rocks
79deb [lang=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list
80testlangs 'multicomponent different lang= combined' 'de,pt'
81testlangs 'multicomponent different lang= rocks' 'pt' 'Component: rocks'
82testlangs 'multicomponent different lang= solid' 'de' 'Component: solid'
83
84echo 'deb [lang+=pt] http://example.org/debian stable rocks
85deb [lang-=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list
86testlangs 'multicomponent different lang+-= combined' 'en,de,de_DE,pt'
87testlangs 'multicomponent different lang+-= rocks' 'en,de,de_DE,pt' 'Component: rocks'
88testlangs 'multicomponent different lang+-= solid' 'en,de_DE' 'Component: solid'