]> git.saurik.com Git - apt.git/blame - test/integration/test-multiarch-allowed
just-in-time creation for (explicit) negative deps
[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...
43The following extra packages will be installed:
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...
56The following extra packages will be installed:
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...
77The following extra packages will be installed:
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...
92The following extra packages will be installed:
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:
129 needsfoover2:i386 : Depends: foo:any:i386 (>= 2)
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
bb0f6a34 156 Conflicts: foo:any:i386
ecc138f8
DK
157E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
158testsuccessequal 'Reading package lists...
159Building dependency tree...
160The following NEW packages will be installed:
161 foo:i386 hatesfoonative
1620 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
163Inst foo:i386 (1 unstable [i386])
164Inst hatesfoonative (1 unstable [amd64])
165Conf foo:i386 (1 unstable [i386])
166Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s
167
168solveableinsinglearch3() {
169 testsuccessequal "Reading package lists...
170Building dependency tree...
171The following extra packages will be installed:
172 coolfoo
173The following NEW packages will be installed:
174 coolfoo needscoolfoo
1750 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
176Inst coolfoo (1 unstable [amd64])
177Inst needscoolfoo (1 unstable [amd64])
178Conf coolfoo (1 unstable [amd64])
179Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s
180 testsuccessequal "Reading package lists...
181Building dependency tree...
182The following extra packages will be installed:
183 coolfoo
184The following NEW packages will be installed:
185 coolfoo coolfoover needscoolfoo
1860 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
187Inst coolfoo (1 unstable [amd64])
188Inst coolfoover (1 unstable [amd64])
189Inst needscoolfoo (1 unstable [amd64])
190Conf coolfoo (1 unstable [amd64])
191Conf coolfoover (1 unstable [amd64])
192Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s
193 testfailureequal "$BADPREFIX
194The following packages have unmet dependencies:
195 needscoolfooany : Depends: coolbar:any but it is not installable
196E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s
197 testsuccessequal 'Reading package lists...
198Building dependency tree...
199The following extra packages will be installed:
200 coolfoo
201The following NEW packages will be installed:
202 coolfoo needscoolfoover0
2030 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
204Inst coolfoo (1 unstable [amd64])
205Inst needscoolfoover0 (1 unstable [amd64])
206Conf coolfoo (1 unstable [amd64])
207Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s
208 testsuccessequal 'Reading package lists...
209Building dependency tree...
210The following extra packages will be installed:
211 coolfoo coolfoover
212The following NEW packages will be installed:
213 coolfoo coolfoover needscoolfoover1
2140 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
215Inst coolfoo (1 unstable [amd64])
216Inst coolfoover (1 unstable [amd64])
217Inst needscoolfoover1 (1 unstable [amd64])
218Conf coolfoo (1 unstable [amd64])
219Conf coolfoover (1 unstable [amd64])
220Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s
221 testfailureequal "$BADPREFIX
222The following packages have unmet dependencies:
223 needscoolfoover2 : Depends: coolfoo:any (>= 2)
224E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s
225 testfailureequal "$BADPREFIX
226The following packages have unmet dependencies:
227 needscoolfoover3 : Depends: coolfoo:any (>= 2)
228 Depends: coolbar (>= 3)
229E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s
230}
231solveableinsinglearch3
232
233msgmsg 'switch to single architecture'
234configarchitecture 'amd64'
235
236solveableinsinglearch0
237testfailureequal 'Reading package lists...
238Building dependency tree...
239E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s
240
241solveableinsinglearch1 'needsfooany'
242solveableinsinglearch1 'needsfoover1'
243testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
244solveableinsinglearch2
245solveableinsinglearch3