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:32
Message-Id: 1632761684.699e0a16bba414b6796db8db341df102e66072ac.ulm@gentoo
1 commit: 699e0a16bba414b6796db8db341df102e66072ac
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 11:56:21 2021 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 27 16:54:44 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=699e0a16
7
8 bzr.eclass: Names of internal functions, eclassdoc, messages
9
10 This should not make any functional difference.
11
12 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
13
14 eclass/bzr.eclass | 47 +++++++++++++++++++++++++----------------------
15 1 file changed, 25 insertions(+), 22 deletions(-)
16
17 diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
18 index e76af5d41d5..d5ac999aeb8 100644
19 --- a/eclass/bzr.eclass
20 +++ b/eclass/bzr.eclass
21 @@ -19,11 +19,9 @@
22 # Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack()
23 # of this eclass will export the branch to ${WORKDIR}/${P}.
24
25 -EBZR="bzr.eclass"
26 -
27 case ${EAPI} in
28 7|8) ;;
29 - *) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;;
30 + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
31 esac
32
33 PROPERTIES+=" live"
34 @@ -33,6 +31,7 @@ BDEPEND="dev-vcs/breezy"
35 EXPORT_FUNCTIONS src_unpack
36
37 # @ECLASS-VARIABLE: EBZR_STORE_DIR
38 +# @USER_VARIABLE
39 # @DESCRIPTION:
40 # The directory to store all fetched Bazaar live sources.
41 : ${EBZR_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/bzr-src}
42 @@ -125,6 +124,7 @@ EXPORT_FUNCTIONS src_unpack
43 # Revision to fetch, defaults to the latest (see brz help revisionspec).
44
45 # @ECLASS-VARIABLE: EBZR_OFFLINE
46 +# @USER_VARIABLE
47 # @DESCRIPTION:
48 # Set this variable to a non-empty value to disable automatic updating
49 # of a bzr source tree. This is intended to be set outside the ebuild
50 @@ -132,6 +132,7 @@ EXPORT_FUNCTIONS src_unpack
51 : ${EBZR_OFFLINE=${EVCS_OFFLINE}}
52
53 # @ECLASS-VARIABLE: EVCS_UMASK
54 +# @USER_VARIABLE
55 # @DEFAULT_UNSET
56 # @DESCRIPTION:
57 # Set this variable to a custom umask. This is intended to be set by
58 @@ -148,12 +149,13 @@ EXPORT_FUNCTIONS src_unpack
59 # If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will
60 # be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR.
61
62 -# @FUNCTION: bzr_initial_fetch
63 +# @FUNCTION: _bzr_initial_fetch
64 # @USAGE: <repository URI> <branch directory>
65 +# @INTERNAL
66 # @DESCRIPTION:
67 # Internal function, retrieves the source code from a repository for the
68 # first time, using ${EBZR_FETCH_CMD}.
69 -bzr_initial_fetch() {
70 +_bzr_initial_fetch() {
71 local repo_uri=$1 branch_dir=$2
72
73 if [[ -n "${EBZR_OFFLINE}" ]]; then
74 @@ -165,15 +167,16 @@ bzr_initial_fetch() {
75 einfo " repository: ${repo_uri} => ${branch_dir}"
76
77 ${EBZR_FETCH_CMD} ${EBZR_OPTIONS} "${repo_uri}" "${branch_dir}" \
78 - || die "${EBZR}: can't branch from ${repo_uri}"
79 + || die "${ECLASS}: can't branch from ${repo_uri}"
80 }
81
82 -# @FUNCTION: bzr_update
83 +# @FUNCTION: _bzr_update
84 # @USAGE: <repository URI> <branch directory>
85 +# @INTERNAL
86 # @DESCRIPTION:
87 # Internal function, updates the source code from a repository, using
88 # ${EBZR_UPDATE_CMD}.
89 -bzr_update() {
90 +_bzr_update() {
91 local repo_uri=$1 branch_dir=$2
92
93 if [[ -n "${EBZR_OFFLINE}" ]]; then
94 @@ -185,10 +188,10 @@ bzr_update() {
95 einfo " repository: ${repo_uri}"
96
97 pushd "${branch_dir}" > /dev/null \
98 - || die "${EBZR}: can't chdir to ${branch_dir}"
99 + || die "${ECLASS}: can't chdir to ${branch_dir}"
100 ${EBZR_UPDATE_CMD} ${EBZR_OPTIONS} "${repo_uri}" \
101 - || die "${EBZR}: can't pull from ${repo_uri}"
102 - popd > /dev/null || die "${EBZR}: popd failed"
103 + || die "${ECLASS}: can't pull from ${repo_uri}"
104 + popd > /dev/null || die "${ECLASS}: popd failed"
105 fi
106 }
107
108 @@ -201,17 +204,17 @@ bzr_fetch() {
109 local repo_dir branch_dir
110 local save_sandbox_write=${SANDBOX_WRITE} save_umask
111
112 - [[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty"
113 + [[ -n ${EBZR_REPO_URI} ]] || die "${ECLASS}: EBZR_REPO_URI is empty"
114
115 if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
116 addwrite /
117 mkdir -p "${EBZR_STORE_DIR}" \
118 - || die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}"
119 + || die "${ECLASS}: can't mkdir ${EBZR_STORE_DIR}"
120 SANDBOX_WRITE=${save_sandbox_write}
121 fi
122
123 pushd "${EBZR_STORE_DIR}" > /dev/null \
124 - || die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}"
125 + || die "${ECLASS}: can't chdir to ${EBZR_STORE_DIR}"
126
127 repo_dir=${EBZR_STORE_DIR}/${EBZR_PROJECT}
128 branch_dir=${repo_dir}${EBZR_BRANCH:+/${EBZR_BRANCH}}
129 @@ -226,16 +229,16 @@ bzr_fetch() {
130 if [[ ${repo_dir} != "${branch_dir}" && ! -d ${repo_dir}/.bzr ]]; then
131 einfo "creating shared bzr repository: ${repo_dir}"
132 ${EBZR_INIT_REPO_CMD} "${repo_dir}" \
133 - || die "${EBZR}: can't create shared repository"
134 + || die "${ECLASS}: can't create shared repository"
135 fi
136
137 if [[ -z ${EBZR_INITIAL_URI} ]]; then
138 - bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
139 + _bzr_initial_fetch "${EBZR_REPO_URI}" "${branch_dir}"
140 else
141 # Workaround for faster initial download. This clones the
142 # branch from a fast server (which may be out of date), and
143 # subsequently pulls from the slow original repository.
144 - bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
145 + _bzr_initial_fetch "${EBZR_INITIAL_URI}" "${branch_dir}"
146 if [[ ${EBZR_REPO_URI} != "${EBZR_INITIAL_URI}" ]]; then
147 EBZR_UPDATE_CMD="${EBZR_UPDATE_CMD} --remember --overwrite" \
148 EBZR_OFFLINE="" \
149 @@ -243,7 +246,7 @@ bzr_fetch() {
150 fi
151 fi
152 else
153 - bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
154 + _bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
155 fi
156
157 # Restore sandbox environment and umask
158 @@ -252,7 +255,7 @@ bzr_fetch() {
159 umask "${save_umask}" || die
160 fi
161
162 - cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
163 + cd "${branch_dir}" || die "${ECLASS}: can't chdir to ${branch_dir}"
164
165 # Save revision number in environment. #311101
166 export EBZR_REVNO=$(${EBZR_REVNO_CMD})
167 @@ -260,16 +263,16 @@ bzr_fetch() {
168 if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then
169 einfo "checking out ..."
170 ${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
171 - . "${EBZR_UNPACK_DIR}" || die "${EBZR}: checkout failed"
172 + . "${EBZR_UNPACK_DIR}" || die "${ECLASS}: checkout failed"
173 else
174 einfo "exporting ..."
175 ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
176 - "${EBZR_UNPACK_DIR}" . || die "${EBZR}: export failed"
177 + "${EBZR_UNPACK_DIR}" . || die "${ECLASS}: export failed"
178 fi
179 einfo \
180 "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${EBZR_UNPACK_DIR}"
181
182 - popd > /dev/null || die "${EBZR}: popd failed"
183 + popd > /dev/null || die "${ECLASS}: popd failed"
184 }
185
186 # @FUNCTION: bzr_src_unpack