summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Polatel <hawking@gentoo.org>2008-10-28 21:29:28 +0000
committerAli Polatel <hawking@gentoo.org>2008-10-28 21:29:28 +0000
commit54c177004c9539235cdc1e0a0864c595bc5e1e28 (patch)
tree4d599e75d9c1e478aae20e3b69cea51f6d8c30fa /eclass/distutils.eclass
parentkeyworded ~arch for ppc64, bug 242294 (diff)
downloadgentoo-2-54c177004c9539235cdc1e0a0864c595bc5e1e28.tar.gz
gentoo-2-54c177004c9539235cdc1e0a0864c595bc5e1e28.tar.bz2
gentoo-2-54c177004c9539235cdc1e0a0864c595bc5e1e28.zip
fix distutils_pkg_post{inst,rm}.
Diffstat (limited to 'eclass/distutils.eclass')
-rw-r--r--eclass/distutils.eclass30
1 files changed, 20 insertions, 10 deletions
diff --git a/eclass/distutils.eclass b/eclass/distutils.eclass
index 6e9ec0c52326..121f56913de2 100644
--- a/eclass/distutils.eclass
+++ b/eclass/distutils.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/distutils.eclass,v 1.53 2008/10/27 00:19:46 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.54 2008/10/28 21:29:28 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -95,17 +95,23 @@ distutils_src_install() {
# @DESCRIPTION:
# Generic pyc/pyo cleanup script. This function is exported.
distutils_pkg_postrm() {
- if [ -z "${PYTHON_MODNAME}" ] && \
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
- PYTHON_MODNAME=${PN}
+ local moddir pylibdir pymod
+ if [[ -z "${PYTHON_MODNAME}" ]]; then
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
+ done
fi
if has_version ">=dev-lang/python-2.3"; then
ebegin "Performing Python Module Cleanup .."
- if [ -n "${PYTHON_MODNAME}" ]; then
+ if [[ -n "${PYTHON_MODNAME}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do
- python_mod_cleanup ${moddir}
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${pymod} ]]; then
+ python_mod_cleanup "${pylibdir#${ROOT}}"/site-packages/${pymod}
+ fi
done
done
else
@@ -120,9 +126,13 @@ distutils_pkg_postrm() {
# This is a generic optimization, you should override it if your package
# installs things in another directory. This function is exported
distutils_pkg_postinst() {
- if [ -z "${PYTHON_MODNAME}" ] && \
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
- PYTHON_MODNAME=${PN}
+ local pylibdir pymod
+ if [[ -z "${PYTHON_MODNAME}" ]]; then
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
+ done
fi
if has_version ">=dev-lang/python-2.3"; then