]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-601016-description-translation
merge patch from Daniel Hartwig to Show a error message if {,dist-}upgrade is used...
[apt.git] / test / integration / test-bug-601016-description-translation
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'i386' 'amd64'
8
9# we need a valid locale here, otherwise the language configuration
10# will be overridden by LC_ALL=C
11LOCALE="$(echo "$LANG" | cut -d'_' -f 1)"
12
13PACKAGESTANZA="Package: apt
14Priority: important
15Section: admin
16Installed-Size: 5984
17Maintainer: APT Development Team <deity@lists.debian.org>
18Architecture: i386
19Version: 0.8.7
20Filename: pool/main/a/apt/apt_0.8.7_i386.deb
21Size: 2140230
22MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08
23Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c"
24
25PACKAGESTANZA2='Package: apt
26Priority: important
27Section: admin
28Installed-Size: 5984
29Maintainer: APT Development Team <deity@lists.debian.org>
30Architecture: amd64
31Version: 0.8.7
32Filename: pool/main/a/apt/apt_0.8.7_amd64.deb
33Size: 2210342
34MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a
35Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c'
36
37echo "$PACKAGESTANZA
38Description: Advanced front-end for dpkg
39
40$PACKAGESTANZA2
41Description: Advanced front-end for dpkg" > aptarchive/Packages
42
43echo "Package: apt
44Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
45Description-${LOCALE}: Mächtige Oberfläche für dpkg
46 Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
47 auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
48 APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
49 um Pakete zu installieren und Upgrades durchzuführen." | bzip2 > aptarchive/${LOCALE}.bz2
50
51# the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
52# its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
53echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
54
55NOLONGSTANZA="$PACKAGESTANZA
56Description: Advanced front-end for dpkg
57"
58
59ENGLISHSTANZA="$PACKAGESTANZA
60Description: Advanced front-end for dpkg
61"
62
63LOCALESTANZA="$PACKAGESTANZA
64Description-${LOCALE}: Mächtige Oberfläche für dpkg
65 Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
66 auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
67 APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
68 um Pakete zu installieren und Upgrades durchzuführen.
69"
70LOCALESTANZA2="$PACKAGESTANZA2
71Description-${LOCALE}: Mächtige Oberfläche für dpkg
72 Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
73 auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
74 APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
75 um Pakete zu installieren und Upgrades durchzuführen.
76"
77
78testrun() {
79 echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
80 export LC_ALL=""
81 rm -rf rootdir/var/lib/apt/lists
82 setupaptarchive
83 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
84 testequal "$LOCALESTANZA" aptcache show apt:i386 -o Test=File-${LOCALE}
85 testequal "$LOCALESTANZA2" aptcache show apt:amd64 -o Test=File-${LOCALE}
86 testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
87 testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
88 LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
89 export LC_ALL=""
90 echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
91 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
92 echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
93 testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww
94}
95
96testrun
97
98echo "$PACKAGESTANZA
99Description: Advanced front-end for dpkg
100
101$PACKAGESTANZA2
102Description: Advanced front-end for dpkg" > aptarchive/Packages
103
104echo "Package: apt
105Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
106Description-en: Advanced front-end for dpkg
107 This is Debian's next generation front-end for the dpkg package manager.
108 It provides the apt-get utility and APT dselect method that provides a
109 simpler, safer way to install and upgrade packages." | bzip2 > aptarchive/en.bz2
110
111ENGLISHSTANZA="$PACKAGESTANZA
112Description-en: Advanced front-end for dpkg
113 This is Debian's next generation front-end for the dpkg package manager.
114 It provides the apt-get utility and APT dselect method that provides a
115 simpler, safer way to install and upgrade packages.
116"
117ENGLISHSTANZA2="$PACKAGESTANZA2
118Description-en: Advanced front-end for dpkg
119 This is Debian's next generation front-end for the dpkg package manager.
120 It provides the apt-get utility and APT dselect method that provides a
121 simpler, safer way to install and upgrade packages.
122"
123
124testrun