From 74f28291906447d61a67d182322d4a5d031a3c0d Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Sun, 20 Dec 2015 13:45:53 -0700 Subject: mercurial.eclass: leave unchanged working dir Gentoo-bug: 568892 --- eclass/mercurial.eclass | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'eclass') diff --git a/eclass/mercurial.eclass b/eclass/mercurial.eclass index f58335a4ce75..bf85aaab6395 100644 --- a/eclass/mercurial.eclass +++ b/eclass/mercurial.eclass @@ -112,7 +112,7 @@ mercurial_fetch() { die "failed to create ${EHG_STORE_DIR}/${EHG_PROJECT}" chmod -f g+rw "${EHG_STORE_DIR}/${EHG_PROJECT}" || \ echo "Warning: failed to chmod g+rw ${EHG_PROJECT}" - cd "${EHG_STORE_DIR}/${EHG_PROJECT}" || \ + pushd "${EHG_STORE_DIR}/${EHG_PROJECT}" > /dev/null || \ die "failed to cd to ${EHG_STORE_DIR}/${EHG_PROJECT}" # Clone/update repository: @@ -122,12 +122,13 @@ mercurial_fetch() { rm -rf "${module}" die "failed to clone ${EHG_REPO_URI}" } - cd "${module}" elif [[ -z "${EHG_OFFLINE}" ]]; then einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}" - cd "${module}" || die "failed to cd to ${module}" + pushd "${module}" > /dev/null || die "failed to cd to ${module}" ${EHG_PULL_CMD} "${EHG_REPO_URI}" || die "update failed" + popd > /dev/null || die fi + popd > /dev/null || die # Checkout working copy: einfo "Creating working directory in ${sourcedir} (target revision: ${EHG_REVISION})" -- cgit v1.2.3-65-gdbad