Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sun, 05 Jun 2016 16:48:15
Message-Id: 1465145231.a6159369f71607222f12c6c6691669059e526417.floppym@gentoo
1 commit: a6159369f71607222f12c6c6691669059e526417
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 29 01:07:10 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 5 16:47:11 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6159369
7
8 distutils-r1.eclass: Move creation of .pydistutils.cfg to esetup.py
9
10 Also remove .pydistutils.cfg from HOME before returning.
11
12 This config should only be needed when we are invoking setup.py. The
13 esetup.py wrapper provides a normalized way for doing this; if ebuilds
14 call setup.py without the wrapper, they are now also responsible for
15 setting the build directory if necessary.
16
17 This change allows us to stop overriding the HOME variable, and prevents
18 leakage of eclass-specifc configuration to the general ebuild
19 environment.
20
21 eclass/distutils-r1.eclass | 15 ++++++++++-----
22 1 file changed, 10 insertions(+), 5 deletions(-)
23
24 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
25 index 171762c..334ce73 100644
26 --- a/eclass/distutils-r1.eclass
27 +++ b/eclass/distutils-r1.eclass
28 @@ -242,10 +242,19 @@ esetup.py() {
29 local die_args=()
30 [[ ${EAPI} != [45] ]] && die_args+=( -n )
31
32 + [[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
33 +
34 set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
35
36 echo "${@}" >&2
37 - "${@}" || die "${die_args[@]}" || return ${?}
38 + "${@}" || die "${die_args[@]}"
39 + local ret=${?}
40 +
41 + if [[ ${BUILD_DIR} ]]; then
42 + rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}"
43 + fi
44 +
45 + return ${ret}
46 }
47
48 # @FUNCTION: distutils_install_for_testing
49 @@ -436,7 +445,6 @@ _distutils-r1_copy_egg_info() {
50 distutils-r1_python_compile() {
51 debug-print-function ${FUNCNAME} "${@}"
52
53 - _distutils-r1_create_setup_cfg
54 _distutils-r1_copy_egg_info
55
56 esetup.py build "${@}"
57 @@ -511,9 +519,6 @@ distutils-r1_python_install() {
58 # enable compilation for the install phase.
59 local -x PYTHONDONTWRITEBYTECODE=
60
61 - # re-create setup.cfg with install paths
62 - _distutils-r1_create_setup_cfg
63 -
64 # python likes to compile any module it sees, which triggers sandbox
65 # failures if some packages haven't compiled their modules yet.
66 addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"