summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-11 12:24:29 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-11 12:24:29 +0000
commit7939225614fec32eefe13818284e2dae5c87c844 (patch)
treea5ef5c4af5994ef73e414cfd41f642e483dfd02d /eclass
parentMake desktop entry validity check happy, bug 189364 (diff)
downloadgentoo-2-7939225614fec32eefe13818284e2dae5c87c844.tar.gz
gentoo-2-7939225614fec32eefe13818284e2dae5c87c844.tar.bz2
gentoo-2-7939225614fec32eefe13818284e2dae5c87c844.zip
Fix detection of ez_setup in distutils_src_prepare(). Improve distutils_pkg_postinst() and distutils_pkg_postrm().
Diffstat (limited to 'eclass')
-rw-r--r--eclass/distutils.eclass63
1 files changed, 31 insertions, 32 deletions
diff --git a/eclass/distutils.eclass b/eclass/distutils.eclass
index a73ef059d461..76ed646de3c2 100644
--- a/eclass/distutils.eclass
+++ b/eclass/distutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.62 2009/09/09 19:26:00 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.63 2009/09/11 12:24:29 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -66,10 +66,10 @@ distutils_src_prepare() {
# Delete ez_setup files to prevent packages from installing
# setuptools on their own.
- local ez_setup_py_existence
- [[ -f ez_setup.py ]] && ez_setup_py_existence="1"
+ local ez_setup_existence
+ [[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
rm -fr ez_setup*
- if [[ "${ez_setup_py_existence}" == "1" ]]; then
+ if [[ "${ez_setup_existence}" == "1" ]]; then
echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
fi
@@ -174,12 +174,13 @@ distutils_src_install() {
fi
}
-# @FUNCTION: distutils_pkg_postrm
+# @FUNCTION: distutils_pkg_postinst
# @DESCRIPTION:
-# Generic pyc/pyo cleanup script. This function is exported.
-distutils_pkg_postrm() {
- if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
- die "${FUNCNAME}() can be used only in pkg_postrm() phase"
+# This is a generic optimization, you should override it if your package
+# installs modules in another directory. This function is exported.
+distutils_pkg_postinst() {
+ if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postinst() phase"
fi
local pylibdir pymod
@@ -191,30 +192,23 @@ distutils_pkg_postrm() {
done
fi
- if [[ -n "${PYTHON_MODNAME}" ]]; then
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
- if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- python_mod_cleanup "${pymod}"
- else
- python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
- fi
- fi
- done
+ python_mod_optimize "${pymod}"
done
else
- python_mod_cleanup
+ for pymod in ${PYTHON_MODNAME}; do
+ python_mod_optimize "$(python_get_sitedir)/${pymod}"
+ done
fi
}
-# @FUNCTION: distutils_pkg_postinst
+# @FUNCTION: distutils_pkg_postrm
# @DESCRIPTION:
-# This is a generic optimization, you should override it if your package
-# installs modules in another directory. This function is exported.
-distutils_pkg_postinst() {
- if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
- die "${FUNCNAME}() can be used only in pkg_postinst() phase"
+# Generic pyc/pyo cleanup script. This function is exported.
+distutils_pkg_postrm() {
+ if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postrm() phase"
fi
local pylibdir pymod
@@ -226,15 +220,20 @@ distutils_pkg_postinst() {
done
fi
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if [[ -n "${PYTHON_MODNAME}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "${pymod}"
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ python_mod_cleanup "${pymod}"
+ else
+ 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
+ fi
done
else
- python_version
- for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}"
- done
+ python_mod_cleanup
fi
}