]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-601016-description-translation
merge with my debian-sid branch
[apt.git] / test / integration / test-bug-601016-description-translation
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386' 'amd64'
8
9 # we need a valid locale here, otherwise the language configuration
10 # will be overridden by LC_ALL=C
11 LOCALE="$(echo "$LANG" | cut -d'_' -f 1)"
12
13 PACKAGESTANZA="Package: apt
14 Priority: important
15 Section: admin
16 Installed-Size: 5984
17 Maintainer: APT Development Team <deity@lists.debian.org>
18 Architecture: i386
19 Version: 0.8.7
20 Filename: pool/main/a/apt/apt_0.8.7_i386.deb
21 Size: 2140230
22 MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08
23 Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c"
24
25 PACKAGESTANZA2='Package: apt
26 Priority: important
27 Section: admin
28 Installed-Size: 5984
29 Maintainer: APT Development Team <deity@lists.debian.org>
30 Architecture: amd64
31 Version: 0.8.7
32 Filename: pool/main/a/apt/apt_0.8.7_amd64.deb
33 Size: 2210342
34 MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a
35 Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c'
36
37 echo "$PACKAGESTANZA
38 Description: Advanced front-end for dpkg
39
40 $PACKAGESTANZA2
41 Description: Advanced front-end for dpkg" > aptarchive/Packages
42
43 echo "Package: apt
44 Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
45 Description-${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-*)
53 echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
54
55 NOLONGSTANZA="$PACKAGESTANZA
56 Description: Advanced front-end for dpkg
57 "
58
59 ENGLISHSTANZA="$PACKAGESTANZA
60 Description: Advanced front-end for dpkg
61 "
62
63 LOCALESTANZA="$PACKAGESTANZA
64 Description-${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 "
70 LOCALESTANZA2="$PACKAGESTANZA2
71 Description-${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
78 testrun() {
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
96 testrun
97
98 echo "$PACKAGESTANZA
99 Description: Advanced front-end for dpkg
100
101 $PACKAGESTANZA2
102 Description: Advanced front-end for dpkg" > aptarchive/Packages
103
104 echo "Package: apt
105 Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
106 Description-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
111 ENGLISHSTANZA="$PACKAGESTANZA
112 Description-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 "
117 ENGLISHSTANZA2="$PACKAGESTANZA2
118 Description-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
124 testrun