Mailing List Archive

[PATCH 1/3] lua-single.eclass: clean up the eapi test
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/lua-single.eclass | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/eclass/lua-single.eclass b/eclass/lua-single.eclass
index 7abe1eb6674..3d7ef974bef 100644
--- a/eclass/lua-single.eclass
+++ b/eclass/lua-single.eclass
@@ -63,13 +63,10 @@
# @CODE

case ${EAPI:-0} in
- 0|1|2|3|4|5|6)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
- ;;
7|8)
;;
*)
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+ die "Unsupported EAPI=${EAPI} for ${ECLASS}"
;;
esac

--
2.31.1
Re: [PATCH 1/3] lua-single.eclass: clean up the eapi test [ In reply to ]
>>>>> On Fri, 02 Jul 2021, William Hubbs wrote:

> case ${EAPI:-0} in

This could be just ${EAPI}.

> - 0|1|2|3|4|5|6)
> - die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
> - ;;
> 7|8)
> ;;
> *)
> - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
> + die "Unsupported EAPI=${EAPI} for ${ECLASS}"
> ;;

May I suggest that we standardise the error message? Many eclasses have
this (see for example toolchain-funcs.eclass):

*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;

> esac

Same for the other two eclasses.

Ulrich
[PATCH 1/3] lua-single.eclass: clean up the eapi test [ In reply to ]
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/lua-single.eclass | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/eclass/lua-single.eclass b/eclass/lua-single.eclass
index 7abe1eb6674..ab4fdb3c75a 100644
--- a/eclass/lua-single.eclass
+++ b/eclass/lua-single.eclass
@@ -62,15 +62,10 @@
# }
# @CODE

-case ${EAPI:-0} in
- 0|1|2|3|4|5|6)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
- ;;
+case ${EAPI} in
7|8)
;;
- *)
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
- ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ ! ${_LUA_SINGLE_R0} ]]; then
--
2.31.1