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