From 8a34fa39ff4d3498c057c35f5773d764816c51e4 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Mon, 17 Dec 2012 16:21:20 +0100 Subject: [PATCH] moving the easyinstall routine into the distutils class --- meta/classes/distutils.bbclass | 10 ++++++++++ meta/recipes-devtools/python/python-rospkg_1.0.15.bb | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass index f67297e..13a27be 100644 --- a/meta/classes/distutils.bbclass +++ b/meta/classes/distutils.bbclass @@ -69,6 +69,16 @@ distutils_do_install() { fi } +pkg_postinst_${PN} () { + if test ! -e ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth; then + cat > ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth << EOF +import sys; sys.__plen = len(sys.path) +import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) +EOF + fi + sed -i '$ i ${EASYINSTALL_${PN}}' ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth +} + EXPORT_FUNCTIONS do_compile do_install export LDSHARED="${CCLD} -shared" diff --git a/meta/recipes-devtools/python/python-rospkg_1.0.15.bb b/meta/recipes-devtools/python/python-rospkg_1.0.15.bb index c722cae..c6d1495 100644 --- a/meta/recipes-devtools/python/python-rospkg_1.0.15.bb +++ b/meta/recipes-devtools/python/python-rospkg_1.0.15.bb @@ -21,13 +21,3 @@ add_easyinstall_pth () { } EASYINSTALL_python-rospkg = "rospkg-1.0.15-py2.7.egg" - -pkg_postinst_${PN} () { - if test ! -e ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth; then - cat > ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth << EOF -import sys; sys.__plen = len(sys.path) -import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) -EOF - fi - sed -i '$ i ${EASYINSTALL_${PN}}' ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth -}