[oe-commits] Mark Hatle : Update python dependencies to be simply to "python"

git version control git at git.openembedded.org
Wed Sep 21 12:43:24 UTC 2011


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

Author: Mark Hatle <mark.hatle at windriver.com>
Date:   Mon Sep 19 10:11:11 2011 -0500

Update python dependencies to be simply to "python"

Previously python dependencies were of the format "python(abi) = ..."
This format is not yet supportable within OE, so revert to a form
we know we can handle.

Introduce a change to package.bbclass that ensures it will causes the
sstate-cache's "package" to invalidate.  Since pythondeps changed, the
output of rpmdeps changes, which causes the per-file dependency
information to change.... thus we need to invalidate the cache!

Signed-off-by: Mark Hatle <mark.hatle at windriver.com>

---

 meta/classes/package.bbclass                |    6 ++++++
 meta/recipes-devtools/rpm/rpm/pythondeps.sh |   16 ++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.0.bb      |    4 +++-
 3 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 3f5c904..a9c510d 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1652,6 +1652,12 @@ PACKAGEFUNCS ?= "package_get_auto_pr \
 		emit_pkgdata"
 
 python do_package () {
+        # Change the following version to cause sstate to invalidate the package
+        # cache.  This is useful if an item this class depends on changes in a
+        # way that the output of this class changes.  rpmdeps is a good example
+        # as any change to rpmdeps requires this to be rerun.
+        # PACKAGE_BBCLASS_VERSION = "1"
+
 	packages = (bb.data.getVar('PACKAGES', d, True) or "").split()
 	if len(packages) < 1:
 		bb.debug(1, "No packages to build, skipping do_package")
diff --git a/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
new file mode 100755
index 0000000..083b174
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+case $1 in
+-R|--requires)
+    shift
+    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+    exit 0
+    ;;
+esac
+
+exit 0
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb
index b805f7d..a7b360d 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb
@@ -45,7 +45,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}"
 extrarpmdeps = "python perl"
 extrarpmdeps_virtclass-native = ""
-PR = "r20"
+PR = "r21"
 
 # rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
 # in order to extract the distribution SRPM into a format we can extract...
@@ -63,6 +63,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;ex
 	   file://rpm-fileclass.patch \
 	   file://rpm-canonarch.patch \
 	   file://rpm-no-loopmsg.patch \
+	   file://pythondeps.sh \
 	  "
 
 #	   file://rpm-autoconf.patch \
@@ -352,6 +353,7 @@ do_install_append() {
 	# Enable Debian style arbitrary tags...
 	sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
 
+	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
 	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
 
 	# Remove unpackaged files (based on list in rpm.spec)





More information about the Openembedded-commits mailing list