diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-01-27 16:36:21 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-01-27 16:36:21 +0000 |
commit | 25008962842ed294088d3344fe4c85b161f33100 (patch) | |
tree | 66515ff450e7d035e4a5cecf18ef8edb471c325f /eclass | |
parent | Introduce python_doheader(), to install headers specific to a Python implemen... (diff) | |
download | gentoo-2-25008962842ed294088d3344fe4c85b161f33100.tar.gz gentoo-2-25008962842ed294088d3344fe4c85b161f33100.tar.bz2 gentoo-2-25008962842ed294088d3344fe4c85b161f33100.zip |
Introduce run_in_build_dir() function as used by GNOME ebuilds.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/python-r1.eclass | 21 |
2 files changed, 24 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index f3c0cd71ac91..273524cf2821 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.647 2013/01/27 16:35:33 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.648 2013/01/27 16:36:21 mgorny Exp $ + + 27 Jan 2013; Michał Górny <mgorny@gentoo.org> python-r1.eclass: + Introduce run_in_build_dir() function as used by GNOME ebuilds. 27 Jan 2013; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass: Introduce python_doheader(), to install headers specific to a Python diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 63dc556b3497..f02244bd1dce 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.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/python-r1.eclass,v 1.37 2013/01/21 19:28:16 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.38 2013/01/27 16:36:21 mgorny Exp $ # @ECLASS: python-r1 # @MAINTAINER: @@ -681,5 +681,24 @@ python_replicate_script() { done } +# @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} +} + _PYTHON_R1=1 fi |