Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/2] git-r3.eclass: Print possible override vars for user convenience
Date: Sat, 15 Sep 2018 15:54:22
Message-Id: 20180915155409.10368-1-mgorny@gentoo.org
1 ---
2 eclass/git-r3.eclass | 12 +++++++++++-
3 1 file changed, 11 insertions(+), 1 deletion(-)
4
5 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
6 index 48fac96ee358..3c09b6682ef5 100644
7 --- a/eclass/git-r3.eclass
8 +++ b/eclass/git-r3.eclass
9 @@ -586,6 +586,8 @@ git-r3_fetch() {
10 local -x GIT_DIR
11 _git-r3_set_gitdir "${repos[0]}"
12
13 + einfo "Repository id: ${GIT_DIR##*/}"
14 +
15 # prepend the local mirror if applicable
16 if [[ ${EGIT_MIRROR_URI} ]]; then
17 repos=(
18 @@ -618,10 +620,11 @@ git-r3_fetch() {
19 COMMIT_DATE:commit_date
20 )
21
22 - local localvar livevar live_warn=
23 + local localvar livevar live_warn= override_vars=()
24 for localvar in "${varmap[@]}"; do
25 livevar=EGIT_OVERRIDE_${localvar%:*}_${override_name}
26 localvar=${localvar#*:}
27 + override_vars+=( "${livevar}" )
28
29 if [[ -n ${!livevar} ]]; then
30 [[ ${localvar} == repos ]] && repos=()
31 @@ -633,6 +636,13 @@ git-r3_fetch() {
32
33 if [[ ${live_warn} ]]; then
34 ewarn "No support will be provided."
35 + else
36 + einfo "To override fetched repository properties, use:"
37 + local x
38 + for x in "${override_vars[@]}"; do
39 + einfo " ${x}"
40 + done
41 + einfo
42 fi
43 fi
44
45 --
46 2.19.0

Replies