commit:     74f28291906447d61a67d182322d4a5d031a3c0d
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 20 20:45:53 2015 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Sun Dec 20 20:48:20 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74f28291

mercurial.eclass: leave unchanged working dir

Gentoo-bug: 568892

 eclass/mercurial.eclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/mercurial.eclass b/eclass/mercurial.eclass
index f58335a..bf85aaa 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})"

Reply via email to