commit:     28fd92fe913eea196eab39b188b0788463c924d0
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Wed May 26 00:41:31 2021 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed May 26 00:41:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28fd92fe

go-module.eclass: fix GOPROXY export

This variable should be exported in the go-module_set_globals function
since it is not needed unless EGO_SUM is used.

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 eclass/go-module.eclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
index c9a7ab12eaf..9d64ad48b43 100644
--- a/eclass/go-module.eclass
+++ b/eclass/go-module.eclass
@@ -232,6 +232,9 @@ go-module_set_globals() {
        readonly EGO_SUM_SRC_URI
        readonly _GOMODULE_GOSUM_REVERSE_MAP
 
+       # export the GOPROXY setting
+       export GOPROXY="file://${T}/go-proxy"
+
        # Set the guard that we are safe
        _GO_MODULE_SET_GLOBALS_CALLED=1
 }
@@ -268,7 +271,7 @@ _go-module_src_unpack_gosum() {
                die "go-module_set_globals must be called in global scope"
        fi
 
-       local goproxy_dir="${T}/go-proxy"
+       local goproxy_dir="${GOPROXY/file:\/\//}"
        mkdir -p "${goproxy_dir}" || die
 
        # For each Golang module distfile, look up where it's supposed to go, 
and
@@ -293,7 +296,6 @@ _go-module_src_unpack_gosum() {
                        unpack "$f"
                fi
        done
-       export GOPROXY="file://${goproxy_dir}"
 
        # Validate the gosum now
        _go-module_src_unpack_verify_gosum

Reply via email to