diff options
author | William Hubbs <williamh@gentoo.org> | 2020-05-10 15:34:23 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2020-06-12 15:01:39 -0500 |
commit | a8173fa13680333b65751046fea0ad807b741cfa (patch) | |
tree | 5217bce41e84a4c075d5562fb2f315c04b7205ef /eclass/go-module.eclass | |
parent | profiles/package.mask: remove go-protobuf mask (diff) | |
download | gentoo-a8173fa13680333b65751046fea0ad807b741cfa.tar.gz gentoo-a8173fa13680333b65751046fea0ad807b741cfa.tar.bz2 gentoo-a8173fa13680333b65751046fea0ad807b741cfa.zip |
eclass/go-module.eclass: remove EGO_VENDOR support
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'eclass/go-module.eclass')
-rw-r--r-- | eclass/go-module.eclass | 81 |
1 files changed, 6 insertions, 75 deletions
diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index 17d37494f15f..7b66c3e2b1ed 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.eclass @@ -120,29 +120,6 @@ EXPORT_FUNCTIONS src_unpack pkg_postinst # This decision does NOT weaken Go module security, as Go will verify the # go.sum copy of the Hash1 values during building of the package. -# @ECLASS-VARIABLE: EGO_VENDOR -# @DESCRIPTION: -# This variable is deprecated and should no longer be used. Please -# convert your ebuilds to use EGO_SUM. - -# @FUNCTION: go-module_vendor_uris -# @DESCRIPTION: -# This function is deprecated. -go-module_vendor_uris() { - local hash import line repo x - for line in "${EGO_VENDOR[@]}"; do - read -r import hash repo x <<< "${line}" - if [[ -n ${x} ]]; then - eerror "Trailing information in EGO_VENDOR in ${P}.ebuild" - eerror "${line}" - eerror "Trailing information is: \"${x}\"" - die "Invalid EGO_VENDOR format" - fi - : "${repo:=${import}}" - echo "https://${repo}/archive/${hash}.tar.gz -> ${repo//\//-}-${hash}.tar.gz" - done -} - # @ECLASS-VARIABLE: _GOMODULE_GOPROXY_BASEURI # @DESCRIPTION: # Golang module proxy service to fetch module files from. Note that the module @@ -261,17 +238,16 @@ go-module_set_globals() { # @FUNCTION: go-module_src_unpack # @DESCRIPTION: -# - If EGO_VENDOR is set, use the deprecated function to unpack the base -# tarballs and the tarballs indicated in EGO_VENDOR to the correct -# locations. -# - Otherwise, if EGO_SUM is set, unpack the base tarball(s) and set up the +# If EGO_SUM is set, unpack the base tarball(s) and set up the # local go proxy. +# - Otherwise, if EGO_VENDOR is set, bail out. # - Otherwise do a normal unpack. go-module_src_unpack() { - if [[ "${#EGO_VENDOR[@]}" -gt 0 ]]; then - _go-module_src_unpack_vendor - elif [[ "${#EGO_SUM[@]}" -gt 0 ]]; then + if [[ "${#EGO_SUM[@]}" -gt 0 ]]; then _go-module_src_unpack_gosum + elif [[ "${#EGO_VENDOR[@]}" -gt 0 ]]; then + eerror "${EBUILD} is using EGO_VENDOR which is no longer supported" + die "Please update this ebuild" else default fi @@ -350,51 +326,6 @@ _go-module_gosum_synthesize_files() { fi } -# @FUNCTION: _go-module_src_unpack_vendor -# @DESCRIPTION: -# Extract all archives in ${a} which are not nentioned in ${EGO_VENDOR} -# to their usual locations then extract all archives mentioned in -# ${EGO_VENDOR} to ${S}/vendor. -_go-module_src_unpack_vendor() { - # shellcheck disable=SC2120 - debug-print-function "${FUNCNAME}" "$@" - local f hash import line repo tarball vendor_tarballs x - vendor_tarballs=() - for line in "${EGO_VENDOR[@]}"; do - read -r import hash repo x <<< "${line}" - if [[ -n ${x} ]]; then - eerror "Trailing information in EGO_VENDOR in ${P}.ebuild" - eerror "${line}" - die "Invalid EGO_VENDOR format" - fi - : "${repo:=${import}}" - vendor_tarballs+=("${repo//\//-}-${hash}.tar.gz") - done - for f in ${A}; do - [[ -n ${vendor_tarballs[*]} ]] && has "${f}" "${vendor_tarballs[@]}" && - continue - unpack "${f}" - done - - [[ -z ${vendor_tarballs[*]} ]] && return - for line in "${EGO_VENDOR[@]}"; do - read -r import hash repo _ <<< "${line}" - : "${repo:=${import}}" - tarball=${repo//\//-}-${hash}.tar.gz - ebegin "Vendoring ${import} ${tarball}" - rm -fr "${S}/vendor/${import}" || die - mkdir -p "${S}/vendor/${import}" || die - tar -C "${S}/vendor/${import}" -x --strip-components 1 \ - -f "${DISTDIR}/${tarball}" || die - eend - done - # replace GOFLAGS if EGO_VENDOR is being used - [[ ${#EGO_VENDOR[@]} -gt 0 ]] && - GOFLAGS="-v -x -mod=vendor" - eqawarn "${P}.ebuild: EGO_VENDOR will be removed in the future." - eqawarn "Please request that the author migrate to EGO_SUM." -} - # @FUNCTION: _go-module_src_unpack_verify_gosum # @DESCRIPTION: # Validate the Go modules declared by EGO_SUM are sufficient to cover building |