[oe-commits] Robert Yang : package_rpm.bbclass: fix the arch (replace "-" with "_")

git at git.openembedded.org git at git.openembedded.org
Mon Sep 10 12:08:21 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: fc985f511da86400e4fa7d17555216c12eb51666
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=fc985f511da86400e4fa7d17555216c12eb51666

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Mon Sep 10 15:58:52 2012 +0800

package_rpm.bbclass: fix the arch (replace "-" with "_")

rpm can't use the "-" as the arch, which causes problem, e.g., when
MACHINE = "beagleboard":

* The arch should be armv7a-vfp-neon, but rpm only takes the armv7a,
  this is incorrect since it is mixed with real arch armv7a.

* The nativesdk's arch should be i686-nativesdk (or x86_64-nativesdk),
  but rpm only takes the i686 (or x86_64), this in incorrect since it is
  mixed with the arch i686 (or x86_64).

Replace "-" with "_" when rpm package and the rootfs generation would
fix the problem, I think this is fine since it doesn't change the tune's
arch, the package manager doesn't care about the arch's name, but it
needs a unify arch system to avoid confusing. This is similar to what we
have done on the deb which fixed the arch i486, i586 and so on to i386.

[YOCTO #2328]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package_rpm.bbclass                   |   10 +++++-----
 meta/recipes-extended/sat-solver/sat-solver_git.bb |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 742f292..43cdd57 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -27,12 +27,12 @@ package_update_index_rpm () {
 	fi
 
 	# Update target packages
-	base_archs="${PACKAGE_ARCHS}"
-	ml_archs="${MULTILIB_PACKAGE_ARCHS}"
+	base_archs="`echo ${PACKAGE_ARCHS} | sed 's/-/_/g'`"
+	ml_archs="`echo ${MULTILIB_PACKAGE_ARCHS} | sed 's/-/_/g'`"
 	package_update_index_rpm_common "${RPMCONF_TARGET_BASE}" base_archs ml_archs
 
 	# Update SDK packages
-	base_archs="${SDK_PACKAGE_ARCHS}"
+	base_archs="`echo ${SDK_PACKAGE_ARCHS} | sed 's/-/_/g'`"
 	package_update_index_rpm_common "${RPMCONF_HOST_BASE}" base_archs
 }
 
@@ -1113,8 +1113,8 @@ python do_package_rpm () {
     rpmbuild = d.getVar('RPMBUILD', True)
     targetsys = d.getVar('TARGET_SYS', True)
     targetvendor = d.getVar('TARGET_VENDOR', True)
-    package_arch = d.getVar('PACKAGE_ARCH', True) or ""
-    if package_arch not in "all any noarch".split() and not package_arch.endswith("-nativesdk"):
+    package_arch = (d.getVar('PACKAGE_ARCH', True) or "").replace("-", "_")
+    if package_arch not in "all any noarch".split() and not package_arch.endswith("_nativesdk"):
         ml_prefix = (d.getVar('MLPREFIX', True) or "").replace("-", "_")
         d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch)
     else:
diff --git a/meta/recipes-extended/sat-solver/sat-solver_git.bb b/meta/recipes-extended/sat-solver/sat-solver_git.bb
index e1054e9..67503b7 100644
--- a/meta/recipes-extended/sat-solver/sat-solver_git.bb
+++ b/meta/recipes-extended/sat-solver/sat-solver_git.bb
@@ -47,7 +47,7 @@ do_archgen () {
 			all | any | noarch)
 				continue;;
 		esac
-		INSTALL_PLATFORM_ARCHS="$each_arch $INSTALL_PLATFORM_ARCHS"
+		INSTALL_PLATFORM_ARCHS="`echo $each_arch | sed 's/-/_/g'` $INSTALL_PLATFORM_ARCHS"
 	done
 
 	echo "/* Automatically generated by the sat-solver recipe */" > src/core-arch.h





More information about the Openembedded-commits mailing list