public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in  JAVA_LAUNCHER_FILENAME
@ 2023-05-26  8:16 Volkmar W. Pogatzki
  2023-05-26  8:44 ` Ulrich Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Volkmar W. Pogatzki @ 2023-05-26  8:16 UTC (permalink / raw
  To: gentoo-dev

Avoids the need for setting JAVA_LAUNCHER_FILENAME="${PN}" if SLOT is 0.

Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
---
 eclass/java-pkg-simple.eclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index 929ce68c6c07..f919945280b1 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -161,7 +161,11 @@ fi
 # If ${JAVA_MAIN_CLASS} is set, we will create a launcher to
 # execute the jar, and ${JAVA_LAUNCHER_FILENAME} will be the
 # name of the script.
-: "${JAVA_LAUNCHER_FILENAME:=${PN}-${SLOT}}"
+if [[ ${SLOT} = 0 ]]; then
+	JAVA_LAUNCHER_FILENAME="${PN}"
+else
+	JAVA_LAUNCHER_FILENAME="${PN}-${SLOT}"
+fi
 
 # @ECLASS_VARIABLE: JAVA_TESTING_FRAMEWORKS
 # @DEFAULT_UNSET
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in  JAVA_LAUNCHER_FILENAME
  2023-05-26  8:16 [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in JAVA_LAUNCHER_FILENAME Volkmar W. Pogatzki
@ 2023-05-26  8:44 ` Ulrich Mueller
  2023-05-29  7:13   ` Volkmar W. Pogatzki
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Mueller @ 2023-05-26  8:44 UTC (permalink / raw
  To: Volkmar W. Pogatzki; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

>>>>> On Fri, 26 May 2023, Volkmar W Pogatzki wrote:

> -: "${JAVA_LAUNCHER_FILENAME:=${PN}-${SLOT}}"
> +if [[ ${SLOT} = 0 ]]; then
> +	JAVA_LAUNCHER_FILENAME="${PN}"
> +else
> +	JAVA_LAUNCHER_FILENAME="${PN}-${SLOT}"
> +fi

This will no longer allow overriding the variable in the ebuild
(at least not pre-inherit). Is this intentional?

Ulrich

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in JAVA_LAUNCHER_FILENAME
  2023-05-26  8:44 ` Ulrich Mueller
@ 2023-05-29  7:13   ` Volkmar W. Pogatzki
  2023-05-29  9:51     ` Ulrich Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Volkmar W. Pogatzki @ 2023-05-29  7:13 UTC (permalink / raw
  To: gentoo-dev@lists.gentoo.org

> Ulrich Mueller <ulm@gentoo.org> hat am 26.05.2023 10:44 CEST geschrieben:
> 
>  
> >>>>> On Fri, 26 May 2023, Volkmar W Pogatzki wrote:
> 
> > -: "${JAVA_LAUNCHER_FILENAME:=${PN}-${SLOT}}"
> > +if [[ ${SLOT} = 0 ]]; then
> > +	JAVA_LAUNCHER_FILENAME="${PN}"
> > +else
> > +	JAVA_LAUNCHER_FILENAME="${PN}-${SLOT}"
> > +fi
> 
> This will no longer allow overriding the variable in the ebuild
> (at least not pre-inherit). Is this intentional?
> 
> Ulrich

It exactly does what it's supposed to do.
No clue about "not pre-inherit". How to sanitize?
--
Volkmar W. Pogatzki


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in JAVA_LAUNCHER_FILENAME
  2023-05-29  7:13   ` Volkmar W. Pogatzki
@ 2023-05-29  9:51     ` Ulrich Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Mueller @ 2023-05-29  9:51 UTC (permalink / raw
  To: Volkmar W. Pogatzki; +Cc: gentoo-dev@lists.gentoo.org

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

>>>>> On Mon, 29 May 2023, Volkmar W Pogatzki wrote:

>> > -: "${JAVA_LAUNCHER_FILENAME:=${PN}-${SLOT}}"
>> > +if [[ ${SLOT} = 0 ]]; then
>> > +	JAVA_LAUNCHER_FILENAME="${PN}"
>> > +else
>> > +	JAVA_LAUNCHER_FILENAME="${PN}-${SLOT}"
>> > +fi
>> 
>> This will no longer allow overriding the variable in the ebuild
>> (at least not pre-inherit). Is this intentional?

> It exactly does what it's supposed to do.
> No clue about "not pre-inherit".

With the above, JAVA_LAUNCHER_FILENAME="foo" in the ebuild will work if
comes after the inherit line, but not if it is before it.

> How to sanitize?

As in your v2. :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-29  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26  8:16 [gentoo-dev] [PATCH] java-pkg-simple.eclass: respect SLOT="0" in JAVA_LAUNCHER_FILENAME Volkmar W. Pogatzki
2023-05-26  8:44 ` Ulrich Mueller
2023-05-29  7:13   ` Volkmar W. Pogatzki
2023-05-29  9:51     ` Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox