diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2011-03-28 22:07:02 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-31 15:34:07 +0100 |
commit | b2996efc015bc5ae0b8246924083e76fb5129cea (patch) | |
tree | 367c71662a71f075bc4ea9bb84c1cb02dbab7c5e /meta/recipes-extended/sat-solver | |
parent | 7178a540b35a4a5e4a5e0546eb0c2207d2033cdf (diff) | |
download | openembedded-core-b2996efc015bc5ae0b8246924083e76fb5129cea.tar.gz openembedded-core-b2996efc015bc5ae0b8246924083e76fb5129cea.tar.bz2 openembedded-core-b2996efc015bc5ae0b8246924083e76fb5129cea.zip |
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.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/recipes-extended/sat-solver')
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 @@ -This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to -sat-solver available archs, see do_archpatch in .bb for more -details, this is the version for ${BASE_PACKAGE_ARCH} already -recognized in sat-sovler. - -Signed-off-by: Qing He <qing.he@intel.com> - -diff --git a/src/poolarch.c b/src/poolarch.c -index 34a14a3..660959b 100644 ---- a/src/poolarch.c -+++ b/src/poolarch.c -@@ -21,6 +21,7 @@ - #include "util.h" - - const char *archpolicies[] = { -+ "@MACHINE_ARCH@", "@MACHINE_ARCH@:@PKG_ARCH_TAIL@", - "x86_64", "x86_64:i686:i586:i486:i386", - "i686", "i686:i586:i486:i386", - "i586", "i586:i486:i386", -@@ -72,7 +74,7 @@ pool_setarch(Pool *pool, const char *arch) - return; - } - #ifndef DEBIAN_SEMANTICS -- id = ARCH_NOARCH; -+ id = ARCH_ALL; - #else - id = ARCH_ALL; - #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 @@ -This patch adds the ${MACHINE_ARCH} and ${PACKAGE_ARCH} to -sat-solver available archs, see do_archpatch in .bb for more -details, this is the version for ${BASE_PACKAGE_ARCH} not -recognized in sat-sovler. - -Signed-off-by: Qing He <qing.he@intel.com> - -diff --git a/src/poolarch.c b/src/poolarch.c -index 34a14a3..36367ba 100644 ---- a/src/poolarch.c -+++ b/src/poolarch.c -@@ -21,6 +21,8 @@ - #include "util.h" - - const char *archpolicies[] = { -+ "@MACHINE_ARCH@", "@MACHINE_ARCH@:@PKG_ARCH@", -+ "@PKG_ARCH@", "@PKG_ARCH@", - "x86_64", "x86_64:i686:i586:i486:i386", - "i686", "i686:i586:i486:i386", - "i586", "i586:i486:i386", -@@ -72,7 +74,7 @@ pool_setarch(Pool *pool, const char *arch) - return; - } - #ifndef DEBIAN_SEMANTICS -- id = ARCH_NOARCH; -+ id = ARCH_ALL; - #else - id = ARCH_ALL; - #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 @@ +Fix "arch" integration with Poky. + +Add a missing "any" architecture type and update the semantics to use it. + +Disable the built-in archpolicies structure, and replace it with one +we generate in the recipe. + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> + +diff --git a/src/knownid.h b/src/knownid.h +index 7757ae0..4b8bee7 100644 +--- a/src/knownid.h ++++ b/src/knownid.h +@@ -57,6 +57,7 @@ KNOWNID(SYSTEM_SYSTEM, "system:system"), + KNOWNID(ARCH_SRC, "src"), + KNOWNID(ARCH_NOSRC, "nosrc"), + KNOWNID(ARCH_NOARCH, "noarch"), ++KNOWNID(ARCH_ANY, "any"), + KNOWNID(ARCH_ALL, "all"), + + KNOWNID(REPOSITORY_SOLVABLES, "repository:solvables"), +diff --git a/src/policy.c b/src/policy.c +index 55c8677..3356ff8 100644 +--- a/src/policy.c ++++ b/src/policy.c +@@ -486,6 +486,13 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2) + } + + /* we allow changes to/from noarch */ ++#ifdef POKY_SEMANTICS ++ if (a1 == a2 || ++ a1 == ARCH_NOARCH || a2 == ARCH_NOARCH || ++ a1 == ARCH_ANY || a2 == ARCH_ANY || ++ a1 == ARCH_ALL || a2 == ARCH_ALL) ++ return 0; ++#else + #ifndef DEBIAN_SEMANTICS + if (a1 == a2 || a1 == ARCH_NOARCH || a2 == ARCH_NOARCH) + return 0; +@@ -493,6 +500,7 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2) + if (a1 == a2 || a1 == ARCH_ALL || a2 == ARCH_ALL) + return 0; + #endif ++#endif + if (!pool->id2arch) + return 0; + a1 = a1 <= pool->lastarch ? pool->id2arch[a1] : 0; +diff --git a/src/poolarch.c b/src/poolarch.c +index 34a14a3..2d7cd70 100644 +--- a/src/poolarch.c ++++ b/src/poolarch.c +@@ -20,38 +20,8 @@ + #include "poolarch.h" + #include "util.h" + +-const char *archpolicies[] = { +- "x86_64", "x86_64:i686:i586:i486:i386", +- "i686", "i686:i586:i486:i386", +- "i586", "i586:i486:i386", +- "i486", "i486:i386", +- "i386", "i386", +- "s390x", "s390x:s390", +- "s390", "s390", +- "ia64", "ia64:i686:i586:i486:i386", +- "ppc64", "ppc64:ppc", +- "ppc", "ppc", +- "armv7nhl", "armv7nhl:armv7hl", +- "armv7hl", "armv7hl", +- "armv7l", "armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l", +- "armv6l", "armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l", +- "armv5tejl", "armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l", +- "armv5tel", "armv5tel:armv5l:armv4tl:armv4l:armv3l", +- "armv5l", "armv5l:armv4tl:armv4l:armv3l", +- "armv4tl", "armv4tl:armv4l:armv3l", +- "armv4l", "armv4l:armv3l", +- "armv3l", "armv3l", +- "sh3", "sh3", +- "sh4", "sh4", +- "sh4a", "sh4a:sh4", +- "sparc64v", "sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc", +- "sparc64", "sparc64:sparcv9:sparcv8:sparc", +- "sparcv9v", "sparcv9v:sparcv9:sparcv8:sparc", +- "sparcv9", "sparcv9:sparcv8:sparc", +- "sparcv8", "sparcv8:sparc", +- "sparc", "sparc", +- 0 +-}; ++/* Provide the const char *archpolicies structure */ ++#include "poky-arch.h" + + void + pool_setarch(Pool *pool, const char *arch) +@@ -71,10 +41,10 @@ pool_setarch(Pool *pool, const char *arch) + pool->lastarch = 0; + return; + } +-#ifndef DEBIAN_SEMANTICS +- id = ARCH_NOARCH; +-#else ++#if defined(DEBIAN_SEMANTICS) || defined(POKY_SEMANTICS) + id = ARCH_ALL; ++#else ++ id = ARCH_NOARCH; + #endif + lastarch = id + 255; + 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" DEPENDS = "libcheck rpm zlib expat db" PV = "0.0-git${SRCPV}" -PR = "r7" +PR = "r8" SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \ file://sat-solver_rpm5.patch \ file://sat-solver_obsolete.patch \ file://cmake.patch \ file://db5.patch \ - file://builtin-arch.patch;apply=no \ - file://no-builtin-arch.patch;apply=no \ + file://sat-solver_poky.patch \ " S = "${WORKDIR}/git" @@ -26,20 +25,31 @@ inherit cmake pkgconfig PACKAGE_ARCH = "${MACHINE_ARCH}" -do_archpatch () { - PKG_ARCH_TAIL=`sed -n ${S}/src/poolarch.c -e "s|^ \"\(${BASE_PACKAGE_ARCH}\)\",.*\"\(.*\)\",.*$|\2|p"` - if [ "x${PKG_ARCH_TAIL}" == x ]; then - PATCHFILE=${WORKDIR}/no-builtin-arch.patch - else - PATCHFILE=${WORKDIR}/builtin-arch.patch - fi +do_archgen () { + # We need to dynamically generate our arch file based on the machine + # configuration - sed -i "${PATCHFILE}" \ - -e "s|@MACHINE_ARCH@|${MACHINE_ARCH}|g" \ - -e "s|@PKG_ARCH@|${BASE_PACKAGE_ARCH}|g" \ - -e "s|@PKG_ARCH_TAIL@|${PKG_ARCH_TAIL}|g" + INSTALL_PLATFORM_ARCHS="" + for each_arch in ${PACKAGE_ARCHS} ; do + case "$each_arch" in + all | any | noarch) + continue;; + esac + INSTALL_PLATFORM_ARCHS="$each_arch $INSTALL_PLATFORM_ARCHS" + done - patch -p1 -i "${PATCHFILE}" + echo "/* Automatically generated by the sat-solver recipe */" > src/poky-arch.h + echo "const char *archpolicies[] = {" >> src/poky-arch.h + + set -- $INSTALL_PLATFORM_ARCHS + + save_IFS=$IFS + IFS=: + while [ $# -gt 0 ]; do echo " \"$1\", "\""$*"\", >> src/poky-arch.h ; shift; done + IFS=$save_IFS + + echo " 0" >> src/poky-arch.h + echo "};" >> src/poky-arch.h } -addtask archpatch before do_patch after do_unpack +addtask archgen before do_configure after do_patch |