Mailing List Archive

[PATCH] go-module.eclass: add eapi 8 support
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/go-module.eclass | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
index c11895944cd..a8a3a7e26a7 100644
--- a/eclass/go-module.eclass
+++ b/eclass/go-module.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# William Hubbs <williamh@gentoo.org>
# Robin H. Johnson <robbat2@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: basic eclass for building software written as go modules
# @DESCRIPTION:
# This eclass provides basic settings and functions needed by all software
@@ -47,7 +47,7 @@
# @CODE

case ${EAPI:-0} in
- 7) ;;
+ 7|8) ;;
*) die "${ECLASS} EAPI ${EAPI} is not supported."
esac

@@ -83,7 +83,11 @@ export GOFLAGS="-v -x -mod=readonly"
QA_FLAGS_IGNORED='.*'

# Go packages should not be stripped with strip(1).
-RESTRICT+=" strip"
+if [[ ${EAPI} == 7 ]]; then
+ RESTRICT+=" strip"
+else
+ RESTRICT=" strip"
+fi

EXPORT_FUNCTIONS src_unpack pkg_postinst

--
2.31.1
Re: [PATCH] go-module.eclass: add eapi 8 support [ In reply to ]
>>>>> On Fri, 02 Jul 2021, William Hubbs wrote:

> # Go packages should not be stripped with strip(1).
> -RESTRICT+=" strip"
> +if [[ ${EAPI} == 7 ]]; then
> + RESTRICT+=" strip"
> +else
> + RESTRICT=" strip"
> +fi

There was a previous discussion in the QA team that we shouldn't do such
changes for PROPERTIES and RESTRICT. While formally correct, they won't
improve readability.

(But if you absolutely want to change it, then the blank in the else
assignment is useless, i.e. it should be just RESTRICT="strip".)

Ulrich
[PATCH] go-module.eclass: add eapi 8 support [ In reply to ]
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/go-module.eclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
index c11895944cd..053861a1a18 100644
--- a/eclass/go-module.eclass
+++ b/eclass/go-module.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# William Hubbs <williamh@gentoo.org>
# Robin H. Johnson <robbat2@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: basic eclass for building software written as go modules
# @DESCRIPTION:
# This eclass provides basic settings and functions needed by all software
@@ -46,9 +46,9 @@
#
# @CODE

-case ${EAPI:-0} in
- 7) ;;
- *) die "${ECLASS} EAPI ${EAPI} is not supported."
+case ${EAPI} in
+ 7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_GO_MODULE} ]]; then
--
2.31.1