diff options
author | Ulrich Müller <ulm@gentoo.org> | 2021-09-25 14:02:55 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2021-09-27 18:54:45 +0200 |
commit | a3687ce0d23feec413a41b7d06b91292224919ac (patch) | |
tree | 23affe3ca0e4abccae368aca8f3ad758fb33a25f /eclass/bzr.eclass | |
parent | bzr.eclass: Fix EBZR_OFFLINE logic (diff) | |
download | gentoo-a3687ce0d23feec413a41b7d06b91292224919ac.tar.gz gentoo-a3687ce0d23feec413a41b7d06b91292224919ac.tar.bz2 gentoo-a3687ce0d23feec413a41b7d06b91292224919ac.zip |
bzr.eclass: Don't rely on sandbox internals
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/bzr.eclass')
-rw-r--r-- | eclass/bzr.eclass | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index de73aed7f676..5dd5d40c13fa 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -201,16 +201,16 @@ _bzr_update() { # bzr branch or bzr pull, depending on whether there is an existing # working copy. bzr_fetch() { - local repo_dir branch_dir - local save_sandbox_write=${SANDBOX_WRITE} save_umask + local repo_dir branch_dir save_umask [[ -n ${EBZR_REPO_URI} ]] || die "${ECLASS}: EBZR_REPO_URI is empty" - if [[ ! -d ${EBZR_STORE_DIR} ]] ; then - addwrite / - mkdir -p "${EBZR_STORE_DIR}" \ - || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}" - SANDBOX_WRITE=${save_sandbox_write} + if [[ ! -d ${EBZR_STORE_DIR} ]]; then + ( + addwrite / + mkdir -p "${EBZR_STORE_DIR}" \ + || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}" + ) fi pushd "${EBZR_STORE_DIR}" > /dev/null \ @@ -220,7 +220,7 @@ bzr_fetch() { branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}} if [[ -n ${EVCS_UMASK} ]]; then - save_umask=$(umask) + save_umask=$(umask) || die umask "${EVCS_UMASK}" || die fi addwrite "${EBZR_STORE_DIR}" @@ -248,8 +248,6 @@ bzr_fetch() { _bzr_update "${EBZR_REPO_URI}" "${branch_dir}" fi - # Restore sandbox environment and umask - SANDBOX_WRITE=${save_sandbox_write} if [[ -n ${save_umask} ]]; then umask "${save_umask}" || die fi |