diff options
Diffstat (limited to 'meta/recipes-extended/libzypp/libzypp/libzypp-oearch.patch')
-rw-r--r-- | meta/recipes-extended/libzypp/libzypp/libzypp-oearch.patch | 500 |
1 files changed, 500 insertions, 0 deletions
diff --git a/meta/recipes-extended/libzypp/libzypp/libzypp-oearch.patch b/meta/recipes-extended/libzypp/libzypp/libzypp-oearch.patch new file mode 100644 index 0000000000..9a0e42b709 --- /dev/null +++ b/meta/recipes-extended/libzypp/libzypp/libzypp-oearch.patch | |||
@@ -0,0 +1,500 @@ | |||
1 | Upstream-Status: Inappropriate [distribution] | ||
2 | |||
3 | Disable all of the internal architectures | ||
4 | |||
5 | We disable all of the internal architectures and replace them with ones | ||
6 | generated by the libzypp recipe as specified in the oe-arch.h. | ||
7 | |||
8 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
9 | |||
10 | diff -ur git.orig/tests/lib/TestSetup.h git/tests/lib/TestSetup.h | ||
11 | --- git.orig/tests/lib/TestSetup.h 2011-03-28 14:24:36.534800770 -0500 | ||
12 | +++ git/tests/lib/TestSetup.h 2011-03-28 14:25:04.969912234 -0500 | ||
13 | @@ -66,7 +66,7 @@ | ||
14 | * // enabls loging fot the scope of this block: | ||
15 | * // base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "/tmp/YLOG" ) ); | ||
16 | * | ||
17 | - * TestSetup test( Arch_x86_64 ); | ||
18 | + * TestSetup test( Arch_machine ); | ||
19 | * // test.loadTarget(); // initialize and load target | ||
20 | * test.loadRepo( TESTS_SRC_DIR"/data/openSUSE-11.1" ); | ||
21 | * | ||
22 | @@ -313,7 +313,7 @@ | ||
23 | * a TestSetup system or a real system. The provided repostitories are | ||
24 | * loaded into the pool (without refresh). | ||
25 | */ | ||
26 | - static void LoadSystemAt( const Pathname & sysRoot, const Arch & _testSetupArch_r = Arch_x86_64 ) | ||
27 | + static void LoadSystemAt( const Pathname & sysRoot, const Arch & _testSetupArch_r = Arch_machine ) | ||
28 | { | ||
29 | if ( ! PathInfo( sysRoot ).isDir() ) | ||
30 | ZYPP_THROW( Exception("sysRoot argument needs to be a directory") ); | ||
31 | diff -ur git.orig/tools/DumpSelectable.cc git/tools/DumpSelectable.cc | ||
32 | --- git.orig/tools/DumpSelectable.cc 2011-03-28 14:24:36.547876951 -0500 | ||
33 | +++ git/tools/DumpSelectable.cc 2011-03-28 14:25:04.969912234 -0500 | ||
34 | @@ -78,7 +78,7 @@ | ||
35 | else if ( TestSetup::isTestSetup( sysRoot ) ) | ||
36 | { | ||
37 | message << str::form( "*** Load TestSetup from '%s'", sysRoot.c_str() ) << endl; | ||
38 | - TestSetup test( sysRoot, Arch_x86_64 ); | ||
39 | + TestSetup test( sysRoot, Arch_machine ); | ||
40 | test.loadRepos(); | ||
41 | } | ||
42 | else | ||
43 | diff -ur git.orig/tools/NameReqPrv.cc git/tools/NameReqPrv.cc | ||
44 | --- git.orig/tools/NameReqPrv.cc 2011-03-28 14:24:36.547876951 -0500 | ||
45 | +++ git/tools/NameReqPrv.cc 2011-03-28 14:25:04.970849384 -0500 | ||
46 | @@ -112,7 +112,7 @@ | ||
47 | else if ( TestSetup::isTestSetup( sysRoot ) ) | ||
48 | { | ||
49 | message << str::form( "*** Load TestSetup from '%s'", sysRoot.c_str() ) << endl; | ||
50 | - TestSetup test( sysRoot, Arch_x86_64 ); | ||
51 | + TestSetup test( sysRoot, Arch_machine ); | ||
52 | test.loadRepos(); | ||
53 | dumpRange( message, satpool.reposBegin(), satpool.reposEnd() ) << endl; | ||
54 | } | ||
55 | diff -ur git.orig/tools/ToolScanRepos.cc git/tools/ToolScanRepos.cc | ||
56 | --- git.orig/tools/ToolScanRepos.cc 2011-03-28 14:24:36.547876951 -0500 | ||
57 | +++ git/tools/ToolScanRepos.cc 2011-03-28 14:25:04.970849384 -0500 | ||
58 | @@ -46,7 +46,7 @@ | ||
59 | /////////////////////////////////////////////////////////////////// | ||
60 | Pathname mtmp( "/tmp" ); | ||
61 | Pathname mroot( mtmp/appname ); | ||
62 | - Arch march( Arch_x86_64 ); | ||
63 | + Arch march( Arch_machine ); | ||
64 | bool oClearRoot = true; | ||
65 | |||
66 | std::vector<std::string> urls; | ||
67 | @@ -83,7 +83,7 @@ | ||
68 | if ( *(argv[0]) ) // empty | ||
69 | march = Arch( argv[0] ); | ||
70 | else | ||
71 | - march = Arch_x86_64; | ||
72 | + march = Arch_machine; | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | @@ -131,4 +131,4 @@ | ||
77 | |||
78 | INT << "===[END]============================================" << endl << endl; | ||
79 | return ret; | ||
80 | -} | ||
81 | \ No newline at end of file | ||
82 | +} | ||
83 | diff -ur git.orig/tools/zypp-list.cc git/tools/zypp-list.cc | ||
84 | --- git.orig/tools/zypp-list.cc 2011-03-28 14:24:36.547876951 -0500 | ||
85 | +++ git/tools/zypp-list.cc 2011-03-28 14:25:04.971901224 -0500 | ||
86 | @@ -56,7 +56,7 @@ | ||
87 | else if ( TestSetup::isTestSetup( sysRoot ) ) | ||
88 | { | ||
89 | message << str::form( "*** Load TestSetup from '%s'", sysRoot.c_str() ) << endl; | ||
90 | - TestSetup test( sysRoot, Arch_x86_64 ); | ||
91 | + TestSetup test( sysRoot, Arch_machine ); | ||
92 | test.loadRepos(); | ||
93 | dumpRange( message, satpool.reposBegin(), satpool.reposEnd() ) << endl; | ||
94 | } | ||
95 | diff -ur git.orig/zypp/Arch.cc git/zypp/Arch.cc | ||
96 | --- git.orig/zypp/Arch.cc 2011-03-28 14:24:36.548877414 -0500 | ||
97 | +++ git/zypp/Arch.cc 2011-03-28 14:31:13.943786442 -0500 | ||
98 | @@ -153,53 +153,11 @@ | ||
99 | // bit for each architecture. | ||
100 | // | ||
101 | #define DEF_BUILTIN(A) const IdString _##A( #A ); | ||
102 | + DEF_BUILTIN( all ); | ||
103 | + DEF_BUILTIN( any ); | ||
104 | DEF_BUILTIN( noarch ); | ||
105 | |||
106 | - DEF_BUILTIN( i386 ); | ||
107 | - DEF_BUILTIN( i486 ); | ||
108 | - DEF_BUILTIN( i586 ); | ||
109 | - DEF_BUILTIN( i686 ); | ||
110 | - DEF_BUILTIN( athlon ); | ||
111 | - DEF_BUILTIN( x86_64 ); | ||
112 | - | ||
113 | - DEF_BUILTIN( pentium3 ); | ||
114 | - DEF_BUILTIN( pentium4 ); | ||
115 | - | ||
116 | - DEF_BUILTIN( s390 ); | ||
117 | - DEF_BUILTIN( s390x ); | ||
118 | - | ||
119 | - DEF_BUILTIN( ppc ); | ||
120 | - DEF_BUILTIN( ppc64 ); | ||
121 | - | ||
122 | - DEF_BUILTIN( ia64 ); | ||
123 | - | ||
124 | - DEF_BUILTIN( alphaev67 ); | ||
125 | - DEF_BUILTIN( alphaev6 ); | ||
126 | - DEF_BUILTIN( alphapca56 ); | ||
127 | - DEF_BUILTIN( alphaev56 ); | ||
128 | - DEF_BUILTIN( alphaev5 ); | ||
129 | - DEF_BUILTIN( alpha ); | ||
130 | - | ||
131 | - DEF_BUILTIN( sparc64v ); | ||
132 | - DEF_BUILTIN( sparcv9v ); | ||
133 | - DEF_BUILTIN( sparc64 ); | ||
134 | - DEF_BUILTIN( sparcv9 ); | ||
135 | - DEF_BUILTIN( sparcv8 ); | ||
136 | - DEF_BUILTIN( sparc ); | ||
137 | - | ||
138 | - DEF_BUILTIN( armv7l ); | ||
139 | - DEF_BUILTIN( armv6l ); | ||
140 | - DEF_BUILTIN( armv5tejl ); | ||
141 | - DEF_BUILTIN( armv5tel ); | ||
142 | - DEF_BUILTIN( armv5l ); | ||
143 | - DEF_BUILTIN( armv4tl ); | ||
144 | - DEF_BUILTIN( armv4l ); | ||
145 | - DEF_BUILTIN( armv3l ); | ||
146 | - | ||
147 | - DEF_BUILTIN( sh3 ); | ||
148 | - | ||
149 | - DEF_BUILTIN( sh4 ); | ||
150 | - DEF_BUILTIN( sh4a ); | ||
151 | +#include "oe-arch.h" | ||
152 | #undef DEF_BUILTIN | ||
153 | |||
154 | /////////////////////////////////////////////////////////////////// | ||
155 | @@ -269,6 +227,8 @@ | ||
156 | // _noarch must have _idBit 0. | ||
157 | // Other builtins have 1-bit set | ||
158 | // and are initialized done on the fly. | ||
159 | + _compatSet.insert( Arch::CompatEntry( _all, 0 ) ); | ||
160 | + _compatSet.insert( Arch::CompatEntry( _any, 0 ) ); | ||
161 | _compatSet.insert( Arch::CompatEntry( _noarch, 0 ) ); | ||
162 | /////////////////////////////////////////////////////////////////// | ||
163 | // Define the CompatibleWith relation: | ||
164 | @@ -276,52 +236,9 @@ | ||
165 | // NOTE: Order of definition is significant! (Arch::compare) | ||
166 | // - define compatible (less) architectures first! | ||
167 | // | ||
168 | - defCompatibleWith( _i386, _noarch ); | ||
169 | - defCompatibleWith( _i486, _noarch,_i386 ); | ||
170 | - defCompatibleWith( _i586, _noarch,_i386,_i486 ); | ||
171 | - defCompatibleWith( _i686, _noarch,_i386,_i486,_i586 ); | ||
172 | - defCompatibleWith( _athlon, _noarch,_i386,_i486,_i586,_i686 ); | ||
173 | - defCompatibleWith( _x86_64, _noarch,_i386,_i486,_i586,_i686,_athlon ); | ||
174 | - | ||
175 | - defCompatibleWith( _pentium3, _noarch,_i386,_i486,_i586,_i686 ); | ||
176 | - defCompatibleWith( _pentium4, _noarch,_i386,_i486,_i586,_i686,_pentium3 ); | ||
177 | - | ||
178 | - defCompatibleWith( _ia64, _noarch,_i386,_i486,_i586,_i686 ); | ||
179 | - // | ||
180 | - defCompatibleWith( _s390, _noarch ); | ||
181 | - defCompatibleWith( _s390x, _noarch,_s390 ); | ||
182 | - // | ||
183 | - defCompatibleWith( _ppc, _noarch ); | ||
184 | - defCompatibleWith( _ppc64, _noarch,_ppc ); | ||
185 | - // | ||
186 | - defCompatibleWith( _alpha, _noarch ); | ||
187 | - defCompatibleWith( _alphaev5, _noarch,_alpha ); | ||
188 | - defCompatibleWith( _alphaev56, _noarch,_alpha,_alphaev5 ); | ||
189 | - defCompatibleWith( _alphapca56, _noarch,_alpha,_alphaev5,_alphaev56 ); | ||
190 | - defCompatibleWith( _alphaev6, _noarch,_alpha,_alphaev5,_alphaev56,_alphapca56 ); | ||
191 | - defCompatibleWith( _alphaev67, _noarch,_alpha,_alphaev5,_alphaev56,_alphapca56,_alphaev6 ); | ||
192 | - // | ||
193 | - defCompatibleWith( _sparc, _noarch ); | ||
194 | - defCompatibleWith( _sparcv8, _noarch,_sparc ); | ||
195 | - defCompatibleWith( _sparcv9, _noarch,_sparc,_sparcv8 ); | ||
196 | - defCompatibleWith( _sparcv9v, _noarch,_sparc,_sparcv8,_sparcv9 ); | ||
197 | - // | ||
198 | - defCompatibleWith( _sparc64, _noarch,_sparc,_sparcv8,_sparcv9 ); | ||
199 | - defCompatibleWith( _sparc64v, _noarch,_sparc,_sparcv8,_sparcv9,_sparcv9v,_sparc64 ); | ||
200 | - // | ||
201 | - defCompatibleWith( _armv3l, _noarch ); | ||
202 | - defCompatibleWith( _armv4l, _noarch,_armv3l ); | ||
203 | - defCompatibleWith( _armv4tl, _noarch,_armv3l,_armv4l ); | ||
204 | - defCompatibleWith( _armv5l, _noarch,_armv3l,_armv4l,_armv4tl ); | ||
205 | - defCompatibleWith( _armv5tel, _noarch,_armv3l,_armv4l,_armv4tl,_armv5l ); | ||
206 | - defCompatibleWith( _armv5tejl, _noarch,_armv3l,_armv4l,_armv4tl,_armv5l,_armv5tel ); | ||
207 | - defCompatibleWith( _armv6l, _noarch,_armv3l,_armv4l,_armv4tl,_armv5l,_armv5tel,_armv5tejl ); | ||
208 | - defCompatibleWith( _armv7l, _noarch,_armv3l,_armv4l,_armv4tl,_armv5l,_armv5tel,_armv5tejl,_armv6l ); | ||
209 | - // | ||
210 | - defCompatibleWith( _sh3, _noarch ); | ||
211 | - // | ||
212 | - defCompatibleWith( _sh4, _noarch ); | ||
213 | - defCompatibleWith( _sh4a, _noarch,_sh4 ); | ||
214 | +#define OE_DEF_COMPAT 1 | ||
215 | +#include "oe-arch.h" | ||
216 | +#undef OE_DEF_COMPAT | ||
217 | // | ||
218 | /////////////////////////////////////////////////////////////////// | ||
219 | // dumpOn( USR ) << endl; | ||
220 | @@ -388,53 +305,13 @@ | ||
221 | /////////////////////////////////////////////////////////////////// | ||
222 | |||
223 | const Arch Arch_empty ( IdString::Empty ); | ||
224 | + const Arch Arch_all( _all ); | ||
225 | + const Arch Arch_any( _any ); | ||
226 | const Arch Arch_noarch( _noarch ); | ||
227 | |||
228 | - const Arch Arch_i386( _i386 ); | ||
229 | - const Arch Arch_i486( _i486 ); | ||
230 | - const Arch Arch_i586( _i586 ); | ||
231 | - const Arch Arch_i686( _i686 ); | ||
232 | - const Arch Arch_athlon( _athlon ); | ||
233 | - const Arch Arch_x86_64( _x86_64 ); | ||
234 | - | ||
235 | - const Arch Arch_pentium3( _pentium3 ); | ||
236 | - const Arch Arch_pentium4( _pentium4 ); | ||
237 | - | ||
238 | - const Arch Arch_s390( _s390 ); | ||
239 | - const Arch Arch_s390x( _s390x ); | ||
240 | - | ||
241 | - const Arch Arch_ppc( _ppc ); | ||
242 | - const Arch Arch_ppc64( _ppc64 ); | ||
243 | - | ||
244 | - const Arch Arch_ia64( _ia64 ); | ||
245 | - | ||
246 | - const Arch Arch_alphaev67( _alphaev67 ); | ||
247 | - const Arch Arch_alphaev6( _alphaev6 ); | ||
248 | - const Arch Arch_alphapca56( _alphapca56 ); | ||
249 | - const Arch Arch_alphaev56( _alphaev56 ); | ||
250 | - const Arch Arch_alphaev5( _alphaev5 ); | ||
251 | - const Arch Arch_alpha( _alpha ); | ||
252 | - | ||
253 | - const Arch Arch_sparc64v( _sparc64v ); | ||
254 | - const Arch Arch_sparc64( _sparc64 ); | ||
255 | - const Arch Arch_sparcv9v( _sparcv9v ); | ||
256 | - const Arch Arch_sparcv9( _sparcv9 ); | ||
257 | - const Arch Arch_sparcv8( _sparcv8 ); | ||
258 | - const Arch Arch_sparc( _sparc ); | ||
259 | - | ||
260 | - const Arch Arch_armv7l( _armv7l ); | ||
261 | - const Arch Arch_armv6l( _armv6l ); | ||
262 | - const Arch Arch_armv5tejl( _armv5tejl ); | ||
263 | - const Arch Arch_armv5tel( _armv5tel ); | ||
264 | - const Arch Arch_armv5l( _armv5l ); | ||
265 | - const Arch Arch_armv4tl( _armv4tl ); | ||
266 | - const Arch Arch_armv4l( _armv4l ); | ||
267 | - const Arch Arch_armv3l( _armv3l ); | ||
268 | - | ||
269 | - const Arch Arch_sh3( _sh3 ); | ||
270 | - | ||
271 | - const Arch Arch_sh4( _sh4 ); | ||
272 | - const Arch Arch_sh4a( _sh4a ); | ||
273 | +#define OE_PROTO 1 | ||
274 | +#include "oe-arch.h" | ||
275 | +#undef OE_PROTO | ||
276 | |||
277 | /////////////////////////////////////////////////////////////////// | ||
278 | // | ||
279 | @@ -504,26 +381,10 @@ | ||
280 | // | ||
281 | Arch Arch::baseArch( ) const | ||
282 | { | ||
283 | - // check the multilib archs: | ||
284 | - if (Arch_x86_64.compatibleWith(*this)) | ||
285 | - { | ||
286 | - return Arch_x86_64; | ||
287 | - } | ||
288 | - if (Arch_sparc64v.compatibleWith(*this)) | ||
289 | - { | ||
290 | - return Arch_sparc64v; | ||
291 | - } | ||
292 | - if (Arch_sparc64.compatibleWith(*this)) | ||
293 | - { | ||
294 | - return Arch_sparc64; | ||
295 | - } | ||
296 | - if (Arch_ppc64.compatibleWith(*this)) | ||
297 | - { | ||
298 | - return Arch_ppc64; | ||
299 | - } | ||
300 | - if (Arch_s390x.compatibleWith(*this)) | ||
301 | + // Check the multilib arch: | ||
302 | + if (Arch_machine.compatibleWith(*this)) | ||
303 | { | ||
304 | - return Arch_s390x; | ||
305 | + return Arch_machine; | ||
306 | } | ||
307 | // Here: no multilib; return arch before noarch | ||
308 | CompatSet cset( compatSet( *this ) ); | ||
309 | diff -ur git.orig/zypp/Arch.h git/zypp/Arch.h | ||
310 | --- git.orig/zypp/Arch.h 2011-03-28 14:24:36.548877414 -0500 | ||
311 | +++ git/zypp/Arch.h 2011-03-28 14:25:04.972801208 -0500 | ||
312 | @@ -162,89 +162,13 @@ | ||
313 | extern const Arch Arch_empty; | ||
314 | |||
315 | /** \relates Arch */ | ||
316 | + extern const Arch Arch_all; | ||
317 | + extern const Arch Arch_any; | ||
318 | extern const Arch Arch_noarch; | ||
319 | |||
320 | - /** \relates Arch */ | ||
321 | - extern const Arch Arch_pentium4; | ||
322 | - /** \relates Arch */ | ||
323 | - extern const Arch Arch_pentium3; | ||
324 | - | ||
325 | - /** \relates Arch */ | ||
326 | - extern const Arch Arch_x86_64; | ||
327 | - /** \relates Arch */ | ||
328 | - extern const Arch Arch_athlon; | ||
329 | - /** \relates Arch */ | ||
330 | - extern const Arch Arch_i686; | ||
331 | - /** \relates Arch */ | ||
332 | - extern const Arch Arch_i586; | ||
333 | - /** \relates Arch */ | ||
334 | - extern const Arch Arch_i486; | ||
335 | - /** \relates Arch */ | ||
336 | - extern const Arch Arch_i386; | ||
337 | - | ||
338 | - /** \relates Arch */ | ||
339 | - extern const Arch Arch_s390x; | ||
340 | - /** \relates Arch */ | ||
341 | - extern const Arch Arch_s390; | ||
342 | - | ||
343 | - /** \relates Arch */ | ||
344 | - extern const Arch Arch_ppc64; | ||
345 | - /** \relates Arch */ | ||
346 | - extern const Arch Arch_ppc; | ||
347 | - | ||
348 | - /** \relates Arch */ | ||
349 | - extern const Arch Arch_ia64; | ||
350 | - | ||
351 | - /** \relates Arch */ | ||
352 | - extern const Arch Arch_alphaev67; | ||
353 | - /** \relates Arch */ | ||
354 | - extern const Arch Arch_alphaev6; | ||
355 | - /** \relates Arch */ | ||
356 | - extern const Arch Arch_alphapca56; | ||
357 | - /** \relates Arch */ | ||
358 | - extern const Arch Arch_alphaev56; | ||
359 | - /** \relates Arch */ | ||
360 | - extern const Arch Arch_alphaev5; | ||
361 | - /** \relates Arch */ | ||
362 | - extern const Arch Arch_alpha; | ||
363 | - | ||
364 | - /** \relates Arch */ | ||
365 | - extern const Arch Arch_sparc64v; | ||
366 | - /** \relates Arch */ | ||
367 | - extern const Arch Arch_sparc64; | ||
368 | - /** \relates Arch */ | ||
369 | - extern const Arch Arch_sparcv9v; | ||
370 | - /** \relates Arch */ | ||
371 | - extern const Arch Arch_sparcv9; | ||
372 | - /** \relates Arch */ | ||
373 | - extern const Arch Arch_sparcv8; | ||
374 | - /** \relates Arch */ | ||
375 | - extern const Arch Arch_sparc; | ||
376 | - | ||
377 | - /** \relates Arch */ | ||
378 | - extern const Arch Arch_armv7l; | ||
379 | - /** \relates Arch */ | ||
380 | - extern const Arch Arch_armv6l; | ||
381 | - /** \relates Arch */ | ||
382 | - extern const Arch Arch_armv5tejl; | ||
383 | - /** \relates Arch */ | ||
384 | - extern const Arch Arch_armv5tel; | ||
385 | - /** \relates Arch */ | ||
386 | - extern const Arch Arch_armv5l; | ||
387 | - /** \relates Arch */ | ||
388 | - extern const Arch Arch_armv4tl; | ||
389 | - /** \relates Arch */ | ||
390 | - extern const Arch Arch_armv4l; | ||
391 | - /** \relates Arch */ | ||
392 | - extern const Arch Arch_armv3l; | ||
393 | - | ||
394 | - /** \relates Arch */ | ||
395 | - extern const Arch Arch_sh3; | ||
396 | - | ||
397 | - /** \relates Arch */ | ||
398 | - extern const Arch Arch_sh4; | ||
399 | - /** \relates Arch */ | ||
400 | - extern const Arch Arch_sh4a; | ||
401 | +#define OE_EXTERN_PROTO 1 | ||
402 | +#include "oe-arch.h" | ||
403 | +#undef OE_EXTERN_PROTO | ||
404 | //@} | ||
405 | |||
406 | /////////////////////////////////////////////////////////////////// | ||
407 | diff -ur git.orig/zypp/CMakeLists.txt git/zypp/CMakeLists.txt | ||
408 | --- git.orig/zypp/CMakeLists.txt | ||
409 | +++ git/zypp/CMakeLists.txt | ||
410 | @@ -90,6 +90,7 @@ SET( zypp_EARLY_SRCS | ||
411 | |||
412 | SET( zypp_HEADERS | ||
413 | Arch.h | ||
414 | + oe-arch.h | ||
415 | AutoDispose.h | ||
416 | Bit.h | ||
417 | ByteCount.h | ||
418 | diff -ur git.orig/zypp/ZConfig.cc git/zypp/ZConfig.cc | ||
419 | --- git.orig/zypp/ZConfig.cc 2011-03-28 14:24:37.178989632 -0500 | ||
420 | +++ git/zypp/ZConfig.cc 2011-03-28 14:25:04.973971936 -0500 | ||
421 | @@ -48,77 +48,9 @@ | ||
422 | */ | ||
423 | Arch _autodetectSystemArchitecture() | ||
424 | { | ||
425 | - struct ::utsname buf; | ||
426 | - if ( ::uname( &buf ) < 0 ) | ||
427 | - { | ||
428 | - ERR << "Can't determine system architecture" << endl; | ||
429 | - return Arch_noarch; | ||
430 | - } | ||
431 | - | ||
432 | - Arch architecture( buf.machine ); | ||
433 | - MIL << "Uname architecture is '" << buf.machine << "'" << endl; | ||
434 | + /* Define the default architecture, ignore uname! */ | ||
435 | + Arch architecture( Arch_machine ); | ||
436 | |||
437 | - if ( architecture == Arch_i686 ) | ||
438 | - { | ||
439 | - // some CPUs report i686 but dont implement cx8 and cmov | ||
440 | - // check for both flags in /proc/cpuinfo and downgrade | ||
441 | - // to i586 if either is missing (cf bug #18885) | ||
442 | - std::ifstream cpuinfo( "/proc/cpuinfo" ); | ||
443 | - if ( cpuinfo ) | ||
444 | - { | ||
445 | - for( iostr::EachLine in( cpuinfo ); in; in.next() ) | ||
446 | - { | ||
447 | - if ( str::hasPrefix( *in, "flags" ) ) | ||
448 | - { | ||
449 | - if ( in->find( "cx8" ) == std::string::npos | ||
450 | - || in->find( "cmov" ) == std::string::npos ) | ||
451 | - { | ||
452 | - architecture = Arch_i586; | ||
453 | - WAR << "CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture << "'" << endl; | ||
454 | - } | ||
455 | - break; | ||
456 | - } | ||
457 | - } | ||
458 | - } | ||
459 | - else | ||
460 | - { | ||
461 | - ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl; | ||
462 | - } | ||
463 | - } | ||
464 | - else if ( architecture == Arch_sparc || architecture == Arch_sparc64 ) | ||
465 | - { | ||
466 | - // Check for sun4[vum] to get the real arch. (bug #566291) | ||
467 | - std::ifstream cpuinfo( "/proc/cpuinfo" ); | ||
468 | - if ( cpuinfo ) | ||
469 | - { | ||
470 | - for( iostr::EachLine in( cpuinfo ); in; in.next() ) | ||
471 | - { | ||
472 | - if ( str::hasPrefix( *in, "type" ) ) | ||
473 | - { | ||
474 | - if ( in->find( "sun4v" ) != std::string::npos ) | ||
475 | - { | ||
476 | - architecture = ( architecture == Arch_sparc64 ? Arch_sparc64v : Arch_sparcv9v ); | ||
477 | - WAR << "CPU has 'sun4v': architecture upgraded to '" << architecture << "'" << endl; | ||
478 | - } | ||
479 | - else if ( in->find( "sun4u" ) != std::string::npos ) | ||
480 | - { | ||
481 | - architecture = ( architecture == Arch_sparc64 ? Arch_sparc64 : Arch_sparcv9 ); | ||
482 | - WAR << "CPU has 'sun4u': architecture upgraded to '" << architecture << "'" << endl; | ||
483 | - } | ||
484 | - else if ( in->find( "sun4m" ) != std::string::npos ) | ||
485 | - { | ||
486 | - architecture = Arch_sparcv8; | ||
487 | - WAR << "CPU has 'sun4m': architecture upgraded to '" << architecture << "'" << endl; | ||
488 | - } | ||
489 | - break; | ||
490 | - } | ||
491 | - } | ||
492 | - } | ||
493 | - else | ||
494 | - { | ||
495 | - ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl; | ||
496 | - } | ||
497 | - } | ||
498 | return architecture; | ||
499 | } | ||
500 | |||