public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources.
@ 2013-03-06 14:25 Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources Michał Górny
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2013-03-06 14:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

The new function can be used to create per-variant copies of source
trees. Code based on python_copy_sources from python-r1.
---
 gx86/eclass/multibuild.eclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gx86/eclass/multibuild.eclass b/gx86/eclass/multibuild.eclass
index 8ccd3b6..65f3926 100644
--- a/gx86/eclass/multibuild.eclass
+++ b/gx86/eclass/multibuild.eclass
@@ -205,6 +205,27 @@ multibuild_for_best_variant() {
 	multibuild_foreach_variant "${@}"
 }
 
+# @FUNCTION: multibuild_copy_sources
+# @DESCRIPTION:
+# Create per-variant copies of source tree. The source tree is assumed
+# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will
+# be placed in directories matching BUILD_DIRs used by
+# multibuild_foreach().
+multibuild_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}}
+
+	einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
+
+	_multibuild_create_source_copy() {
+		einfo "${impl}: copying to ${BUILD_DIR}"
+		cp -pr "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
+	}
+
+	multibuild_foreach_variant _multibuild_create_source_copy
+}
+
 # @FUNCTION: run_in_build_dir
 # @USAGE: <argv>...
 # @DESCRIPTION:
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-06 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 14:25 [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources Michał Górny
2013-03-06 14:25 ` [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources Michał Górny
2013-03-06 14:25 ` [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox