]> git.saurik.com Git - apt.git/blob - test/integration/test-multiarch-allowed
just-in-time creation for (explicit) negative deps
[apt.git] / test / integration / test-multiarch-allowed
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'amd64' 'i386'
8
9 insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed'
10 insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo'
11 insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any'
12 insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)'
13 insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)'
14 insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo'
15 insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no senseā€¦
16 insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64'
17
18 insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed
19 Provides: coolbar'
20 insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed
21 Provides: coolbar (= 2)'
22 insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar'
23 insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any'
24 insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar'
25 insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar (>= 1)'
26 insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 1)'
27 insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 3)'
28
29 setupaptarchive
30
31 BADPREFIX='Reading package lists...
32 Building dependency tree...
33 Some packages could not be installed. This may mean that you have
34 requested an impossible situation or if you are using the unstable
35 distribution that some required packages have not yet been created
36 or been moved out of Incoming.
37 The following information may help to resolve the situation:
38 '
39
40 solveableinsinglearch0() {
41 testsuccessequal 'Reading package lists...
42 Building dependency tree...
43 The following extra packages will be installed:
44 foo
45 The following NEW packages will be installed:
46 foo needsfoo
47 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
48 Inst foo (1 unstable [amd64])
49 Inst needsfoo (1 unstable [amd64])
50 Conf foo (1 unstable [amd64])
51 Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s
52 }
53 solveableinsinglearch0
54 testsuccessequal 'Reading package lists...
55 Building dependency tree...
56 The following extra packages will be installed:
57 foo:i386
58 The following NEW packages will be installed:
59 foo:i386 needsfoo:i386
60 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
61 Inst foo:i386 (1 unstable [i386])
62 Inst needsfoo:i386 (1 unstable [i386])
63 Conf foo:i386 (1 unstable [i386])
64 Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s
65 testfailureequal "$BADPREFIX
66 The following packages have unmet dependencies:
67 needsfoo:i386 : Depends: foo:i386 but it is not going to be installed
68 E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s
69 testfailureequal "$BADPREFIX
70 The following packages have unmet dependencies:
71 needsfoo : Depends: foo but it is not going to be installed
72 E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s
73
74 solveableinsinglearch1() {
75 testsuccessequal "Reading package lists...
76 Building dependency tree...
77 The following extra packages will be installed:
78 foo
79 The following NEW packages will be installed:
80 foo $1
81 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
82 Inst foo (1 unstable [amd64])
83 Inst $1 (1 unstable [amd64])
84 Conf foo (1 unstable [amd64])
85 Conf $1 (1 unstable [amd64])" aptget install $1 -s
86 }
87
88 testneedsfooallgood() {
89 solveableinsinglearch1 $1
90 testsuccessequal "Reading package lists...
91 Building dependency tree...
92 The following extra packages will be installed:
93 foo
94 The following NEW packages will be installed:
95 foo $1:i386
96 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
97 Inst foo (1 unstable [amd64])
98 Inst $1:i386 (1 unstable [i386])
99 Conf foo (1 unstable [amd64])
100 Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s
101 testsuccessequal "Reading package lists...
102 Building dependency tree...
103 The following NEW packages will be installed:
104 foo:i386 $1:i386
105 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
106 Inst foo:i386 (1 unstable [i386])
107 Inst $1:i386 (1 unstable [i386])
108 Conf foo:i386 (1 unstable [i386])
109 Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s
110 testsuccessequal "Reading package lists...
111 Building dependency tree...
112 The following NEW packages will be installed:
113 foo:i386 $1
114 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
115 Inst foo:i386 (1 unstable [i386])
116 Inst $1 (1 unstable [amd64])
117 Conf foo:i386 (1 unstable [i386])
118 Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s
119 }
120 testneedsfooallgood 'needsfooany'
121 testneedsfooallgood 'needsfoover1'
122
123 NEEDSFOO2NATIVE="$BADPREFIX
124 The following packages have unmet dependencies:
125 needsfoover2 : Depends: foo:any (>= 2)
126 E: Unable to correct problems, you have held broken packages."
127 NEEDSFOO2FOREIGN="$BADPREFIX
128 The following packages have unmet dependencies:
129 needsfoover2:i386 : Depends: foo:any:i386 (>= 2)
130 E: Unable to correct problems, you have held broken packages."
131 testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
132 testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s
133 testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s
134 testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s
135
136 solveableinsinglearch2() {
137 testfailureequal "$BADPREFIX
138 The following packages have unmet dependencies:
139 hatesfoo : Conflicts: foo but 1 is to be installed
140 E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s
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
143 testfailureequal "$BADPREFIX
144 The following packages have unmet dependencies:
145 hatesfoonative : Conflicts: foo but 1 is to be installed
146 E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s
147 }
148 solveableinsinglearch2
149 testfailureequal "$BADPREFIX
150 The following packages have unmet dependencies:
151 hatesfoo : Conflicts: foo:i386 but 1 is to be installed
152 E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s
153 testfailureequal "$BADPREFIX
154 The following packages have unmet dependencies:
155 hatesfooany : Conflicts: foo:any
156 Conflicts: foo:any:i386
157 E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
158 testsuccessequal 'Reading package lists...
159 Building dependency tree...
160 The following NEW packages will be installed:
161 foo:i386 hatesfoonative
162 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
163 Inst foo:i386 (1 unstable [i386])
164 Inst hatesfoonative (1 unstable [amd64])
165 Conf foo:i386 (1 unstable [i386])
166 Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s
167
168 solveableinsinglearch3() {
169 testsuccessequal "Reading package lists...
170 Building dependency tree...
171 The following extra packages will be installed:
172 coolfoo
173 The following NEW packages will be installed:
174 coolfoo needscoolfoo
175 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
176 Inst coolfoo (1 unstable [amd64])
177 Inst needscoolfoo (1 unstable [amd64])
178 Conf coolfoo (1 unstable [amd64])
179 Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s
180 testsuccessequal "Reading package lists...
181 Building dependency tree...
182 The following extra packages will be installed:
183 coolfoo
184 The following NEW packages will be installed:
185 coolfoo coolfoover needscoolfoo
186 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
187 Inst coolfoo (1 unstable [amd64])
188 Inst coolfoover (1 unstable [amd64])
189 Inst needscoolfoo (1 unstable [amd64])
190 Conf coolfoo (1 unstable [amd64])
191 Conf coolfoover (1 unstable [amd64])
192 Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s
193 testfailureequal "$BADPREFIX
194 The following packages have unmet dependencies:
195 needscoolfooany : Depends: coolbar:any but it is not installable
196 E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s
197 testsuccessequal 'Reading package lists...
198 Building dependency tree...
199 The following extra packages will be installed:
200 coolfoo
201 The following NEW packages will be installed:
202 coolfoo needscoolfoover0
203 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
204 Inst coolfoo (1 unstable [amd64])
205 Inst needscoolfoover0 (1 unstable [amd64])
206 Conf coolfoo (1 unstable [amd64])
207 Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s
208 testsuccessequal 'Reading package lists...
209 Building dependency tree...
210 The following extra packages will be installed:
211 coolfoo coolfoover
212 The following NEW packages will be installed:
213 coolfoo coolfoover needscoolfoover1
214 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
215 Inst coolfoo (1 unstable [amd64])
216 Inst coolfoover (1 unstable [amd64])
217 Inst needscoolfoover1 (1 unstable [amd64])
218 Conf coolfoo (1 unstable [amd64])
219 Conf coolfoover (1 unstable [amd64])
220 Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s
221 testfailureequal "$BADPREFIX
222 The following packages have unmet dependencies:
223 needscoolfoover2 : Depends: coolfoo:any (>= 2)
224 E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s
225 testfailureequal "$BADPREFIX
226 The following packages have unmet dependencies:
227 needscoolfoover3 : Depends: coolfoo:any (>= 2)
228 Depends: coolbar (>= 3)
229 E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s
230 }
231 solveableinsinglearch3
232
233 msgmsg 'switch to single architecture'
234 configarchitecture 'amd64'
235
236 solveableinsinglearch0
237 testfailureequal 'Reading package lists...
238 Building dependency tree...
239 E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s
240
241 solveableinsinglearch1 'needsfooany'
242 solveableinsinglearch1 'needsfoover1'
243 testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
244 solveableinsinglearch2
245 solveableinsinglearch3