]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-712435-missing-descriptions
handle missing "Description" in apt-cache show
[apt.git] / test / integration / test-bug-712435-missing-descriptions
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'amd64'
8
9 PACKAGESTANZA='Version: 0.9.7.8
10 Installed-Size: 3270
11 Maintainer: APT Development Team <deity@lists.debian.org>
12 Architecture: amd64
13 Filename: pool/main/a/apt/apt_0.9.7.8_amd64.deb
14 MD5sum: 3a622acda41620df50aa22a9fac6f32e'
15
16 DESCRIPTION='Description: commandline package manager
17 This APT has Super Cow Powers.'
18
19 TRANSDESCRIPTION='Description-en: commandline package manager
20 This APT has translated Super Cow Powers.'
21
22 echo "Package: apt-normal
23 $PACKAGESTANZA
24 $DESCRIPTION
25 Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
26
27 Package: apt-both-below
28 $PACKAGESTANZA
29 $DESCRIPTION
30 $TRANSDESCRIPTION
31 Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
32
33 Package: apt-both-middle
34 $PACKAGESTANZA
35 $DESCRIPTION
36 Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
37 $TRANSDESCRIPTION
38
39 Package: apt-both-top
40 $PACKAGESTANZA
41 Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
42 $DESCRIPTION
43 $TRANSDESCRIPTION
44
45 Package: apt-trans
46 $PACKAGESTANZA
47 $TRANSDESCRIPTION
48 Description-md5: cccccccccccccccccccccccccccccccc
49
50 Package: apt-md5
51 $PACKAGESTANZA
52 Description-md5: dddddddddddddddddddddddddddddddd
53
54 Package: apt-none
55 $PACKAGESTANZA" > aptarchive/Packages
56
57 setupaptarchive
58
59 testequal "Package: apt-normal
60 $PACKAGESTANZA
61 $DESCRIPTION
62 Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
63 " aptcache show apt-normal
64
65 # displaying the translated Description would be equally valid,
66 # but we assume only one description is in a Packages file and
67 # so we prefer "Description" over "Description-*" currently.
68 for variant in 'below' 'middle' 'top'; do
69 testequal "Package: apt-both-$variant
70 $PACKAGESTANZA
71 $DESCRIPTION
72 Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
73 " aptcache show apt-both-$variant
74 done
75
76 testequal "Package: apt-trans
77 $PACKAGESTANZA
78 $TRANSDESCRIPTION
79 Description-md5: cccccccccccccccccccccccccccccccc
80 " aptcache show apt-trans
81
82 testequal "Package: apt-md5
83 $PACKAGESTANZA
84 Description-md5: dddddddddddddddddddddddddddddddd
85 " aptcache show apt-md5
86
87 testequal "Package: apt-none
88 $PACKAGESTANZA
89 " aptcache show apt-none