Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH FIXED] Introduce edefault() as a friendly default sub-phase wrapper.
Date: Sat, 11 May 2013 09:30:45
Message-Id: 1368264639-6738-1-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/2] Introduce edefault() as a friendly default sub-phase wrapper. by "Michał Górny"
1 Fixed naming the proper default sub-phase and declaring 'edefault'
2 in python_prepare_all().
3 ---
4 gx86/eclass/distutils-r1.eclass | 22 ++++++++++++++++++++++
5 1 file changed, 22 insertions(+)
6
7 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
8 index 47b5b97..e5c2a3a 100644
9 --- a/gx86/eclass/distutils-r1.eclass
10 +++ b/gx86/eclass/distutils-r1.eclass
11 @@ -206,6 +206,20 @@ fi
12 # }
13 # @CODE
14
15 +# @FUNCTION: edefault
16 +# @USAGE: [<args>...]
17 +# @DESCRIPTION:
18 +# Runs the default distutils-r1 sub-phase implementation for the current
19 +# sub-phase. Available only in distutils-r1 sub-phases.
20 +#
21 +# Example:
22 +# @CODE
23 +# python_install_all() {
24 +# use doc && local HTML_DOCS=( doc/html/. )
25 +# edefault # == distutils-r1_python_install_all
26 +# }
27 +# @CODE
28 +
29 # @FUNCTION: esetup.py
30 # @USAGE: [<args>...]
31 # @DESCRIPTION:
32 @@ -515,8 +529,12 @@ distutils-r1_run_phase() {
33
34 mkdir -p "${TMPDIR}" || die
35
36 + eval "edefault() { distutils-r1_${1}; }"
37 +
38 "${@}"
39
40 + unset -f edefault
41 +
42 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
43 then
44 popd >/dev/null || die
45 @@ -579,7 +597,11 @@ distutils-r1_src_prepare() {
46
47 # common preparations
48 if declare -f python_prepare_all >/dev/null; then
49 + eval "edefault() { distutils-r1_python_prepare_all; }"
50 +
51 python_prepare_all
52 +
53 + unset -f edefault
54 else
55 distutils-r1_python_prepare_all
56 fi
57 --
58 1.8.2.1

Replies