]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-758153-versioned-provides-support
add apt-key support for armored GPG key files (*.asc)
[apt.git] / test / integration / test-bug-758153-versioned-provides-support
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4# dpkg implements versioned provides in commit 5bb02fe80e9f40dcad9703a72f67cf615ff217b5
5# but previous versions seem to allow parsing, working and ignoring it.
6
7TESTDIR="$(readlink -f "$(dirname "$0")")"
8. "$TESTDIR/framework"
9setupenvironment
10configarchitecture 'amd64' 'i386'
11
12insertinstalledpackage 'webapp' 'all' '1' 'Depends: httpd'
13insertinstalledpackage 'webserver' 'all' '1' 'Provides: httpd'
14
15insertpackage 'unstable' 'webapp' 'all' '2' 'Depends: httpd (>= 2)'
16insertpackage 'unstable' 'webserver' 'amd64' '2' 'Provides: httpd (= 2)'
17insertpackage 'unstable' 'foreign-webserver' 'i386' '2' 'Multi-Arch: foreign
18Provides: httpd (= 2)'
19
20insertpackage 'experimental' 'webapp' 'all' '3' 'Depends: httpd (>= 1.5)'
21insertpackage 'experimental' 'webserver' 'amd64' '3' 'Provides: httpd (= 3)'
22
23insertpackage 'experimental' 'foreign-webserver' 'i386' '4' 'Multi-Arch: foreign
24Provides: httpd (= 4)'
25insertpackage 'experimental' 'cool-webapp' 'all' '4' 'Depends: httpd (>= 4)'
26
27# arch-qualified provides, see #777071
28insertpackage 'unstable' 'foo' 'all' '1' 'Provides: bar:i386'
29insertpackage 'unstable' 'baz' 'i386,amd64' '1' 'Depends: bar'
30insertpackage 'experimental' 'baz' 'i386,amd64' '2' 'Depends: bar:i386'
31insertpackage 'experimental' 'baz-broken' 'i386' '2' 'Depends: bar:amd64'
32
33insertpackage 'unstable' 'next' 'amd64' '1' 'Multi-Arch: foreign
34Provides: next (= 2)'
35insertpackage 'unstable' 'needsrealnext' 'amd64,i386' '2' 'Depends: next (>= 2)'
36
37insertpackage 'unstable' 'virtualnext2' 'amd64' '1' 'Multi-Arch: foreign
38Provides: next2 (= 2)'
39insertpackage 'unstable' 'needsnext2' 'amd64,i386' '2' 'Depends: next2 (>= 2)'
40
41insertpackage 'unstable' 'virtualnext3' 'amd64' '1' 'Multi-Arch: no
42Provides: next3 (= 2)'
43insertpackage 'unstable' 'needsnext3' 'amd64,i386' '2' 'Depends: next3 (>= 2)'
44
45insertpackage 'unstable' 'selfprov' 'amd64' '2' 'Provides: selfprov (= 1)'
46insertpackage 'unstable' 'needsselfprov1' 'amd64' '1' 'Depends: selfprov (= 1)'
47insertpackage 'unstable' 'needsselfprov2' 'amd64' '1' 'Depends: selfprov (= 2)'
48insertpackage 'unstable' 'needsselfprov12' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2)'
49insertpackage 'unstable' 'needsselfprov123' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2), selfprov (= 3)'
50
51setupaptarchive
52
53SOMEPACKAGESCOULDNOT='Some packages could not be installed. This may mean that you have
54requested an impossible situation or if you are using the unstable
55distribution that some required packages have not yet been created
56or been moved out of Incoming.
57The following information may help to resolve the situation:
58
59The following packages have unmet dependencies:'
60
61for binary in 'aptget' 'apt'; do
62 for method in 'upgrade' 'dist-upgrade'; do
63 for solver in 'internal' 'apt'; do
64 if [ "$solver" = 'apt' ]; then
65 HEADER='Execute external solver...'
66 else
67 HEADER='Calculating upgrade...'
68 fi
69 testsuccessequal "Reading package lists...
70Building dependency tree...
71$HEADER
72The following packages will be upgraded:
73 webapp webserver
742 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
75Inst webserver [1] (2 unstable [amd64])
76Inst webapp [1] (2 unstable [all])
77Conf webserver (2 unstable [amd64])
78Conf webapp (2 unstable [all])" $binary $method -s --solver $solver
79 done
80 done
81done
82
83for solver in 'internal' 'apt'; do
84 msgmsg 'Testing with solver' "$solver"
85 HEADER_PRE='Reading package lists...
86Building dependency tree...'
87 HEADER_POST='Execute external solver...'
88 HEADER="${HEADER_PRE}"
89 if [ "$solver" = 'apt' ]; then
90 HEADER="${HEADER}
91${HEADER_POST}"
92 fi
93 testsuccessequal "$HEADER
94The following packages will be upgraded:
95 webapp webserver
962 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
97Inst webserver [1] (2 unstable [amd64])
98Inst webapp [1] (2 unstable [all])
99Conf webserver (2 unstable [amd64])
100Conf webapp (2 unstable [all])" aptget install webapp webserver -s --solver $solver
101
102 testsuccessequal "$HEADER
103The following packages will be upgraded:
104 webapp webserver
1052 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
106Inst webserver [1] (2 unstable [amd64])
107Inst webapp [1] (3 experimental [all])
108Conf webserver (2 unstable [amd64])
109Conf webapp (3 experimental [all])" aptget install webapp=3 webserver -s --solver $solver
110
111 testsuccessequal "$HEADER
112The following packages will be upgraded:
113 webapp webserver
1142 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
115Inst webserver [1] (3 experimental [amd64])
116Inst webapp [1] (2 unstable [all])
117Conf webserver (3 experimental [amd64])
118Conf webapp (2 unstable [all])" aptget install webapp webserver=3 -s --solver $solver
119
120 testsuccessequal "$HEADER
121The following NEW packages will be installed:
122 foreign-webserver:i386
123The following packages will be upgraded:
124 webapp
1251 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
126Inst foreign-webserver:i386 (2 unstable [i386])
127Inst webapp [1] (2 unstable [all])
128Conf foreign-webserver:i386 (2 unstable [i386])
129Conf webapp (2 unstable [all])" aptget install webapp foreign-webserver:i386 -s --solver $solver
130
131 testsuccessequal "$HEADER
132The following NEW packages will be installed:
133 foreign-webserver:i386
134The following packages will be upgraded:
135 webapp
1361 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
137Inst foreign-webserver:i386 (2 unstable [i386])
138Inst webapp [1] (3 experimental [all])
139Conf foreign-webserver:i386 (2 unstable [i386])
140Conf webapp (3 experimental [all])" aptget install webapp=3 foreign-webserver:i386 -s --solver $solver
141
142 testsuccessequal "$HEADER
143The following NEW packages will be installed:
144 foreign-webserver:i386
145The following packages will be upgraded:
146 webapp
1471 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
148Inst foreign-webserver:i386 (4 experimental [i386])
149Inst webapp [1] (2 unstable [all])
150Conf foreign-webserver:i386 (4 experimental [i386])
151Conf webapp (2 unstable [all])" aptget install webapp foreign-webserver:i386=4 -s --solver $solver
152
153 if [ "$solver" = 'apt' ]; then
154 WEBAPP_ERR="$HEADER
155The solver encountered an error of type: ERR_UNSOLVABLE
156The following information might help you to understand what is wrong:
157The following packages have unmet dependencies:
158 cool-webapp : Depends: httpd (>= 4)
159
160$SOMEPACKAGESCOULDNOT
161 cool-webapp : Depends: httpd (>= 4)
162E: External solver failed with: The following packages have unmet dependencies:"
163 else
164 WEBAPP_ERR="$HEADER
165$SOMEPACKAGESCOULDNOT
166 cool-webapp : Depends: httpd (>= 4)
167E: Unable to correct problems, you have held broken packages."
168 fi
169 testfailureequal "$WEBAPP_ERR" aptget install cool-webapp -s --solver $solver
170 testfailureequal "$WEBAPP_ERR" aptget install cool-webapp foreign-webserver:i386 -s --solver $solver
171
172 testsuccessequal "$HEADER
173The following NEW packages will be installed:
174 cool-webapp foreign-webserver:i386
1750 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
176Inst foreign-webserver:i386 (4 experimental [i386])
177Inst cool-webapp (4 experimental [all])
178Conf foreign-webserver:i386 (4 experimental [i386])
179Conf cool-webapp (4 experimental [all])" aptget install cool-webapp foreign-webserver:i386=4 -s --solver $solver
180
181 testsuccessequal "$HEADER
182The following additional packages will be installed:
183 foo
184The following NEW packages will be installed:
185 baz:i386 foo
1860 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
187Inst foo (1 unstable [all])
188Inst baz:i386 (1 unstable [i386])
189Conf foo (1 unstable [all])
190Conf baz:i386 (1 unstable [i386])" aptget install baz:i386 -s --solver $solver
191
192 if [ "$solver" = 'apt' ]; then
193 testfailureequal "$HEADER
194The solver encountered an error of type: ERR_UNSOLVABLE
195The following information might help you to understand what is wrong:
196The following packages have unmet dependencies:
197 baz : Depends: bar but it is not installable
198
199$SOMEPACKAGESCOULDNOT
200 baz : Depends: bar but it is not installable
201E: External solver failed with: The following packages have unmet dependencies:" aptget install baz:amd64 -s --solver $solver
202 else
203 testfailureequal "$HEADER
204$SOMEPACKAGESCOULDNOT
205 baz : Depends: bar but it is not installable
206E: Unable to correct problems, you have held broken packages." aptget install baz:amd64 -s --solver $solver
207 fi
208
209 HEADER="${HEADER_PRE}
210Selected version '2' (experimental [amd64]) for 'baz'"
211 if [ "$solver" = 'apt' ]; then
212 HEADER="${HEADER}
213${HEADER_POST}"
214 fi
215 testsuccessequal "$HEADER
216The following additional packages will be installed:
217 foo
218The following NEW packages will be installed:
219 baz foo
2200 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
221Inst foo (1 unstable [all])
222Inst baz (2 experimental [amd64])
223Conf foo (1 unstable [all])
224Conf baz (2 experimental [amd64])" aptget install baz/experimental -s --solver $solver
225
226 HEADER="${HEADER_PRE}
227Selected version '2' (experimental [i386]) for 'baz:i386'"
228 if [ "$solver" = 'apt' ]; then
229 HEADER="${HEADER}
230${HEADER_POST}"
231 fi
232 testsuccessequal "$HEADER
233The following additional packages will be installed:
234 foo
235The following NEW packages will be installed:
236 baz:i386 foo
2370 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
238Inst foo (1 unstable [all])
239Inst baz:i386 (2 experimental [i386])
240Conf foo (1 unstable [all])
241Conf baz:i386 (2 experimental [i386])" aptget install baz:i386/experimental -s --solver $solver
242
243 if [ "$solver" = 'apt' ]; then
244 HEADER="${HEADER_PRE}
245${HEADER_POST}"
246 else
247 HEADER="${HEADER_PRE}"
248 fi
249
250 if [ "$solver" = 'apt' ]; then
251 testfailureequal "$HEADER
252The solver encountered an error of type: ERR_UNSOLVABLE
253The following information might help you to understand what is wrong:
254The following packages have unmet dependencies:
255 baz-broken:i386 : Depends: bar:amd64 but it is not installable
256
257$SOMEPACKAGESCOULDNOT
258 baz-broken:i386 : Depends: bar:amd64 but it is not installable
259E: External solver failed with: The following packages have unmet dependencies:" aptget install baz-broken -s --solver $solver
260 else
261 testfailureequal "$HEADER
262$SOMEPACKAGESCOULDNOT
263 baz-broken:i386 : Depends: bar:amd64 but it is not installable
264E: Unable to correct problems, you have held broken packages." aptget install baz-broken -s --solver $solver
265 fi
266
267 testsuccessequal "$HEADER
268The following additional packages will be installed:
269 next
270The following NEW packages will be installed:
271 needsrealnext next
2720 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
273Inst next (1 unstable [amd64])
274Inst needsrealnext (2 unstable [amd64])
275Conf next (1 unstable [amd64])
276Conf needsrealnext (2 unstable [amd64])" aptget install needsrealnext -s --solver $solver
277
278 testsuccessequal "$HEADER
279The following additional packages will be installed:
280 next
281The following NEW packages will be installed:
282 needsrealnext:i386 next
2830 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
284Inst next (1 unstable [amd64])
285Inst needsrealnext:i386 (2 unstable [i386])
286Conf next (1 unstable [amd64])
287Conf needsrealnext:i386 (2 unstable [i386])" aptget install needsrealnext:i386 -s --solver $solver
288
289 testsuccessequal "$HEADER
290The following additional packages will be installed:
291 virtualnext2
292The following NEW packages will be installed:
293 needsnext2 virtualnext2
2940 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
295Inst virtualnext2 (1 unstable [amd64])
296Inst needsnext2 (2 unstable [amd64])
297Conf virtualnext2 (1 unstable [amd64])
298Conf needsnext2 (2 unstable [amd64])" aptget install needsnext2 -s --solver $solver
299
300 testsuccessequal "$HEADER
301The following additional packages will be installed:
302 virtualnext2
303The following NEW packages will be installed:
304 needsnext2:i386 virtualnext2
3050 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
306Inst virtualnext2 (1 unstable [amd64])
307Inst needsnext2:i386 (2 unstable [i386])
308Conf virtualnext2 (1 unstable [amd64])
309Conf needsnext2:i386 (2 unstable [i386])" aptget install needsnext2:i386 -s --solver $solver
310
311 testsuccessequal "$HEADER
312The following additional packages will be installed:
313 virtualnext3
314The following NEW packages will be installed:
315 needsnext3 virtualnext3
3160 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
317Inst virtualnext3 (1 unstable [amd64])
318Inst needsnext3 (2 unstable [amd64])
319Conf virtualnext3 (1 unstable [amd64])
320Conf needsnext3 (2 unstable [amd64])" aptget install needsnext3 -s --solver $solver
321
322 if [ "$solver" = 'apt' ]; then
323 testfailureequal "$HEADER
324The solver encountered an error of type: ERR_UNSOLVABLE
325The following information might help you to understand what is wrong:
326The following packages have unmet dependencies:
327 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
328
329$SOMEPACKAGESCOULDNOT
330 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
331E: External solver failed with: The following packages have unmet dependencies:" aptget install needsnext3:i386 -s --solver $solver
332 else
333 testfailureequal "$HEADER
334$SOMEPACKAGESCOULDNOT
335 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
336E: Unable to correct problems, you have held broken packages." aptget install needsnext3:i386 -s --solver $solver
337 fi
338
339 testsuccessequal "$HEADER
340The following additional packages will be installed:
341 selfprov
342The following NEW packages will be installed:
343 needsselfprov1 selfprov
3440 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
345Inst selfprov (2 unstable [amd64])
346Inst needsselfprov1 (1 unstable [amd64])
347Conf selfprov (2 unstable [amd64])
348Conf needsselfprov1 (1 unstable [amd64])" aptget install needsselfprov1 -s --solver $solver
349 testsuccessequal "$HEADER
350The following additional packages will be installed:
351 selfprov
352The following NEW packages will be installed:
353 needsselfprov2 selfprov
3540 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
355Inst selfprov (2 unstable [amd64])
356Inst needsselfprov2 (1 unstable [amd64])
357Conf selfprov (2 unstable [amd64])
358Conf needsselfprov2 (1 unstable [amd64])" aptget install needsselfprov2 -s --solver $solver
359 testsuccessequal "$HEADER
360The following additional packages will be installed:
361 selfprov
362The following NEW packages will be installed:
363 needsselfprov12 selfprov
3640 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
365Inst selfprov (2 unstable [amd64])
366Inst needsselfprov12 (1 unstable [amd64])
367Conf selfprov (2 unstable [amd64])
368Conf needsselfprov12 (1 unstable [amd64])" aptget install needsselfprov12 -s --solver $solver
369 if [ "$solver" = 'apt' ]; then
370 testfailureequal "$HEADER
371The solver encountered an error of type: ERR_UNSOLVABLE
372The following information might help you to understand what is wrong:
373The following packages have unmet dependencies:
374 needsselfprov123 : Depends: selfprov (= 3)
375
376$SOMEPACKAGESCOULDNOT
377 needsselfprov123 : Depends: selfprov (= 1)
378 Depends: selfprov (= 2)
379 Depends: selfprov (= 3)
380E: External solver failed with: The following packages have unmet dependencies:" aptget install needsselfprov123 -s --solver $solver
381 else
382 testfailureequal "$HEADER
383$SOMEPACKAGESCOULDNOT
384 needsselfprov123 : Depends: selfprov (= 3)
385E: Unable to correct problems, you have held broken packages." aptget install needsselfprov123 -s --solver $solver
386 fi
387done