From 426a7b6f44c6a0e1633693575c7bb6fcc76cf8a5 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 30 Jan 2010 12:12:02 +0200 Subject: [PATCH] Support multiple parallel python versions in pythondeps.sh - dont make assumptions about /usr/bin/python, extract the ABI version from python libdir version - patch from David Malcolm --- scripts/pythondeps.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/pythondeps.sh b/scripts/pythondeps.sh index 7ccd076..7bf6fec 100755 --- a/scripts/pythondeps.sh +++ b/scripts/pythondeps.sh @@ -5,17 +5,27 @@ exit 0 } -PYVER=`python -c "import sys; v=sys.version_info[:2]; print '%d.%d'%v"` case $1 in -P|--provides) shift - grep "/usr/bin/python\*\$" >& /dev/null && echo "python(abi) = ${PYVER}" - exit 0 + # Match buildroot/payload paths of the form + # /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR + # generating a line of the form + # python(abi) = MAJOR.MINOR + # (Don't match against -config tools e.g. /usr/bin/python2.6-config) + grep "/usr/bin/python.\..$" \ + | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|" ;; -R|--requires) shift - grep "/usr/lib[^/]*/python${PYVER}/" >& /dev/null && echo "python(abi) = ${PYVER}" - exit 0 + # Match buildroot paths of the form + # /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and + # /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ + # generating (uniqely) lines of the form: + # python(abi) = MAJOR.MINOR + grep "/usr/lib[^/]*/python.\../*" \ + | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \ + | sort | uniq ;; esac -- 2.7.4