* [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
@ 2021-07-06 21:59 William Hubbs
2021-07-06 22:04 ` Sam James
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: William Hubbs @ 2021-07-06 21:59 UTC (permalink / raw
To: gentoo-dev; +Cc: sam, William Hubbs
Change the _R0 suffix on these variable names to _ECLASS.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/lua-single.eclass | 8 ++++----
eclass/lua-utils.eclass | 8 ++++----
eclass/lua.eclass | 8 ++++----
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/eclass/lua-single.eclass b/eclass/lua-single.eclass
index ab4fdb3c75a..8b3692b2f18 100644
--- a/eclass/lua-single.eclass
+++ b/eclass/lua-single.eclass
@@ -68,9 +68,9 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_SINGLE_R0} ]]; then
+if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
-if [[ ${_LUA_R0} ]]; then
+if [[ ${_LUA_ECLASS} ]]; then
die 'lua-single.eclass cannot be used with lua.eclass.'
fi
@@ -275,7 +275,7 @@ _lua_single_set_globals() {
_lua_single_set_globals
unset -f _lua_single_set_globals
-if [[ ! ${_LUA_SINGLE_R0} ]]; then
+if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
# @FUNCTION: _lua_gen_usedep
# @USAGE: [<pattern>...]
@@ -531,5 +531,5 @@ lua-single_pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] && lua_setup
}
-_LUA_SINGLE_R0=1
+_LUA_SINGLE_ECLASS=1
fi
diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 278bbca58a3..52ba290e544 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -23,7 +23,7 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_UTILS_R0} ]]; then
+if [[ ! ${_LUA_UTILS_ECLASS} ]]; then
inherit toolchain-funcs
@@ -376,7 +376,7 @@ lua_enable_tests() {
busted)
test_directory="${2:-spec}"
test_pkg="dev-lua/busted"
- if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
eval "lua_src_test() {
busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\"
}"
@@ -395,7 +395,7 @@ lua_enable_tests() {
local test_deps=${RDEPEND}
if [[ -n ${test_pkg} ]]; then
- if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
else
test_deps+=" $(lua_gen_cond_dep "
@@ -528,5 +528,5 @@ lua_get_version() {
echo "${LUA_VERSION}"
}
-_LUA_UTILS_R0=1
+_LUA_UTILS_ECLASS=1
fi
diff --git a/eclass/lua.eclass b/eclass/lua.eclass
index e9a5c117560..d6fe7201779 100644
--- a/eclass/lua.eclass
+++ b/eclass/lua.eclass
@@ -56,9 +56,9 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_R0} ]]; then
+if [[ ! ${_LUA_ECLASS} ]]; then
-if [[ ${_LUA_SINGLE_R0} ]]; then
+if [[ ${_LUA_SINGLE_ECLASS} ]]; then
die 'lua.eclass cannot be used with lua-single.eclass.'
fi
@@ -196,7 +196,7 @@ fi
# lua_targets_lua5-1(-)?,lua_targets_lua5-2(-)?
# @CODE
-if [[ ! ${_LUA_R0} ]]; then
+if [[ ! ${_LUA_ECLASS} ]]; then
# @FUNCTION: _lua_validate_useflags
# @INTERNAL
@@ -313,7 +313,7 @@ lua_foreach_impl() {
multibuild_foreach_variant _lua_multibuild_wrapper "${@}"
}
-_LUA_R0=1
+_LUA_ECLASS=1
fi
# @FUNCTION: _lua_set_globals
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-06 21:59 [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables William Hubbs
@ 2021-07-06 22:04 ` Sam James
2021-07-07 6:31 ` Ulrich Mueller
2021-07-07 12:34 ` Marek Szuba
2 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2021-07-06 22:04 UTC (permalink / raw
To: gentoo-dev; +Cc: William Hubbs
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
> On 6 Jul 2021, at 22:59, William Hubbs <williamh@gentoo.org> wrote:
>
> Change the _R0 suffix on these variable names to _ECLASS.
> Signed-off-by: William Hubbs <williamh@gentoo.org>
Seems good, thanks William!
> [snip]
best,
sam
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 614 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-06 21:59 [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables William Hubbs
2021-07-06 22:04 ` Sam James
@ 2021-07-07 6:31 ` Ulrich Mueller
2021-07-07 12:34 ` Marek Szuba
2 siblings, 0 replies; 8+ messages in thread
From: Ulrich Mueller @ 2021-07-07 6:31 UTC (permalink / raw
To: William Hubbs; +Cc: gentoo-dev, sam
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
>>>>> On Tue, 06 Jul 2021, William Hubbs wrote:
> -_LUA_SINGLE_R0=1
> +_LUA_SINGLE_ECLASS=1
> fi
These should be assigned immediately after the test near the top of the
eclass, before any inherit statement. Otherwise, circular inheritance
won't be prevented.
Ulrich
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-06 21:59 [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables William Hubbs
2021-07-06 22:04 ` Sam James
2021-07-07 6:31 ` Ulrich Mueller
@ 2021-07-07 12:34 ` Marek Szuba
2 siblings, 0 replies; 8+ messages in thread
From: Marek Szuba @ 2021-07-07 12:34 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 168 bytes --]
On 2021-07-06 22:59, William Hubbs wrote:
> Change the _R0 suffix on these variable names to _ECLASS.
Any non-cosmetic reasons for doing this?
--
Marecki
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
@ 2021-07-10 21:55 William Hubbs
2021-07-12 10:24 ` Marek Szuba
0 siblings, 1 reply; 8+ messages in thread
From: William Hubbs @ 2021-07-10 21:55 UTC (permalink / raw
To: gentoo-dev; +Cc: William Hubbs
Change the _R0 suffix on these variable names to _ECLASS.
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
eclass/lua-single.eclass | 10 +++-------
eclass/lua-utils.eclass | 8 ++++----
eclass/lua.eclass | 12 +++++-------
3 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/eclass/lua-single.eclass b/eclass/lua-single.eclass
index ab4fdb3c75a..5e1ee936c12 100644
--- a/eclass/lua-single.eclass
+++ b/eclass/lua-single.eclass
@@ -68,16 +68,15 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_SINGLE_R0} ]]; then
+if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
+_LUA_SINGLE_ECLASS=1
-if [[ ${_LUA_R0} ]]; then
+if [[ ${_LUA_ECLASS} ]]; then
die 'lua-single.eclass cannot be used with lua.eclass.'
fi
inherit lua-utils
-fi
-
EXPORT_FUNCTIONS pkg_setup
# @ECLASS-VARIABLE: LUA_COMPAT
@@ -275,8 +274,6 @@ _lua_single_set_globals() {
_lua_single_set_globals
unset -f _lua_single_set_globals
-if [[ ! ${_LUA_SINGLE_R0} ]]; then
-
# @FUNCTION: _lua_gen_usedep
# @USAGE: [<pattern>...]
# @INTERNAL
@@ -531,5 +528,4 @@ lua-single_pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] && lua_setup
}
-_LUA_SINGLE_R0=1
fi
diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 278bbca58a3..52ba290e544 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -23,7 +23,7 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_UTILS_R0} ]]; then
+if [[ ! ${_LUA_UTILS_ECLASS} ]]; then
inherit toolchain-funcs
@@ -376,7 +376,7 @@ lua_enable_tests() {
busted)
test_directory="${2:-spec}"
test_pkg="dev-lua/busted"
- if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
eval "lua_src_test() {
busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\"
}"
@@ -395,7 +395,7 @@ lua_enable_tests() {
local test_deps=${RDEPEND}
if [[ -n ${test_pkg} ]]; then
- if [[ ! ${_LUA_SINGLE_R0} ]]; then
+ if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
else
test_deps+=" $(lua_gen_cond_dep "
@@ -528,5 +528,5 @@ lua_get_version() {
echo "${LUA_VERSION}"
}
-_LUA_UTILS_R0=1
+_LUA_UTILS_ECLASS=1
fi
diff --git a/eclass/lua.eclass b/eclass/lua.eclass
index e9a5c117560..3b0816f9834 100644
--- a/eclass/lua.eclass
+++ b/eclass/lua.eclass
@@ -56,9 +56,10 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LUA_R0} ]]; then
+if [[ ! ${_LUA_ECLASS} ]]; then
+_LUA_ECLASS=1
-if [[ ${_LUA_SINGLE_R0} ]]; then
+if [[ ${_LUA_SINGLE_ECLASS} ]]; then
die 'lua.eclass cannot be used with lua-single.eclass.'
fi
@@ -196,8 +197,6 @@ fi
# lua_targets_lua5-1(-)?,lua_targets_lua5-2(-)?
# @CODE
-if [[ ! ${_LUA_R0} ]]; then
-
# @FUNCTION: _lua_validate_useflags
# @INTERNAL
# @DESCRIPTION:
@@ -313,9 +312,6 @@ lua_foreach_impl() {
multibuild_foreach_variant _lua_multibuild_wrapper "${@}"
}
-_LUA_R0=1
-fi
-
# @FUNCTION: _lua_set_globals
# @INTERNAL
# @DESCRIPTION:
@@ -374,3 +370,5 @@ _lua_set_globals() {
_lua_set_globals
unset -f _lua_set_globals
+
+fi
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-10 21:55 William Hubbs
@ 2021-07-12 10:24 ` Marek Szuba
2021-07-13 17:35 ` William Hubbs
0 siblings, 1 reply; 8+ messages in thread
From: Marek Szuba @ 2021-07-12 10:24 UTC (permalink / raw
To: gentoo-dev, William Hubbs
[-- Attachment #1.1: Type: text/plain, Size: 274 bytes --]
On 2021-07-10 22:55, William Hubbs wrote:
> Change the _R0 suffix on these variable names to _ECLASS.
Since my question in response to the previous round of this has yet to
be answered, I repeat: are there any non-cosmetic reasons for doing this?
--
Marecki
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-12 10:24 ` Marek Szuba
@ 2021-07-13 17:35 ` William Hubbs
2021-07-14 11:18 ` Marek Szuba
0 siblings, 1 reply; 8+ messages in thread
From: William Hubbs @ 2021-07-13 17:35 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
On Mon, Jul 12, 2021 at 11:24:42AM +0100, Marek Szuba wrote:
> On 2021-07-10 22:55, William Hubbs wrote:
>
> > Change the _R0 suffix on these variable names to _ECLASS.
>
> Since my question in response to the previous round of this has yet to
> be answered, I repeat: are there any non-cosmetic reasons for doing this?
Consistency with the rest of the tree. If you do a "git grep _R0" on the
eclass directory, the lua eclasses are the only ones that have this in
the names of the guard variables, and the eclasses themselves aren't
named lua-r0.eclass etc.
What will break if I do this?
William
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables
2021-07-13 17:35 ` William Hubbs
@ 2021-07-14 11:18 ` Marek Szuba
0 siblings, 0 replies; 8+ messages in thread
From: Marek Szuba @ 2021-07-14 11:18 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 1061 bytes --]
On 2021-07-13 18:35, William Hubbs wrote:
>> are there any non-cosmetic reasons for doing this?
>>
> Consistency with the rest of the tree. If you do a "git grep _R0" on the
> eclass directory, the lua eclasses are the only ones that have this in
> the names of the guard variables, and the eclasses themselves aren't
> named lua-r0.eclass etc.
>
> What will break if I do this?
Nothing should, given that eclass guard variables should have no
interactions with anything other than respective eclasses themselves. Of
course that means this change *is* purely cosmetic... especially
considering that while _FOO_ECLASS is currently the most common format
in the tree it is by no means the only one, and that revision 0 is
technically speaking a real thing that we just happen to treat as
default and omit from names for brevity.
I've got no preference either way as long as guard variables can easily
be searched for in eclass code, so if you haven't got anything more
important to work on in Gentoo go ahead.
--
Marecki
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-07-14 11:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-06 21:59 [gentoo-dev] [PATCH] lua*.eclass: standardize the guard variables William Hubbs
2021-07-06 22:04 ` Sam James
2021-07-07 6:31 ` Ulrich Mueller
2021-07-07 12:34 ` Marek Szuba
-- strict thread matches above, loose matches on Subject: below --
2021-07-10 21:55 William Hubbs
2021-07-12 10:24 ` Marek Szuba
2021-07-13 17:35 ` William Hubbs
2021-07-14 11:18 ` Marek Szuba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox