• [gentoo-dev] [PATCH] go-module.eclass: add helper function to call go

    From William Hubbs@21:1/5 to All on Tue Feb 22 17:00:01 2022
    This function will cause the ebuild to die if Go fails.
    Also, it outputs the go command that is being run.

    Closes: https://bugs.gentoo.org/833497
    ---
    eclass/go-module.eclass | 13 +++++++++++++
    1 file changed, 13 insertions(+)

    diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
    index 53f4a026942..66fe52c9ad7 100644
    --- a/eclass/go-module.eclass
    +++ b/eclass/go-module.eclass
    @@ -184,6 +184,19 @@ declare -A -g _GOMODULE_GOSUM_REVERSE_MAP
    # If you enable GO_OPTIONAL, you have to set BDEPEND on >=dev-lang/go-1.12
    # for your package and call go-module_src_unpack manually.

    +# @FUNCTION: ego
    +# @USAGE: [<args>...]
    +# @DESCRIPTION:
    +# Call go, passing the supplied arguments.
    +# This function dies if go fails. It also supports being called via 'nonfatal'.
    +# If you need to call go directly in your ebuilds, this is the way it
    +# should be done.
    +ego() {
    + set -- go "$@"
    + echo "$@" >&2
    + "$@" || die -n "${*} failed"
    +}
    +
    # @FUNCTION: go-module_set_globals
    # @DESCRIPTION:
    # Convert the information in EGO_SUM for other usage in the ebuild.
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/
  • From William Hubbs@21:1/5 to All on Sat Feb 26 04:50:01 2022
    This is in the tree.

    Thanks,

    William

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQTVeuxEZo4uUHOkQAluVBb0MMRlOAUCYhmiMQAKCRBuVBb0MMRl OJN6AJ4nnAjsX7niBdCqHHX2PxyIpu9JuQCcC58fdtAKj1Un5sRp6znZrIR5c6s=
    =pXSO
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)