public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH FIXED] Introduce edefault() as a friendly default sub-phase wrapper.
Date: Sat, 11 May 2013 11:30:39 +0200	[thread overview]
Message-ID: <1368264639-6738-1-git-send-email-mgorny@gentoo.org> (raw)
In-Reply-To: <1367440974-25521-1-git-send-email-mgorny@gentoo.org>

Fixed naming the proper default sub-phase and declaring 'edefault'
in python_prepare_all().
---
 gx86/eclass/distutils-r1.eclass | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 47b5b97..e5c2a3a 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -206,6 +206,20 @@ fi
 # }
 # @CODE
 
+# @FUNCTION: edefault
+# @USAGE: [<args>...]
+# @DESCRIPTION:
+# Runs the default distutils-r1 sub-phase implementation for the current
+# sub-phase. Available only in distutils-r1 sub-phases.
+#
+# Example:
+# @CODE
+# python_install_all() {
+#   use doc && local HTML_DOCS=( doc/html/. )
+#   edefault # == distutils-r1_python_install_all
+# }
+# @CODE
+
 # @FUNCTION: esetup.py
 # @USAGE: [<args>...]
 # @DESCRIPTION:
@@ -515,8 +529,12 @@ distutils-r1_run_phase() {
 
 	mkdir -p "${TMPDIR}" || die
 
+	eval "edefault() { distutils-r1_${1}; }"
+
 	"${@}"
 
+	unset -f edefault
+
 	if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
 	then
 		popd >/dev/null || die
@@ -579,7 +597,11 @@ distutils-r1_src_prepare() {
 
 	# common preparations
 	if declare -f python_prepare_all >/dev/null; then
+		eval "edefault() { distutils-r1_python_prepare_all; }"
+
 		python_prepare_all
+
+		unset -f edefault
 	else
 		distutils-r1_python_prepare_all
 	fi
-- 
1.8.2.1



  reply	other threads:[~2013-05-11  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 20:42 [gentoo-dev] [PATCHES] distutils-r1: support 'edefault' in sub-phase functions Michał Górny
2013-05-01 20:42 ` [gentoo-dev] [PATCH 1/2] Introduce edefault() as a friendly default sub-phase wrapper Michał Górny
2013-05-11  9:30   ` Michał Górny [this message]
2013-05-11 15:51     ` [gentoo-dev] Re: [PATCH FIXED] " Mike Gilbert
2013-05-11 16:35       ` Michał Górny
2013-05-11 16:41       ` Ralph Sennhauser
2013-05-01 20:42 ` [gentoo-dev] [PATCH 2/2] Example use of edefault Michał Górny
2013-05-15 19:03 ` [gentoo-dev] [PATCHES] distutils-r1: support 'edefault' in sub-phase functions Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368264639-6738-1-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox