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 1/3] multibuild: introduce generic multibuild_copy_sources.
Date: Wed, 06 Mar 2013 14:25:43
Message-Id: 1362579955-31813-1-git-send-email-mgorny@gentoo.org
1 The new function can be used to create per-variant copies of source
2 trees. Code based on python_copy_sources from python-r1.
3 ---
4 gx86/eclass/multibuild.eclass | 21 +++++++++++++++++++++
5 1 file changed, 21 insertions(+)
6
7 diff --git a/gx86/eclass/multibuild.eclass b/gx86/eclass/multibuild.eclass
8 index 8ccd3b6..65f3926 100644
9 --- a/gx86/eclass/multibuild.eclass
10 +++ b/gx86/eclass/multibuild.eclass
11 @@ -205,6 +205,27 @@ multibuild_for_best_variant() {
12 multibuild_foreach_variant "${@}"
13 }
14
15 +# @FUNCTION: multibuild_copy_sources
16 +# @DESCRIPTION:
17 +# Create per-variant copies of source tree. The source tree is assumed
18 +# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will
19 +# be placed in directories matching BUILD_DIRs used by
20 +# multibuild_foreach().
21 +multibuild_copy_sources() {
22 + debug-print-function ${FUNCNAME} "${@}"
23 +
24 + local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}}
25 +
26 + einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
27 +
28 + _multibuild_create_source_copy() {
29 + einfo "${impl}: copying to ${BUILD_DIR}"
30 + cp -pr "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
31 + }
32 +
33 + multibuild_foreach_variant _multibuild_create_source_copy
34 +}
35 +
36 # @FUNCTION: run_in_build_dir
37 # @USAGE: <argv>...
38 # @DESCRIPTION:
39 --
40 1.8.1.5

Replies