summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-03-28 22:07:02 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-31 22:02:46 +0100
commit41efbe13cb2f8b4b78c6049446cd14f9b086520d (patch)
tree506dcc9fcfa94fbd38eb0eadafb213e249d1f60d
parent133f7e8cdd5a2b8f205ae1c2128f2e4fb6eb2cf4 (diff)
downloadpoky-41efbe13cb2f8b4b78c6049446cd14f9b086520d.tar.gz
Fix integration of zypper and sat-solver
Adjust the integration of zypper and sat-solver to ensure that all of the defined architectures for a given machine are defined identically to Poky. (From OE-Core rev: b2996efc015bc5ae0b8246924083e76fb5129cea) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/libzypp/libzypp/archconf.patch15
-rw-r--r--meta/recipes-extended/libzypp/libzypp/builtin-arch.patch122
-rw-r--r--meta/recipes-extended/libzypp/libzypp/libzypp-pokyarch.patch498
-rw-r--r--meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch128
-rw-r--r--meta/recipes-extended/libzypp/libzypp_git.bb97
-rw-r--r--meta/recipes-extended/sat-solver/sat-solver/builtin-arch.patch28
-rw-r--r--meta/recipes-extended/sat-solver/sat-solver/no-builtin-arch.patch29
-rw-r--r--meta/recipes-extended/sat-solver/sat-solver/sat-solver_poky.patch106
-rw-r--r--meta/recipes-extended/sat-solver/sat-solver_git.bb42
9 files changed, 706 insertions, 359 deletions
diff --git a/meta/recipes-extended/libzypp/libzypp/archconf.patch b/meta/recipes-extended/libzypp/libzypp/archconf.patch
deleted file mode 100644
index 44ebe33592..0000000000
--- a/meta/recipes-extended/libzypp/libzypp/archconf.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1diff --git a/zypp.conf b/zypp.conf
2index 1e84a3f..7a26548 100644
3--- a/zypp.conf
4+++ b/zypp.conf
5@@ -17,7 +17,10 @@
6 ## ** Changing this needs a full refresh (incl. download)
7 ## ** of all repository data.
8 ##
9+## ** CAUTION: Don't change this value on yocto !
10+##
11 # arch = s390
12+arch = @MACHINE_ARCH@
13
14
15 ##
diff --git a/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch b/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch
deleted file mode 100644
index 53dcfac652..0000000000
--- a/meta/recipes-extended/libzypp/libzypp/builtin-arch.patch
+++ /dev/null
@@ -1,122 +0,0 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2libzypp available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} already
4recognized in libzypp.
5
6Also "all" is added as a synonym for noarch.
7
8Signed-off-by: Qing He <qing.he@intel.com>
9
10diff --git a/zypp/Arch.cc b/zypp/Arch.cc
11index 7b357bb..d9102cc 100644
12--- a/zypp/Arch.cc
13+++ b/zypp/Arch.cc
14@@ -122,7 +122,13 @@ namespace zypp
15
16 /** \relates Arch::CompatEntry */
17 inline bool operator==( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
18- { return lhs._idStr == rhs._idStr; }
19+ {
20+ if ( (lhs._idStr == "all" && rhs._idStr == "noarch") ||
21+ (lhs._idStr == "noarch" && rhs._idStr == "all") )
22+ return true;
23+ else
24+ return lhs._idStr == rhs._idStr;
25+ }
26 /** \relates Arch::CompatEntry */
27 inline bool operator!=( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
28 { return ! ( lhs == rhs ); }
29@@ -153,7 +159,7 @@ namespace zypp
30 // bit for each architecture.
31 //
32 #define DEF_BUILTIN(A) const IdString _##A( #A );
33- DEF_BUILTIN( noarch );
34+ const IdString _noarch( "all" );
35
36 DEF_BUILTIN( i386 );
37 DEF_BUILTIN( i486 );
38@@ -202,6 +208,8 @@ namespace zypp
39
40 DEF_BUILTIN( sh4 );
41 DEF_BUILTIN( sh4a );
42+
43+ const IdString _machine( "@MACHINE_ARCH@" );
44 #undef DEF_BUILTIN
45
46 ///////////////////////////////////////////////////////////////////
47@@ -326,12 +334,14 @@ namespace zypp
48 //
49 defCompatibleWith( _sh4, _noarch );
50 defCompatibleWith( _sh4a, _noarch,_sh4 );
51+
52+ defCompatibleWith( _machine, @PKG_ARCH_TAIL@,_@PKG_ARCH@ );
53 //
54 ///////////////////////////////////////////////////////////////////
55 // dumpOn( USR ) << endl;
56 }
57
58- private:
59+ public:
60 /** Return the next avialable _idBit.
61 * Ctor injects _noarch into the _compatSet, 1 is for
62 * nonbuiltin archs, so we can use <tt>size</tt> for
63@@ -440,6 +450,8 @@ namespace zypp
64 const Arch Arch_sh4( _sh4 );
65 const Arch Arch_sh4a( _sh4a );
66
67+ const Arch Arch_machine( _machine );
68+
69 ///////////////////////////////////////////////////////////////////
70 //
71 // METHOD NAME : Arch::Arch
72diff --git a/zypp/Arch.h b/zypp/Arch.h
73index 6b18a6e..092211c 100644
74--- a/zypp/Arch.h
75+++ b/zypp/Arch.h
76@@ -249,6 +249,8 @@ namespace zypp
77 extern const Arch Arch_sh4;
78 /** \relates Arch */
79 extern const Arch Arch_sh4a;
80+
81+ extern const Arch Arch_machine;
82 //@}
83
84 ///////////////////////////////////////////////////////////////////
85diff --git a/zypp/parser/yum/schema/common-inc.rnc b/zypp/parser/yum/schema/common-inc.rnc
86index f12ac3b..24ce06e 100644
87--- a/zypp/parser/yum/schema/common-inc.rnc
88+++ b/zypp/parser/yum/schema/common-inc.rnc
89@@ -26,6 +26,7 @@ private.evr =
90 private.localizedtext = attribute lang { "en" | "de" }, text
91
92 private.archenum = "noarch"
93+ | "all"
94 | "armv4l"
95 | "armv5el"
96 | "armv5tel"
97@@ -46,4 +47,5 @@ private.archenum = "noarch"
98 | "sh4"
99 | "x86_64"
100 | "src"
101+ | "@MACHINE_ARCH@"
102
103diff --git a/zypp/parser/yum/schema/common-inc.rng b/zypp/parser/yum/schema/common-inc.rng
104index 60e5742..8a9ce2e 100644
105--- a/zypp/parser/yum/schema/common-inc.rng
106+++ b/zypp/parser/yum/schema/common-inc.rng
107@@ -89,6 +89,7 @@
108 <define name="private.archenum">
109 <choice>
110 <value>noarch</value>
111+ <value>all</value>
112 <value>armv4l</value>
113 <value>armv5el</value>
114 <value>armv5tel</value>
115@@ -109,6 +110,7 @@
116 <value>sh4</value>
117 <value>x86_64</value>
118 <value>src</value>
119+ <value>@MACHINE_ARCH@</value>
120 </choice>
121 </define>
122 </grammar>
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 @@
1Disable all of the internal architectures
2
3We disable all of the internal architectures and replace them with ones
4generated by the libzypp recipe as specified in the poky-arch.h.
5
6Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
7
8diff -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") );
29diff -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
41diff -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 }
53diff -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+}
81diff -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 }
93diff -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 ) );
307diff -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 ///////////////////////////////////////////////////////////////////
405diff -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
416diff -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
diff --git a/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch b/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch
deleted file mode 100644
index 22dd89c45f..0000000000
--- a/meta/recipes-extended/libzypp/libzypp/no-builtin-arch.patch
+++ /dev/null
@@ -1,128 +0,0 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2libzypp available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} not
4recognized in libzypp.
5
6Also "all" is added as a synonym for noarch.
7
8Signed-off-by: Qing He <qing.he@intel.com>
9
10diff --git a/zypp/Arch.cc b/zypp/Arch.cc
11index 7b357bb..d4cbca6 100644
12--- a/zypp/Arch.cc
13+++ b/zypp/Arch.cc
14@@ -122,7 +122,13 @@ namespace zypp
15
16 /** \relates Arch::CompatEntry */
17 inline bool operator==( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
18- { return lhs._idStr == rhs._idStr; }
19+ {
20+ if ( (lhs._idStr == "all" && rhs._idStr == "noarch") ||
21+ (lhs._idStr == "noarch" && rhs._idStr == "all") )
22+ return true;
23+ else
24+ return lhs._idStr == rhs._idStr;
25+ }
26 /** \relates Arch::CompatEntry */
27 inline bool operator!=( const Arch::CompatEntry & lhs, const Arch::CompatEntry & rhs )
28 { return ! ( lhs == rhs ); }
29@@ -153,7 +159,7 @@ namespace zypp
30 // bit for each architecture.
31 //
32 #define DEF_BUILTIN(A) const IdString _##A( #A );
33- DEF_BUILTIN( noarch );
34+ const IdString _noarch( "all" );
35
36 DEF_BUILTIN( i386 );
37 DEF_BUILTIN( i486 );
38@@ -202,6 +208,9 @@ namespace zypp
39
40 DEF_BUILTIN( sh4 );
41 DEF_BUILTIN( sh4a );
42+
43+ const IdString _package( "@PKG_ARCH@" );
44+ const IdString _machine( "@MACHINE_ARCH@" );
45 #undef DEF_BUILTIN
46
47 ///////////////////////////////////////////////////////////////////
48@@ -326,12 +335,15 @@ namespace zypp
49 //
50 defCompatibleWith( _sh4, _noarch );
51 defCompatibleWith( _sh4a, _noarch,_sh4 );
52+
53+ defCompatibleWith( _package, _noarch );
54+ defCompatibleWith( _machine, _noarch,_package );
55 //
56 ///////////////////////////////////////////////////////////////////
57 // dumpOn( USR ) << endl;
58 }
59
60- private:
61+ public:
62 /** Return the next avialable _idBit.
63 * Ctor injects _noarch into the _compatSet, 1 is for
64 * nonbuiltin archs, so we can use <tt>size</tt> for
65@@ -440,6 +452,9 @@ namespace zypp
66 const Arch Arch_sh4( _sh4 );
67 const Arch Arch_sh4a( _sh4a );
68
69+ const Arch Arch_package( _package );
70+ const Arch Arch_machine( _machine );
71+
72 ///////////////////////////////////////////////////////////////////
73 //
74 // METHOD NAME : Arch::Arch
75diff --git a/zypp/Arch.h b/zypp/Arch.h
76index 6b18a6e..f91a562 100644
77--- a/zypp/Arch.h
78+++ b/zypp/Arch.h
79@@ -249,6 +249,9 @@ namespace zypp
80 extern const Arch Arch_sh4;
81 /** \relates Arch */
82 extern const Arch Arch_sh4a;
83+
84+ extern const Arch Arch_package;
85+ extern const Arch Arch_machine;
86 //@}
87
88 ///////////////////////////////////////////////////////////////////
89diff --git a/zypp/parser/yum/schema/common-inc.rnc b/zypp/parser/yum/schema/common-inc.rnc
90index f12ac3b..04677c3 100644
91--- a/zypp/parser/yum/schema/common-inc.rnc
92+++ b/zypp/parser/yum/schema/common-inc.rnc
93@@ -26,6 +26,7 @@ private.evr =
94 private.localizedtext = attribute lang { "en" | "de" }, text
95
96 private.archenum = "noarch"
97+ | "all"
98 | "armv4l"
99 | "armv5el"
100 | "armv5tel"
101@@ -46,4 +47,6 @@ private.archenum = "noarch"
102 | "sh4"
103 | "x86_64"
104 | "src"
105+ | "@PKG_ARCH@"
106+ | "@MACHINE_ARCH@"
107
108diff --git a/zypp/parser/yum/schema/common-inc.rng b/zypp/parser/yum/schema/common-inc.rng
109index 60e5742..27694aa 100644
110--- a/zypp/parser/yum/schema/common-inc.rng
111+++ b/zypp/parser/yum/schema/common-inc.rng
112@@ -89,6 +89,7 @@
113 <define name="private.archenum">
114 <choice>
115 <value>noarch</value>
116+ <value>all</value>
117 <value>armv4l</value>
118 <value>armv5el</value>
119 <value>armv5tel</value>
120@@ -109,6 +110,8 @@
121 <value>sh4</value>
122 <value>x86_64</value>
123 <value>src</value>
124+ <value>@PKG_ARCH@</value>
125+ <value>@MACHINE_ARCH@</value>
126 </choice>
127 </define>
128 </grammar>
diff --git a/meta/recipes-extended/libzypp/libzypp_git.bb b/meta/recipes-extended/libzypp/libzypp_git.bb
index 621ce45da4..809c1877f5 100644
--- a/meta/recipes-extended/libzypp/libzypp_git.bb
+++ b/meta/recipes-extended/libzypp/libzypp_git.bb
@@ -13,16 +13,14 @@ RDEPENDS_${PN} = "sat-solver"
13 13
14S = "${WORKDIR}/git" 14S = "${WORKDIR}/git"
15PV = "0.0-git${SRCPV}" 15PV = "0.0-git${SRCPV}"
16PR = "r8" 16PR = "r9"
17 17
18SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \ 18SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \
19 file://no-doc.patch \ 19 file://no-doc.patch \
20 file://rpm5.patch \ 20 file://rpm5.patch \
21 file://rpm5-no-rpmdbinit.patch \ 21 file://rpm5-no-rpmdbinit.patch \
22 file://builtin-arch.patch;apply=no \
23 file://no-builtin-arch.patch;apply=no \
24 file://archconf.patch;apply=no \
25 file://config-release.patch \ 22 file://config-release.patch \
23 file://libzypp-pokyarch.patch \
26 " 24 "
27 25
28SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch" 26SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
@@ -34,23 +32,80 @@ EXTRA_OECMAKE += "-DLIB=lib"
34 32
35PACKAGE_ARCH = "${MACHINE_ARCH}" 33PACKAGE_ARCH = "${MACHINE_ARCH}"
36 34
37do_archpatch () { 35do_archgen () {
38 PKG_ARCH_TAIL=`sed -n ${S}/zypp/Arch.cc -e "s|^.*defCompatibleWith( _${BASE_PACKAGE_ARCH},[ \t]*\(.*\) .*$|\1|p"` 36 # We need to dynamically generate our arch file based on the machine
39 if [ "x${PKG_ARCH_TAIL}" == x ]; then 37 # configuration
40 PATCHFILE=${WORKDIR}/no-builtin-arch.patch 38 echo "/* Automatically generated by the libzypp recipes */" > zypp/poky-arch.h
41 else 39 echo "" >> zypp/poky-arch.h
42 PATCHFILE=${WORKDIR}/builtin-arch.patch 40 echo "#ifndef POKY_ARCH_H" >> zypp/poky-arch.h
43 fi 41 echo "#define POKY_ARCH_H 1" >> zypp/poky-arch.h
42 echo "#define Arch_machine Arch_${MACHINE_ARCH}" >> zypp/poky-arch.h
43 echo "#endif /* POKY_ARCH_H */" >> zypp/poky-arch.h
44 echo "" >> zypp/poky-arch.h
45 echo "#ifdef DEF_BUILTIN" >> zypp/poky-arch.h
46 echo "/* Specify builtin types */" >> zypp/poky-arch.h
47 for each_arch in ${PACKAGE_ARCHS} ; do
48 case "$each_arch" in
49 all | any | noarch)
50 continue;;
51 esac
52 echo " DEF_BUILTIN( ${each_arch} );" >> zypp/poky-arch.h
53 done
54 echo "#endif /* DEF_BUILTIN */" >> zypp/poky-arch.h
55 echo "" >> zypp/poky-arch.h
56 echo "#ifdef POKY_EXTERN_PROTO" >> zypp/poky-arch.h
57 echo "/* Specify extern prototypes */" >> zypp/poky-arch.h
58 for each_arch in ${PACKAGE_ARCHS} ; do
59 case "$each_arch" in
60 all | any | noarch)
61 continue;;
62 esac
63 echo " extern const Arch Arch_${each_arch};" >> zypp/poky-arch.h
64 done
65 echo "#endif /* POKY_EXTERN_PROTO */" >> zypp/poky-arch.h
66 echo "" >> zypp/poky-arch.h
67 echo "#ifdef POKY_PROTO" >> zypp/poky-arch.h
68 echo "/* Specify prototypes */" >> zypp/poky-arch.h
69 for each_arch in ${PACKAGE_ARCHS} ; do
70 case "$each_arch" in
71 all | any | noarch)
72 continue;;
73 esac
74 echo " const Arch Arch_${each_arch} (_${each_arch});" >> zypp/poky-arch.h
75 done
76 echo "#endif /* POKY_PROTO */" >> zypp/poky-arch.h
77 echo "" >> zypp/poky-arch.h
78 echo "#ifdef POKY_DEF_COMPAT" >> zypp/poky-arch.h
79 echo "/* Specify compatibility information */" >> zypp/poky-arch.h
80 INSTALL_PLATFORM_ARCHS=""
81 for each_arch in ${PACKAGE_ARCHS} ; do
82 INSTALL_PLATFORM_ARCHS="$each_arch $INSTALL_PLATFORM_ARCHS"
83 done
44 84
45 sed -i "${PATCHFILE}" \ 85 COMPAT_WITH=""
46 -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g" \ 86 set -- ${INSTALL_PLATFORM_ARCHS}
47 -e "s|@PKG_ARCH@|${BASE_PACKAGE_ARCH}|g" \ 87 while [ $# -gt 0 ]; do
48 -e "s|@PKG_ARCH_TAIL@|${PKG_ARCH_TAIL}|g" 88 case "$1" in
49 89 all | any | noarch)
50 patch -p1 -i "${PATCHFILE}" 90 shift ; continue;;
51 91 esac
52 sed -i ${WORKDIR}/archconf.patch -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g" 92 ARCH=_"$1"
53 patch -p1 -i ${WORKDIR}/archconf.patch 93 shift
94 COMPAT=""
95 for each_arch in "$@"; do
96 if [ -z "$COMPAT" ]; then
97 COMPAT=_"$each_arch"
98 else
99 COMPAT=_"$each_arch,$COMPAT"
100 fi
101 done
102 COMPAT_WITH="${ARCH},${COMPAT} $COMPAT_WITH"
103 done
104 for each_compat in ${COMPAT_WITH} ; do
105 echo " defCompatibleWith( ${each_compat} );" >> zypp/poky-arch.h
106 done
107 echo "#endif /* DEF_COMPAT */" >> zypp/poky-arch.h
108 echo "" >> zypp/poky-arch.h
54} 109}
55 110
56addtask archpatch before do_patch after do_unpack 111addtask archgen before do_configure after do_patch
diff --git a/meta/recipes-extended/sat-solver/sat-solver/builtin-arch.patch b/meta/recipes-extended/sat-solver/sat-solver/builtin-arch.patch
deleted file mode 100644
index c228c36e49..0000000000
--- a/meta/recipes-extended/sat-solver/sat-solver/builtin-arch.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2sat-solver available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} already
4recognized in sat-sovler.
5
6Signed-off-by: Qing He <qing.he@intel.com>
7
8diff --git a/src/poolarch.c b/src/poolarch.c
9index 34a14a3..660959b 100644
10--- a/src/poolarch.c
11+++ b/src/poolarch.c
12@@ -21,6 +21,7 @@
13 #include "util.h"
14
15 const char *archpolicies[] = {
16+ "@MACHINE_ARCH@", "@MACHINE_ARCH@:@PKG_ARCH_TAIL@",
17 "x86_64", "x86_64:i686:i586:i486:i386",
18 "i686", "i686:i586:i486:i386",
19 "i586", "i586:i486:i386",
20@@ -72,7 +74,7 @@ pool_setarch(Pool *pool, const char *arch)
21 return;
22 }
23 #ifndef DEBIAN_SEMANTICS
24- id = ARCH_NOARCH;
25+ id = ARCH_ALL;
26 #else
27 id = ARCH_ALL;
28 #endif
diff --git a/meta/recipes-extended/sat-solver/sat-solver/no-builtin-arch.patch b/meta/recipes-extended/sat-solver/sat-solver/no-builtin-arch.patch
deleted file mode 100644
index 225fbfe159..0000000000
--- a/meta/recipes-extended/sat-solver/sat-solver/no-builtin-arch.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to
2sat-solver available archs, see do_archpatch in .bb for more
3details, this is the version for ${BASE_PACKAGE_ARCH} not
4recognized in sat-sovler.
5
6Signed-off-by: Qing He <qing.he@intel.com>
7
8diff --git a/src/poolarch.c b/src/poolarch.c
9index 34a14a3..36367ba 100644
10--- a/src/poolarch.c
11+++ b/src/poolarch.c
12@@ -21,6 +21,8 @@
13 #include "util.h"
14
15 const char *archpolicies[] = {
16+ "@MACHINE_ARCH@", "@MACHINE_ARCH@:@PKG_ARCH@",
17+ "@PKG_ARCH@", "@PKG_ARCH@",
18 "x86_64", "x86_64:i686:i586:i486:i386",
19 "i686", "i686:i586:i486:i386",
20 "i586", "i586:i486:i386",
21@@ -72,7 +74,7 @@ pool_setarch(Pool *pool, const char *arch)
22 return;
23 }
24 #ifndef DEBIAN_SEMANTICS
25- id = ARCH_NOARCH;
26+ id = ARCH_ALL;
27 #else
28 id = ARCH_ALL;
29 #endif
diff --git a/meta/recipes-extended/sat-solver/sat-solver/sat-solver_poky.patch b/meta/recipes-extended/sat-solver/sat-solver/sat-solver_poky.patch
new file mode 100644
index 0000000000..b762bac854
--- /dev/null
+++ b/meta/recipes-extended/sat-solver/sat-solver/sat-solver_poky.patch
@@ -0,0 +1,106 @@
1Fix "arch" integration with Poky.
2
3Add a missing "any" architecture type and update the semantics to use it.
4
5Disable the built-in archpolicies structure, and replace it with one
6we generate in the recipe.
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10diff --git a/src/knownid.h b/src/knownid.h
11index 7757ae0..4b8bee7 100644
12--- a/src/knownid.h
13+++ b/src/knownid.h
14@@ -57,6 +57,7 @@ KNOWNID(SYSTEM_SYSTEM, "system:system"),
15 KNOWNID(ARCH_SRC, "src"),
16 KNOWNID(ARCH_NOSRC, "nosrc"),
17 KNOWNID(ARCH_NOARCH, "noarch"),
18+KNOWNID(ARCH_ANY, "any"),
19 KNOWNID(ARCH_ALL, "all"),
20
21 KNOWNID(REPOSITORY_SOLVABLES, "repository:solvables"),
22diff --git a/src/policy.c b/src/policy.c
23index 55c8677..3356ff8 100644
24--- a/src/policy.c
25+++ b/src/policy.c
26@@ -486,6 +486,13 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2)
27 }
28
29 /* we allow changes to/from noarch */
30+#ifdef POKY_SEMANTICS
31+ if (a1 == a2 ||
32+ a1 == ARCH_NOARCH || a2 == ARCH_NOARCH ||
33+ a1 == ARCH_ANY || a2 == ARCH_ANY ||
34+ a1 == ARCH_ALL || a2 == ARCH_ALL)
35+ return 0;
36+#else
37 #ifndef DEBIAN_SEMANTICS
38 if (a1 == a2 || a1 == ARCH_NOARCH || a2 == ARCH_NOARCH)
39 return 0;
40@@ -493,6 +500,7 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2)
41 if (a1 == a2 || a1 == ARCH_ALL || a2 == ARCH_ALL)
42 return 0;
43 #endif
44+#endif
45 if (!pool->id2arch)
46 return 0;
47 a1 = a1 <= pool->lastarch ? pool->id2arch[a1] : 0;
48diff --git a/src/poolarch.c b/src/poolarch.c
49index 34a14a3..2d7cd70 100644
50--- a/src/poolarch.c
51+++ b/src/poolarch.c
52@@ -20,38 +20,8 @@
53 #include "poolarch.h"
54 #include "util.h"
55
56-const char *archpolicies[] = {
57- "x86_64", "x86_64:i686:i586:i486:i386",
58- "i686", "i686:i586:i486:i386",
59- "i586", "i586:i486:i386",
60- "i486", "i486:i386",
61- "i386", "i386",
62- "s390x", "s390x:s390",
63- "s390", "s390",
64- "ia64", "ia64:i686:i586:i486:i386",
65- "ppc64", "ppc64:ppc",
66- "ppc", "ppc",
67- "armv7nhl", "armv7nhl:armv7hl",
68- "armv7hl", "armv7hl",
69- "armv7l", "armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
70- "armv6l", "armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
71- "armv5tejl", "armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
72- "armv5tel", "armv5tel:armv5l:armv4tl:armv4l:armv3l",
73- "armv5l", "armv5l:armv4tl:armv4l:armv3l",
74- "armv4tl", "armv4tl:armv4l:armv3l",
75- "armv4l", "armv4l:armv3l",
76- "armv3l", "armv3l",
77- "sh3", "sh3",
78- "sh4", "sh4",
79- "sh4a", "sh4a:sh4",
80- "sparc64v", "sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc",
81- "sparc64", "sparc64:sparcv9:sparcv8:sparc",
82- "sparcv9v", "sparcv9v:sparcv9:sparcv8:sparc",
83- "sparcv9", "sparcv9:sparcv8:sparc",
84- "sparcv8", "sparcv8:sparc",
85- "sparc", "sparc",
86- 0
87-};
88+/* Provide the const char *archpolicies structure */
89+#include "poky-arch.h"
90
91 void
92 pool_setarch(Pool *pool, const char *arch)
93@@ -71,10 +41,10 @@ pool_setarch(Pool *pool, const char *arch)
94 pool->lastarch = 0;
95 return;
96 }
97-#ifndef DEBIAN_SEMANTICS
98- id = ARCH_NOARCH;
99-#else
100+#if defined(DEBIAN_SEMANTICS) || defined(POKY_SEMANTICS)
101 id = ARCH_ALL;
102+#else
103+ id = ARCH_NOARCH;
104 #endif
105 lastarch = id + 255;
106 id2arch = sat_calloc(lastarch + 1, sizeof(Id));
diff --git a/meta/recipes-extended/sat-solver/sat-solver_git.bb b/meta/recipes-extended/sat-solver/sat-solver_git.bb
index 33bf9392e2..a6937763cb 100644
--- a/meta/recipes-extended/sat-solver/sat-solver_git.bb
+++ b/meta/recipes-extended/sat-solver/sat-solver_git.bb
@@ -7,15 +7,14 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
7DEPENDS = "libcheck rpm zlib expat db" 7DEPENDS = "libcheck rpm zlib expat db"
8 8
9PV = "0.0-git${SRCPV}" 9PV = "0.0-git${SRCPV}"
10PR = "r7" 10PR = "r8"
11 11
12SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \ 12SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \
13 file://sat-solver_rpm5.patch \ 13 file://sat-solver_rpm5.patch \
14 file://sat-solver_obsolete.patch \ 14 file://sat-solver_obsolete.patch \
15 file://cmake.patch \ 15 file://cmake.patch \
16 file://db5.patch \ 16 file://db5.patch \
17 file://builtin-arch.patch;apply=no \ 17 file://sat-solver_poky.patch \
18 file://no-builtin-arch.patch;apply=no \
19 " 18 "
20 19
21S = "${WORKDIR}/git" 20S = "${WORKDIR}/git"
@@ -26,20 +25,31 @@ inherit cmake pkgconfig
26 25
27PACKAGE_ARCH = "${MACHINE_ARCH}" 26PACKAGE_ARCH = "${MACHINE_ARCH}"
28 27
29do_archpatch () { 28do_archgen () {
30 PKG_ARCH_TAIL=`sed -n ${S}/src/poolarch.c -e "s|^ \"\(${BASE_PACKAGE_ARCH}\)\",.*\"\(.*\)\",.*$|\2|p"` 29 # We need to dynamically generate our arch file based on the machine
31 if [ "x${PKG_ARCH_TAIL}" == x ]; then 30 # configuration
32 PATCHFILE=${WORKDIR}/no-builtin-arch.patch
33 else
34 PATCHFILE=${WORKDIR}/builtin-arch.patch
35 fi
36 31
37 sed -i "${PATCHFILE}" \ 32 INSTALL_PLATFORM_ARCHS=""
38 -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g" \ 33 for each_arch in ${PACKAGE_ARCHS} ; do
39 -e "s|@PKG_ARCH@|${BASE_PACKAGE_ARCH}|g" \ 34 case "$each_arch" in
40 -e "s|@PKG_ARCH_TAIL@|${PKG_ARCH_TAIL}|g" 35 all | any | noarch)
36 continue;;
37 esac
38 INSTALL_PLATFORM_ARCHS="$each_arch $INSTALL_PLATFORM_ARCHS"
39 done
41 40
42 patch -p1 -i "${PATCHFILE}" 41 echo "/* Automatically generated by the sat-solver recipe */" > src/poky-arch.h
42 echo "const char *archpolicies[] = {" >> src/poky-arch.h
43
44 set -- $INSTALL_PLATFORM_ARCHS
45
46 save_IFS=$IFS
47 IFS=:
48 while [ $# -gt 0 ]; do echo " \"$1\", "\""$*"\", >> src/poky-arch.h ; shift; done
49 IFS=$save_IFS
50
51 echo " 0" >> src/poky-arch.h
52 echo "};" >> src/poky-arch.h
43} 53}
44 54
45addtask archpatch before do_patch after do_unpack 55addtask archgen before do_configure after do_patch