]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-601016-description-translation
check that the right amount of packages is installed if multiple passed in
[apt.git] / test / integration / test-bug-601016-description-translation
CommitLineData
4b625b95
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture "i386"
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
25
26echo "$PACKAGESTANZA
27Description: Advanced front-end for dpkg" > aptarchive/Packages
28
29echo "Package: apt
30Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
31Description-${LOCALE}: Mächtige Oberfläche für dpkg
32 Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
33 auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
34 APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
35 um Pakete zu installieren und Upgrades durchzuführen." | bzip2 > aptarchive/${LOCALE}.bz2
36
37# the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
38# its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
39echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
40
41NOLONGSTANZA="$PACKAGESTANZA
42Description: Advanced front-end for dpkg
43"
44
45ENGLISHSTANZA="$PACKAGESTANZA
46Description: Advanced front-end for dpkg
47"
48
49LOCALESTANZA="$PACKAGESTANZA
50Description-${LOCALE}: Mächtige Oberfläche für dpkg
51 Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
52 auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
53 APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
54 um Pakete zu installieren und Upgrades durchzuführen.
55"
56
57testrun() {
58 echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
59 export LC_ALL=""
ab53c018 60 rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/
4b625b95
DK
61 setupaptarchive
62 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
63 testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
64 testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
65 LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
66 export LC_ALL=""
67 echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
68 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
69 echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
70 testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww
71}
72
73testrun
74
75echo "$PACKAGESTANZA
76Description: Advanced front-end for dpkg" > aptarchive/Packages
77
78echo "Package: apt
79Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
80Description-en: Advanced front-end for dpkg
81 This is Debian's next generation front-end for the dpkg package manager.
82 It provides the apt-get utility and APT dselect method that provides a
83 simpler, safer way to install and upgrade packages." | bzip2 > aptarchive/en.bz2
84
85ENGLISHSTANZA="$PACKAGESTANZA
86Description-en: Advanced front-end for dpkg
87 This is Debian's next generation front-end for the dpkg package manager.
88 It provides the apt-get utility and APT dselect method that provides a
89 simpler, safer way to install and upgrade packages.
90"
91
92testrun