<commit_before>DESCRIPTION = "ROS package library"
SECTION = "devel/python"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=083869c8da6fdf8c3a5bbd7d1bf93cac"
SRCNAME = "rospkg"

SRC_URI = "http://pypi.python.org/packages/source/r/rospkg/rospkg-1.0.15.tar.gz"
SRC_URI[md5sum] = "3c9b1b8d1e90950944b3f10bad16ecff"
SRC_URI[sha256sum] = "f8be5a9d74f7e656d38b2c3b44b7e367fce4001d613ca3fbfcbb87c4937956f2"

S = "${WORKDIR}/${SRCNAME}-${PV}"

inherit distutils

# Must inherit package first before changing PACKAGEFUNCS
inherit package
PACKAGEFUNCS += "add_easyinstall_pth"

add_easyinstall_pth () {
	echo "rospkg add_easyinstall_pth..."
}


pkg_postinst_python-rospkg () {
	if test -e ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth; then
            echo insert >> ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
        else
            echo create >> ${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
        fi

}<commit_msg>a first iteration at creating the correct easyinstall.pth file<commit_after>DESCRIPTION = "ROS package library"
SECTION = "devel/python"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=083869c8da6fdf8c3a5bbd7d1bf93cac"
SRCNAME = "rospkg"

SRC_URI = "http://pypi.python.org/packages/source/r/rospkg/rospkg-1.0.15.tar.gz"
SRC_URI[md5sum] = "3c9b1b8d1e90950944b3f10bad16ecff"
SRC_URI[sha256sum] = "f8be5a9d74f7e656d38b2c3b44b7e367fce4001d613ca3fbfcbb87c4937956f2"

S = "${WORKDIR}/${SRCNAME}-${PV}"

inherit distutils

# Must inherit package first before changing PACKAGEFUNCS
inherit package
PACKAGEFUNCS += "add_easyinstall_pth"

add_easyinstall_pth () {
	echo "rospkg 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
}
{'fraction_non_alphanumeric': 0.13308164228409627, 'fraction_numerical': 0.0778669183577159, 'mean_word_length': 5.235294117647059, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5895528', 'n_tokens_mistral': 1002, 'n_tokens_neox': 904, 'n_words': 127}