]> git.saurik.com Git - apt.git/blame - test/integration/test-multiarch-allowed
M-A: allowed pkgs of unconfigured archs do not statisfy :any
[apt.git] / test / integration / test-multiarch-allowed
CommitLineData
ecc138f8
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed'
10insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo'
11insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any'
12insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)'
13insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)'
14insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo'
15insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no senseā€¦
16insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64'
17
18insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed
19Provides: coolbar'
20insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed
21Provides: coolbar (= 2)'
22insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar'
23insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any'
24insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar'
25insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar (>= 1)'
26insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 1)'
27insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 3)'
28
29setupaptarchive
30
31BADPREFIX='Reading package lists...
32Building dependency tree...
33Some packages could not be installed. This may mean that you have
34requested an impossible situation or if you are using the unstable
35distribution that some required packages have not yet been created
36or been moved out of Incoming.
37The following information may help to resolve the situation:
38'
39
40solveableinsinglearch0() {
41 testsuccessequal 'Reading package lists...
42Building dependency tree...
e7ebb414 43The following additional packages will be installed:
ecc138f8
DK
44 foo
45The following NEW packages will be installed:
46 foo needsfoo
470 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
48Inst foo (1 unstable [amd64])
49Inst needsfoo (1 unstable [amd64])
50Conf foo (1 unstable [amd64])
51Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s
52}
53solveableinsinglearch0
54testsuccessequal 'Reading package lists...
55Building dependency tree...
e7ebb414 56The following additional packages will be installed:
ecc138f8
DK
57 foo:i386
58The following NEW packages will be installed:
59 foo:i386 needsfoo:i386
600 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
61Inst foo:i386 (1 unstable [i386])
62Inst needsfoo:i386 (1 unstable [i386])
63Conf foo:i386 (1 unstable [i386])
64Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s
65testfailureequal "$BADPREFIX
66The following packages have unmet dependencies:
67 needsfoo:i386 : Depends: foo:i386 but it is not going to be installed
68E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s
69testfailureequal "$BADPREFIX
70The following packages have unmet dependencies:
71 needsfoo : Depends: foo but it is not going to be installed
72E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s
73
74solveableinsinglearch1() {
75 testsuccessequal "Reading package lists...
76Building dependency tree...
e7ebb414 77The following additional packages will be installed:
ecc138f8
DK
78 foo
79The following NEW packages will be installed:
80 foo $1
810 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
82Inst foo (1 unstable [amd64])
83Inst $1 (1 unstable [amd64])
84Conf foo (1 unstable [amd64])
85Conf $1 (1 unstable [amd64])" aptget install $1 -s
86}
87
88testneedsfooallgood() {
89 solveableinsinglearch1 $1
90 testsuccessequal "Reading package lists...
91Building dependency tree...
e7ebb414 92The following additional packages will be installed:
ecc138f8
DK
93 foo
94The following NEW packages will be installed:
95 foo $1:i386
960 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
97Inst foo (1 unstable [amd64])
98Inst $1:i386 (1 unstable [i386])
99Conf foo (1 unstable [amd64])
100Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s
101 testsuccessequal "Reading package lists...
102Building dependency tree...
103The following NEW packages will be installed:
104 foo:i386 $1:i386
1050 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
106Inst foo:i386 (1 unstable [i386])
107Inst $1:i386 (1 unstable [i386])
108Conf foo:i386 (1 unstable [i386])
109Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s
110 testsuccessequal "Reading package lists...
111Building dependency tree...
112The following NEW packages will be installed:
113 foo:i386 $1
1140 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
115Inst foo:i386 (1 unstable [i386])
116Inst $1 (1 unstable [amd64])
117Conf foo:i386 (1 unstable [i386])
118Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s
119}
120testneedsfooallgood 'needsfooany'
121testneedsfooallgood 'needsfoover1'
122
123NEEDSFOO2NATIVE="$BADPREFIX
124The following packages have unmet dependencies:
125 needsfoover2 : Depends: foo:any (>= 2)
126E: Unable to correct problems, you have held broken packages."
127NEEDSFOO2FOREIGN="$BADPREFIX
128The following packages have unmet dependencies:
f6ce7ffc 129 needsfoover2:i386 : Depends: foo:any (>= 2)
ecc138f8
DK
130E: Unable to correct problems, you have held broken packages."
131testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
132testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s
133testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s
134testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s
135
136solveableinsinglearch2() {
137 testfailureequal "$BADPREFIX
138The following packages have unmet dependencies:
139 hatesfoo : Conflicts: foo but 1 is to be installed
140E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s
bb0f6a34
DK
141 # the message differs slightly between single and multiarch
142 testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s
ecc138f8
DK
143 testfailureequal "$BADPREFIX
144The following packages have unmet dependencies:
145 hatesfoonative : Conflicts: foo but 1 is to be installed
146E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s
147}
148solveableinsinglearch2
149testfailureequal "$BADPREFIX
150The following packages have unmet dependencies:
151 hatesfoo : Conflicts: foo:i386 but 1 is to be installed
152E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s
153testfailureequal "$BADPREFIX
154The following packages have unmet dependencies:
155 hatesfooany : Conflicts: foo:any
156E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
157testsuccessequal 'Reading package lists...
158Building dependency tree...
159The following NEW packages will be installed:
160 foo:i386 hatesfoonative
1610 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
162Inst foo:i386 (1 unstable [i386])
163Inst hatesfoonative (1 unstable [amd64])
164Conf foo:i386 (1 unstable [i386])
165Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s
166
167solveableinsinglearch3() {
168 testsuccessequal "Reading package lists...
169Building dependency tree...
e7ebb414 170The following additional packages will be installed:
ecc138f8
DK
171 coolfoo
172The following NEW packages will be installed:
173 coolfoo needscoolfoo
1740 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
175Inst coolfoo (1 unstable [amd64])
176Inst needscoolfoo (1 unstable [amd64])
177Conf coolfoo (1 unstable [amd64])
178Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s
179 testsuccessequal "Reading package lists...
180Building dependency tree...
e7ebb414 181The following additional packages will be installed:
ecc138f8
DK
182 coolfoo
183The following NEW packages will be installed:
184 coolfoo coolfoover needscoolfoo
1850 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
186Inst coolfoo (1 unstable [amd64])
187Inst coolfoover (1 unstable [amd64])
188Inst needscoolfoo (1 unstable [amd64])
189Conf coolfoo (1 unstable [amd64])
190Conf coolfoover (1 unstable [amd64])
191Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s
192 testfailureequal "$BADPREFIX
193The following packages have unmet dependencies:
194 needscoolfooany : Depends: coolbar:any but it is not installable
195E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s
196 testsuccessequal 'Reading package lists...
197Building dependency tree...
e7ebb414 198The following additional packages will be installed:
ecc138f8
DK
199 coolfoo
200The following NEW packages will be installed:
201 coolfoo needscoolfoover0
2020 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
203Inst coolfoo (1 unstable [amd64])
204Inst needscoolfoover0 (1 unstable [amd64])
205Conf coolfoo (1 unstable [amd64])
206Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s
207 testsuccessequal 'Reading package lists...
208Building dependency tree...
e7ebb414 209The following additional packages will be installed:
ecc138f8
DK
210 coolfoo coolfoover
211The following NEW packages will be installed:
212 coolfoo coolfoover needscoolfoover1
2130 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
214Inst coolfoo (1 unstable [amd64])
215Inst coolfoover (1 unstable [amd64])
216Inst needscoolfoover1 (1 unstable [amd64])
217Conf coolfoo (1 unstable [amd64])
218Conf coolfoover (1 unstable [amd64])
219Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s
220 testfailureequal "$BADPREFIX
221The following packages have unmet dependencies:
222 needscoolfoover2 : Depends: coolfoo:any (>= 2)
223E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s
224 testfailureequal "$BADPREFIX
225The following packages have unmet dependencies:
226 needscoolfoover3 : Depends: coolfoo:any (>= 2)
227 Depends: coolbar (>= 3)
228E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s
229}
230solveableinsinglearch3
231
232msgmsg 'switch to single architecture'
233configarchitecture 'amd64'
234
235solveableinsinglearch0
236testfailureequal 'Reading package lists...
237Building dependency tree...
238E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s
239
240solveableinsinglearch1 'needsfooany'
241solveableinsinglearch1 'needsfoover1'
242testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
243solveableinsinglearch2
244solveableinsinglearch3
384f17b4
DK
245
246msgmsg 'multi-arch with barbarian archs'
247configarchitecture 'amd64' 'i386'
248insertinstalledpackage 'foo' 'armel' '1' 'Multi-Arch: allowed'
249insertinstalledpackage 'coolfoo' 'armel' '1' 'Multi-Arch:allowed
250Provides: coolbar'
251
252testsuccessequal 'Reading package lists...
253Building dependency tree...
254The following additional packages will be installed:
255 foo
256The following packages will be REMOVED:
257 foo:armel
258The following NEW packages will be installed:
259 foo needsfooany
2600 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
261Remv foo:armel [1]
262Inst foo (1 unstable [amd64])
263Inst needsfooany (1 unstable [amd64])
264Conf foo (1 unstable [amd64])
265Conf needsfooany (1 unstable [amd64])' aptget install needsfooany -s
266testsuccessequal 'Reading package lists...
267Building dependency tree...
268The following additional packages will be installed:
269 foo
270The following packages will be REMOVED:
271 foo:armel
272The following NEW packages will be installed:
273 foo needsfooany:i386
2740 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
275Remv foo:armel [1]
276Inst foo (1 unstable [amd64])
277Inst needsfooany:i386 (1 unstable [i386])
278Conf foo (1 unstable [amd64])
279Conf needsfooany:i386 (1 unstable [i386])' aptget install needsfooany:i386 -s
280testsuccessequal 'Reading package lists...
281Building dependency tree...
282The following additional packages will be installed:
283 coolfoo
284The following packages will be REMOVED:
285 coolfoo:armel
286The following NEW packages will be installed:
287 coolfoo needscoolfoover0
2880 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
289Remv coolfoo:armel [1]
290Inst coolfoo (1 unstable [amd64])
291Inst needscoolfoover0 (1 unstable [amd64])
292Conf coolfoo (1 unstable [amd64])
293Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s