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: hasufell@gentoo.org, python@gentoo.org,
	"Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 5/7] multilib-minimal: reuse multibuild phase function handlers.
Date: Sun, 10 Mar 2013 11:18:09 +0100	[thread overview]
Message-ID: <1362910691-8439-5-git-send-email-mgorny@gentoo.org> (raw)
In-Reply-To: <20130310111644.0840d935@pomiocik.lan>

---
 gx86/eclass/multilib-minimal.eclass | 54 ++++++++++++-------------------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/gx86/eclass/multilib-minimal.eclass b/gx86/eclass/multilib-minimal.eclass
index 2510578..2a707b1 100644
--- a/gx86/eclass/multilib-minimal.eclass
+++ b/gx86/eclass/multilib-minimal.eclass
@@ -45,53 +45,33 @@ multilib-minimal_src_configure() {
 	}
 	multilib_foreach_abi _multilib-minimal_mkdir
 
-	multilib-minimal_abi_src_configure() {
-		if declare -f multilib_src_configure >/dev/null ; then
-			multilib_src_configure
-		else
-			default_src_configure
-		fi
-	}
-
-	multilib_foreach_abi _multilib-minimal_wrap_phase multilib-minimal_abi_src_configure
+	local phase=$(multibuild_get_phase_function multilib_src_configure)
+	multilib_foreach_abi \
+		_multilib-minimal_wrap_phase "${phase:-default_src_configure}"
 }
 
 multilib-minimal_src_compile() {
-	multilib-minimal_abi_src_compile() {
-		if declare -f multilib_src_compile >/dev/null ; then
-			multilib_src_compile
-		else
-			default_src_compile
-		fi
-	}
-
-	multilib_foreach_abi _multilib-minimal_wrap_phase multilib-minimal_abi_src_compile
+	local phase=$(multibuild_get_phase_function multilib_src_compile)
+	multilib_foreach_abi \
+		_multilib-minimal_wrap_phase "${phase:-default_src_compile}"
 }
 
 multilib-minimal_src_test() {
-	multilib-minimal_abi_src_test() {
-		if declare -f multilib_src_test >/dev/null ; then
-			multilib_src_test
-		else
-			default_src_test
-		fi
-	}
-
-	multilib_foreach_abi _multilib-minimal_wrap_phase multilib-minimal_abi_src_test
+	local phase=$(multibuild_get_phase_function multilib_src_test)
+	multilib_foreach_abi \
+		_multilib-minimal_wrap_phase "${phase:-default_src_test}"
 }
 
 multilib-minimal_src_install() {
-	multilib-minimal_abi_src_install() {
-		if declare -f multilib_src_install >/dev/null ; then
-			multilib_src_install
-		else
-			default_src_install	
-		fi
+	_multilib-minimal_wrap_install_phase() {
+		_multilib-minimal_wrap_phase "${@}"
 		multilib_check_headers
 	}
-	multilib_foreach_abi _multilib-minimal_wrap_phase multilib-minimal_abi_src_install
 
-	if declare -f multilib_src_install_all >/dev/null ; then
-		multilib_src_install_all
-	fi
+	local phase=$(multibuild_get_phase_function multilib_src_install)
+	multilib_foreach_abi \
+		_multilib-minimal_wrap_install_phase "${phase:-default_src_install}"
+
+	phase=$(multibuild_get_phase_function multilib_src_install_all)
+	[[ ${phase} ]] && "${phase}"
 }
-- 
1.8.1.5



  parent reply	other threads:[~2013-03-10 10:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10 10:16 [gentoo-dev] [PATCHES] multibuild.eclass: custom phase function helpers Michał Górny
2013-03-10 10:18 ` [gentoo-dev] [PATCH 1/7] multibuild: introduce a generic framework for custom phase functions Michał Górny
2013-03-10 11:36   ` Ulrich Mueller
2013-03-10 12:16     ` Ulrich Mueller
2013-03-10 12:18       ` Ciaran McCreesh
2013-03-10 13:19         ` Michał Górny
2013-03-10 13:44           ` Ulrich Mueller
2013-03-10 13:48             ` Michał Górny
2013-03-10 15:26               ` Ciaran McCreesh
2013-03-10 15:46                 ` Michał Górny
2013-03-10 15:46                   ` Ciaran McCreesh
2013-03-10 15:50       ` [gentoo-dev] [PATCH] " Michał Górny
2013-03-10 18:37         ` Alec Warner
2013-03-10 10:18 ` [gentoo-dev] [PATCH 2/7] distutils-r1: use multibuild phase helpers Michał Górny
2013-03-10 10:18 ` [gentoo-dev] [PATCH 3/7] multilib-minimal: split out mkdir to unify sub-functions Michał Górny
2013-03-10 10:18 ` [gentoo-dev] [PATCH 4/7] multilib-minimal: reuse run_in_build_dir Michał Górny
2013-03-10 10:18 ` Michał Górny [this message]
2013-03-10 10:18 ` [gentoo-dev] [PATCH 6/7] multilib-minimal: run multilib_src_configure in parallel Michał Górny
2013-03-10 10:18 ` [gentoo-dev] [PATCH 7/7] autotools-multilib: reuse phase functions from multilib-minimal Michał Górny
2013-03-17 13:35 ` [gentoo-dev] [PATCHES] multibuild.eclass: custom phase function helpers 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=1362910691-8439-5-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=hasufell@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