summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-01-30 12:12:02 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-01-30 12:12:02 +0200
commit426a7b6f44c6a0e1633693575c7bb6fcc76cf8a5 (patch)
tree90b38805d5b0afe6f40782347b8dfadfd29f03df /scripts
parent53e3f65b8e2f3b8883a8410c7732062155b87957 (diff)
downloadlibrpm-tizen-426a7b6f44c6a0e1633693575c7bb6fcc76cf8a5.tar.gz
librpm-tizen-426a7b6f44c6a0e1633693575c7bb6fcc76cf8a5.tar.bz2
librpm-tizen-426a7b6f44c6a0e1633693575c7bb6fcc76cf8a5.zip
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/pythondeps.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/pythondeps.sh b/scripts/pythondeps.sh
index 7ccd0761e..7bf6fecb2 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