summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2016-05-28 21:07:10 -0400
committerMike Gilbert <floppym@gentoo.org>2016-06-05 12:47:11 -0400
commita6159369f71607222f12c6c6691669059e526417 (patch)
treeea6e079cef5ebbea7952777174bda6f0a7766c7d
parentdistutils-r1.eclass: Strip the trailing slash from D (diff)
downloadgentoo-a6159369.tar.gz
gentoo-a6159369.tar.bz2
gentoo-a6159369.zip
distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py
Also remove .pydistutils.cfg from HOME before returning. This config should only be needed when we are invoking setup.py. The esetup.py wrapper provides a normalized way for doing this; if ebuilds call setup.py without the wrapper, they are now also responsible for setting the build directory if necessary. This change allows us to stop overriding the HOME variable, and prevents leakage of eclass-specifc configuration to the general ebuild environment.
-rw-r--r--eclass/distutils-r1.eclass15
1 files changed, 10 insertions, 5 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 171762c60ec2..334ce73a6503 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -242,10 +242,19 @@ esetup.py() {
local die_args=()
[[ ${EAPI} != [45] ]] && die_args+=( -n )
+ [[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
+
set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
echo "${@}" >&2
- "${@}" || die "${die_args[@]}" || return ${?}
+ "${@}" || die "${die_args[@]}"
+ local ret=${?}
+
+ if [[ ${BUILD_DIR} ]]; then
+ rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}"
+ fi
+
+ return ${ret}
}
# @FUNCTION: distutils_install_for_testing
@@ -436,7 +445,6 @@ _distutils-r1_copy_egg_info() {
distutils-r1_python_compile() {
debug-print-function ${FUNCNAME} "${@}"
- _distutils-r1_create_setup_cfg
_distutils-r1_copy_egg_info
esetup.py build "${@}"
@@ -511,9 +519,6 @@ distutils-r1_python_install() {
# enable compilation for the install phase.
local -x PYTHONDONTWRITEBYTECODE=
- # re-create setup.cfg with install paths
- _distutils-r1_create_setup_cfg
-
# python likes to compile any module it sees, which triggers sandbox
# failures if some packages haven't compiled their modules yet.
addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"