diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-12-11 18:32:30 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-12-11 18:32:30 +0000 |
commit | 41279f3e2f76c8a43fe96dd9cfde6d05f190cf6f (patch) | |
tree | 75cb911d9c82fb4d1fcebb9ff03701661acf6aba /eclass | |
parent | Version bump. (diff) | |
download | gentoo-2-41279f3e2f76c8a43fe96dd9cfde6d05f190cf6f.tar.gz gentoo-2-41279f3e2f76c8a43fe96dd9cfde6d05f190cf6f.tar.bz2 gentoo-2-41279f3e2f76c8a43fe96dd9cfde6d05f190cf6f.zip |
Always restore initial directory after sub-phase run. Fixes bug #532168 and possibly more.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/distutils-r1.eclass | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index ff19c3bf969f..5ee9589881e1 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1457 2014/12/11 09:07:04 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1458 2014/12/11 18:32:30 mgorny Exp $ + + 11 Dec 2014; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass: + Always restore initial directory after sub-phase run. Fixes bug #532168 and + possibly more. 11 Dec 2014; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass: Restore using separate HOMEs for Python implementations, because of diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 737468e79009..6efa82874e38 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.105 2014/12/11 09:07:04 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.106 2014/12/11 18:32:30 mgorny Exp $ # @ECLASS: distutils-r1 # @MAINTAINER: @@ -587,7 +587,7 @@ distutils-r1_run_phase() { if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - pushd "${BUILD_DIR}" >/dev/null || die + cd "${BUILD_DIR}" || die fi local BUILD_DIR=${BUILD_DIR}/build fi @@ -617,10 +617,7 @@ distutils-r1_run_phase() { "${@}" - if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] - then - popd >/dev/null || die - fi + cd "${_DISTUTILS_INITIAL_CWD}" || die } # @FUNCTION: _distutils-r1_run_common_phase @@ -635,6 +632,7 @@ _distutils-r1_run_common_phase() { local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR} if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + local _DISTUTILS_INITIAL_CWD=${PWD} local MULTIBUILD_VARIANTS _python_obtain_impls @@ -654,6 +652,8 @@ _distutils-r1_run_common_phase() { _distutils-r1_run_foreach_impl() { debug-print-function ${FUNCNAME} "${@}" + # store for restoring after distutils-r1_run_phase. + local _DISTUTILS_INITIAL_CWD=${PWD} set -- distutils-r1_run_phase "${@}" if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then |