Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH] Introduce run_in_build_dir() as requested in a few ebuilds.
Date: Sat, 26 Jan 2013 11:27:33
Message-Id: 1359199681-31420-1-git-send-email-mgorny@gentoo.org
1 As people wanted to make a horrible monster out of this if added
2 to eutils, just add it here.
3 ---
4 gx86/eclass/python-r1.eclass | 19 +++++++++++++++++++
5 1 file changed, 19 insertions(+)
6
7 diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
8 index 63dc556..27653af 100644
9 --- a/gx86/eclass/python-r1.eclass
10 +++ b/gx86/eclass/python-r1.eclass
11 @@ -681,5 +681,24 @@ python_replicate_script() {
12 done
13 }
14
15 +# @FUNCTION: run_in_build_dir
16 +# @USAGE: <argv>...
17 +# @DESCRIPTION:
18 +# Run the given command in the directory pointed by BUILD_DIR.
19 +run_in_build_dir() {
20 + debug-print-function ${FUNCNAME} "${@}"
21 + local ret
22 +
23 + [[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified."
24 + [[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set."
25 +
26 + pushd "${BUILD_DIR}" &>/dev/null || die
27 + "${@}"
28 + ret=${?}
29 + popd &>/dev/null || die
30 +
31 + return ${ret}
32 +}
33 +
34 _PYTHON_R1=1
35 fi
36 --
37 1.8.1.1

Replies