diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-03-04 19:22:13 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-03-04 19:22:13 +0000 |
commit | f99df4b32f6dab189625580b96db8304c9edf3ee (patch) | |
tree | 29d986452dd00219c102d68915d01fca847deadd /eclass/multibuild.eclass | |
parent | Introduce multibuild.eclass to handle building multiple variants of the same ... (diff) | |
download | historical-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.eclass | 21 |
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 |