diff options
author | Alastair Tse <liquidx@gentoo.org> | 2003-10-17 07:14:26 +0000 |
---|---|---|
committer | Alastair Tse <liquidx@gentoo.org> | 2003-10-17 07:14:26 +0000 |
commit | aa0418ee24f4ef93668f654a62065f3f53b2552d (patch) | |
tree | f8ab86209b681f1670223432790143f877053fa4 /eclass/distutils.eclass | |
parent | version bump, thank markgilbert@hotpop.com for reporting this via bugzilla. (diff) | |
download | gentoo-2-aa0418ee24f4ef93668f654a62065f3f53b2552d.tar.gz gentoo-2-aa0418ee24f4ef93668f654a62065f3f53b2552d.tar.bz2 gentoo-2-aa0418ee24f4ef93668f654a62065f3f53b2552d.zip |
various bugfixes for byte-compiling
Diffstat (limited to 'eclass/distutils.eclass')
-rw-r--r-- | eclass/distutils.eclass | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/eclass/distutils.eclass b/eclass/distutils.eclass index 1a1170c4fd2e..af7e9e0f7fc5 100644 --- a/eclass/distutils.eclass +++ b/eclass/distutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.18 2003/10/09 15:37:57 liquidx Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.19 2003/10/17 07:14:26 liquidx Exp $ # # Author: Jon Nelson <jnelson@gentoo.org> # Current Maintainer: Alastair Tse <liquidx@gentoo.org> @@ -55,6 +55,42 @@ distutils_src_install() { [ -n "${mydoc}" ] && dodoc ${mydoc} } +# generic pyc/pyo cleanup script. + +distutils_pkg_postrm() { + PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} + + if has_version ">=dev-lang/python-2.3"; then + ebegin "Performing Python Module Cleanup .." + if [ -n "${PYTHON_MODNAME}" ]; then + for pymod in "${PYTHON_MODNAME}"; do + for moddir in "`ls -d --color=none -1 ${ROOT}usr/lib/python*/site-packages/${pymod}`"; do + python_mod_cleanup ${moddir} + done + done + else + python_mod_cleanup + fi + eend 0 + fi +} + +# this is a generic optimization, you should override it if your package +# installs things in another directory + +distutils_pkg_postinst() { + PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} + + if has_version ">=dev-lang/python-2.3"; then + python_version + for pymod in "${PYTHON_MODNAME}"; do + if [ -d "${ROOT}usr/lib/python${PYVER}/site-packages/${pymod}" ]; then + python_mod_optimize ${ROOT}usr/lib/python${PYVER}/site-packages/${pymod} + fi + done + fi +} + # e.g. insinto ${ROOT}/usr/include/python${PYVER} distutils_python_version() { @@ -78,5 +114,5 @@ distutils_python_tkinter() { } -EXPORT_FUNCTIONS src_compile src_install +EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |