commit:     74cfb1b0d4aaba426d3edec51e5c30daf70aa25b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 15 15:51:37 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 18 06:18:59 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74cfb1b0

git-r3.eclass: Print possible override vars for user convenience

 eclass/git-r3.eclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 48fac96ee35..3c09b6682ef 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -586,6 +586,8 @@ git-r3_fetch() {
        local -x GIT_DIR
        _git-r3_set_gitdir "${repos[0]}"
 
+       einfo "Repository id: ${GIT_DIR##*/}"
+
        # prepend the local mirror if applicable
        if [[ ${EGIT_MIRROR_URI} ]]; then
                repos=(
@@ -618,10 +620,11 @@ git-r3_fetch() {
                        COMMIT_DATE:commit_date
                )
 
-               local localvar livevar live_warn=
+               local localvar livevar live_warn= override_vars=()
                for localvar in "${varmap[@]}"; do
                        livevar=EGIT_OVERRIDE_${localvar%:*}_${override_name}
                        localvar=${localvar#*:}
+                       override_vars+=( "${livevar}" )
 
                        if [[ -n ${!livevar} ]]; then
                                [[ ${localvar} == repos ]] && repos=()
@@ -633,6 +636,13 @@ git-r3_fetch() {
 
                if [[ ${live_warn} ]]; then
                        ewarn "No support will be provided."
+               else
+                       einfo "To override fetched repository properties, use:"
+                       local x
+                       for x in "${override_vars[@]}"; do
+                               einfo "  ${x}"
+                       done
+                       einfo
                fi
        fi
 

Reply via email to