summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-712435-missing-descriptions
blob: c61bea452ade207d3f8faa5f7cc135c547a6f644 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'amd64'

PACKAGESTANZA='Version: 0.9.7.8
Installed-Size: 3270
Maintainer: APT Development Team <deity@lists.debian.org>
Architecture: amd64
Filename: pool/main/a/apt/apt_0.9.7.8_amd64.deb
MD5sum: 3a622acda41620df50aa22a9fac6f32e'

DESCRIPTION='Description: commandline package manager
 This APT has Super Cow Powers.'

TRANSDESCRIPTION='Description-en: commandline package manager
 This APT has translated Super Cow Powers.'

echo "Package: apt-normal
$PACKAGESTANZA
$DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Package: apt-both-below
$PACKAGESTANZA
$DESCRIPTION
$TRANSDESCRIPTION
Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

Package: apt-both-middle
$PACKAGESTANZA
$DESCRIPTION
Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
$TRANSDESCRIPTION

Package: apt-both-top
$PACKAGESTANZA
Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
$DESCRIPTION
$TRANSDESCRIPTION

Package: apt-trans
$PACKAGESTANZA
$TRANSDESCRIPTION
Description-md5: cccccccccccccccccccccccccccccccc

Package: apt-md5
$PACKAGESTANZA
Description-md5: dddddddddddddddddddddddddddddddd

Package: apt-none
$PACKAGESTANZA

Package: apt-intermixed
$PACKAGESTANZA
$DESCRIPTION
X-Some-Flag: yes
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Package: apt-intermixed2
$PACKAGESTANZA
$DESCRIPTION
X-Some-Flag: yes
$TRANSDESCRIPTION
X-Foo-Flag: Something with a Description
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Bar-Flag: no

Package: apt-intermixed3
$PACKAGESTANZA
$DESCRIPTION
X-Some-Flag: yes
$TRANSDESCRIPTION
X-Foo-Flag: Something with a Description
X-Bar-Flag: no
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > aptarchive/Packages


setupaptarchive

testequal "Package: apt-normal
$PACKAGESTANZA
$DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
" aptcache show apt-normal

# displaying the translated Description would be equally valid,
# but we assume only one description is in a Packages file and
# so we prefer "Description" over "Description-*" currently.
for variant in 'below' 'middle' 'top'; do
	testequal "Package: apt-both-$variant
$PACKAGESTANZA
$DESCRIPTION
Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
" aptcache show apt-both-$variant
done

testequal "Package: apt-trans
$PACKAGESTANZA
$TRANSDESCRIPTION
Description-md5: cccccccccccccccccccccccccccccccc
" aptcache show apt-trans

testequal "Package: apt-md5
$PACKAGESTANZA
Description-md5: dddddddddddddddddddddddddddddddd
" aptcache show apt-md5

testequal "Package: apt-none
$PACKAGESTANZA
" aptcache show apt-none

testequal "Package: apt-intermixed
$PACKAGESTANZA
$DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Some-Flag: yes
" aptcache show apt-intermixed

testequal "Package: apt-intermixed2
$PACKAGESTANZA
$DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Some-Flag: yes
X-Foo-Flag: Something with a Description
X-Bar-Flag: no
" aptcache show apt-intermixed2

testequal "Package: apt-intermixed3
$PACKAGESTANZA
$DESCRIPTION
Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
X-Some-Flag: yes
X-Foo-Flag: Something with a Description
X-Bar-Flag: no
" aptcache show apt-intermixed3