diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-12-30 03:06:35 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-12-30 03:06:35 +0000 |
commit | b1f7bc321180855928ef9ad223df860ab88e5fe0 (patch) | |
tree | 7dbe15d1c02a61bebe8527b2d60f6604c058b58d | |
parent | Properly handle Python modules installable for multiple Python versions (bug ... (diff) | |
download | python-updater-b1f7bc321180855928ef9ad223df860ab88e5fe0.tar.gz python-updater-b1f7bc321180855928ef9ad223df860ab88e5fe0.tar.bz2 python-updater-b1f7bc321180855928ef9ad223df860ab88e5fe0.zip |
Rename soname check to shared_linking. Add static_linking check.
-rwxr-xr-x | python-updater | 66 |
1 files changed, 53 insertions, 13 deletions
diff --git a/python-updater b/python-updater index 37ad726..4ca247b 100755 --- a/python-updater +++ b/python-updater @@ -46,7 +46,8 @@ CHECK_ECLASS=0 CHECK_MANUAL=1 CHECK_PYLIBDIR=1 CHECK_PYTHON_ABIS=1 -CHECK_SONAME=1 +CHECK_SHARED_LINKING=1 +CHECK_STATIC_LINKING=1 CHECK_ECLASS_NEED_REBUILD=1 # load the gentoo-style info macros, but hack to get around @@ -93,7 +94,8 @@ done) * eclass (Disabled by default) * pylibdir (Enabled by default) * PYTHON_ABIS (Enabled by default) - * soname (Enabled by default) + * shared_linking (Enabled by default) + * static_linking (Enabled by default) * manual (Enabled by default) * need_rebuild (Enabled by default) -dCHECK --disable-CHECK @@ -295,11 +297,17 @@ while [[ -n "$1" ]]; do -dp*|--disable-p*) CHECK_PYLIBDIR=0 ;; - -es*|--enable-s*) - CHECK_SONAME=1 + -eshared_linking|--enable-shared_linking) + CHECK_SHARED_LINKING=1 ;; - -ds*|--disable-s*) - CHECK_SONAME=0 + -dshared_linking|--disable-shared_linking) + CHECK_SHARED_LINKING=0 + ;; + -estatic_linking|--enable-static_linking) + CHECK_STATIC_LINKING=1 + ;; + -dstatic_linking|--disable-static_linking) + CHECK_STATIC_LINKING=0 ;; -en*|--enable-n*) CHECK_ECLASS_NEED_REBUILD=1 @@ -357,16 +365,27 @@ OLD_PYTHON_SHARED_LIBRARIES_REGEX="(${OLD_PYTHON_SHARED_LIBRARIES_REGEX})" einfo $'\e[1;34m'"Starting Python Updater [New main active Python version: ${NEW_PYTHON_VERSION}]"$'\e[0m' -if [[ CHECK_SONAME -ne 0 ]]; then +if [[ CHECK_SHARED_LINKING -ne 0 ]]; then if ! type -P scanelf >/dev/null 2>&1; then ewarn "scanelf not found!" - ewarn "check soname is disabled." - CHECK_SONAME=0 + ewarn "check shared_linking is disabled." + CHECK_SHARED_LINKING=0 else - veinfo 1 'check "soname" enabled.' + veinfo 1 'check "shared_linking" enabled.' fi else - veinfo 1 'check "soname" disabled.' + veinfo 1 'check "shared_linking" disabled.' +fi +if [[ CHECK_STATIC_LINKING -ne 0 ]]; then + if ! type -P scanelf >/dev/null 2>&1; then + ewarn "scanelf not found!" + ewarn "check static_linking is disabled." + CHECK_STATIC_LINKING=0 + else + veinfo 1 'check "static_linking" enabled.' + fi +else + veinfo 1 'check "static_linking" disabled.' fi [[ CHECK_PYLIBDIR -ne 0 ]] \ && veinfo 1 'check "pylibdir" enabled.' \ @@ -506,14 +525,35 @@ for content in $(find ${PKG_DBDIR}/ -name CONTENTS | sort); do fi fi - if [[ CHECK_SONAME -ne 0 ]]; then + if [[ CHECK_SHARED_LINKING -ne 0 ]]; then binaries="$(scanelf -qF "%F %n" < <(grep -E "^obj" "${content}" | cut -d" " -f2) | grep -E "( |,)${OLD_PYTHON_SHARED_LIBRARIES_REGEX}(,|$)")" if [[ -n "${binaries}" ]]; then PKGS_TO_REMERGE+=" ${CATPKGVER}" eindent einfo "Adding to list: ${CATPKGVER}" eindent - veinfo 1 "check: soname [ Binaries linked to old Python shared library found:" + veinfo 1 "check: shared_linking [ Binaries linked against old Python shared library found:" + eindent + old_IFS="${IFS}" + IFS=$'\n' + for binary in ${binaries}; do + veinfo 1 "${binary}" + done + IFS="${old_IFS}" + eoutdent + veinfo 1 "]" + eoutdent && eoutdent + fi + fi + + if [[ CHECK_STATIC_LINKING -ne 0 ]]; then + binaries="$(scanelf -qs +Py_Initialize < <(grep -E "^obj" "${content}" | cut -d" " -f2) | sed "s/.* //")" + if [[ -n "${binaries}" ]]; then + PKGS_TO_REMERGE+=" ${CATPKGVER}" + eindent + einfo "Adding to list: ${CATPKGVER}" + eindent + veinfo 1 "check: static_linking [ Binaries linked against Python static library found:" eindent old_IFS="${IFS}" IFS=$'\n' |