summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sat-solver
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 /meta/recipes-extended/sat-solver
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>
Diffstat (limited to 'meta/recipes-extended/sat-solver')
-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
4 files changed, 132 insertions, 73 deletions
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