summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-03-04 19:22:13 +0000
committerMichał Górny <mgorny@gentoo.org>2013-03-04 19:22:13 +0000
commitf99df4b32f6dab189625580b96db8304c9edf3ee (patch)
tree29d986452dd00219c102d68915d01fca847deadd /eclass/multibuild.eclass
parentIntroduce multibuild.eclass to handle building multiple variants of the same ... (diff)
downloadhistorical-f99df4b32f6dab189625580b96db8304c9edf3ee.tar.gz
historical-f99df4b32f6dab189625580b96db8304c9edf3ee.tar.bz2
historical-f99df4b32f6dab189625580b96db8304c9edf3ee.zip
Move run_in_build_dir() to multibuild.eclass.
Diffstat (limited to 'eclass/multibuild.eclass')
-rw-r--r--eclass/multibuild.eclass21
1 files changed, 20 insertions, 1 deletions
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index 39e1772320f8..91f6bec86ece 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.1 2013/03/04 19:21:27 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.2 2013/03/04 19:22:13 mgorny Exp $
# @ECLASS: multibuild
# @MAINTAINER:
@@ -174,5 +174,24 @@ multibuild_parallel_foreach_variant() {
return ${ret}
}
+# @FUNCTION: run_in_build_dir
+# @USAGE: <argv>...
+# @DESCRIPTION:
+# Run the given command in the directory pointed by BUILD_DIR.
+run_in_build_dir() {
+ debug-print-function ${FUNCNAME} "${@}"
+ local ret
+
+ [[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified."
+ [[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set."
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ "${@}"
+ ret=${?}
+ popd >/dev/null || die
+
+ return ${ret}
+}
+
_MULTIBUILD=1
fi