diff options
author | Ali Polatel <hawking@gentoo.org> | 2008-05-29 15:24:35 +0000 |
---|---|---|
committer | Ali Polatel <hawking@gentoo.org> | 2008-05-29 15:24:35 +0000 |
commit | 43951a2bdee2fdc79f3e5e6ac45339753a2aa588 (patch) | |
tree | b98d7b0f5b2e56ec24a69fae28b1a96b7ed1201f /eclass/python.eclass | |
parent | Removed bundled libltdl (fixes bug #221879). (diff) | |
download | historical-43951a2bdee2fdc79f3e5e6ac45339753a2aa588.tar.gz historical-43951a2bdee2fdc79f3e5e6ac45339753a2aa588.tar.bz2 historical-43951a2bdee2fdc79f3e5e6ac45339753a2aa588.zip |
Make python_mod_optimize ROOT aware.
Diffstat (limited to 'eclass/python.eclass')
-rw-r--r-- | eclass/python.eclass | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/eclass/python.eclass b/eclass/python.eclass index ed514f95416a..7d83f1258a1f 100644 --- a/eclass/python.eclass +++ b/eclass/python.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.35 2008/05/29 14:10:48 hawking Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.36 2008/05/29 15:24:35 hawking Exp $ # @ECLASS: python.eclass # @MAINTAINER: @@ -168,12 +168,20 @@ python_mod_compile() { # in the supplied directory # # Example: -# python_mod_optimize ${ROOT}usr/share/codegen +# python_mod_optimize /usr/share/codegen python_mod_optimize() { - local myroot + local mydirs myfiles myroot path # strip trailing slash myroot="${ROOT%/}" + # respect ROOT + for path in $@; do + [ ! -e "${myroot}/${path}" ] && ewarn "${myroot}/${path} doesn't exist!" + [ -d "${myroot}/${path#/}" ] && mydirs="${mydirs} ${myroot}/${path#/}" + # Files are passed to python_mod_compile which is ROOT-aware + [ -f "${myroot}/${path}" ] && myfiles="${myfiles} ${path}" + done + # allow compiling for older python versions if [ -n "${PYTHON_OVERRIDE_PYVER}" ]; then PYVER=${PYTHON_OVERRIDE_PYVER} @@ -189,8 +197,19 @@ python_mod_optimize() { fi ebegin "Byte compiling python modules for python-${PYVER} .." - python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@ - python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py ${compileopts} $@ + if [ -n "${mydirs}" ]; then + python${PYVER} \ + ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py \ + ${compileopts} ${mydirs} + python${PYVER} -O \ + ${myroot}/usr/$(get_libdir)/python${PYVER}/compileall.py \ + ${compileopts} ${mydirs} + fi + + if [ -n "${myfiles}" ]; then + python_mod_compile ${myfiles} + fi + eend $? } |