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