Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 27 Sep 2021 16:55:33
Message-Id: 1632761685.a3687ce0d23feec413a41b7d06b91292224919ac.ulm@gentoo
1 commit: a3687ce0d23feec413a41b7d06b91292224919ac
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 12:02:55 2021 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 27 16:54:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3687ce0
7
8 bzr.eclass: Don't rely on sandbox internals
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 eclass/bzr.eclass | 18 ++++++++----------
13 1 file changed, 8 insertions(+), 10 deletions(-)
14
15 diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
16 index de73aed7f67..5dd5d40c13f 100644
17 --- a/eclass/bzr.eclass
18 +++ b/eclass/bzr.eclass
19 @@ -201,16 +201,16 @@ _bzr_update() {
20 # bzr branch or bzr pull, depending on whether there is an existing
21 # working copy.
22 bzr_fetch() {
23 - local repo_dir branch_dir
24 - local save_sandbox_write=${SANDBOX_WRITE} save_umask
25 + local repo_dir branch_dir save_umask
26
27 [[ -n ${EBZR_REPO_URI} ]] || die "${ECLASS}: EBZR_REPO_URI is empty"
28
29 - if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
30 - addwrite /
31 - mkdir -p "${EBZR_STORE_DIR}" \
32 - || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}"
33 - SANDBOX_WRITE=${save_sandbox_write}
34 + if [[ ! -d ${EBZR_STORE_DIR} ]]; then
35 + (
36 + addwrite /
37 + mkdir -p "${EBZR_STORE_DIR}" \
38 + || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}"
39 + )
40 fi
41
42 pushd "${EBZR_STORE_DIR}" > /dev/null \
43 @@ -220,7 +220,7 @@ bzr_fetch() {
44 branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}}
45
46 if [[ -n ${EVCS_UMASK} ]]; then
47 - save_umask=$(umask)
48 + save_umask=$(umask) || die
49 umask "${EVCS_UMASK}" || die
50 fi
51 addwrite "${EBZR_STORE_DIR}"
52 @@ -248,8 +248,6 @@ bzr_fetch() {
53 _bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
54 fi
55
56 - # Restore sandbox environment and umask
57 - SANDBOX_WRITE=${save_sandbox_write}
58 if [[ -n ${save_umask} ]]; then
59 umask "${save_umask}" || die
60 fi