Mailing List Archive

[PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set
Signed-off-by: Florian Schmaus <flow@gentoo.org>
---
eclass/texlive-module.eclass | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass
index afcd4532975a..d1bf0f86185b 100644
--- a/eclass/texlive-module.eclass
+++ b/eclass/texlive-module.eclass
@@ -85,6 +85,12 @@ HOMEPAGE="https://www.tug.org/texlive/"

IUSE="doc source"

+if [[ -z ${TL_PV} ]] \
+ && [[ ${EAPI} -ge 8 ]] \
+ && [[ ${CATEGORY} == dev-texlive ]]; then
+ TL_PV=$(ver_cut 1)
+fi
+
RDEPEND=">=app-text/texlive-core-${TL_PV:-${PV}}"
# We do not need anything from SYSROOT:
# Everything is built from the texlive install in /
--
2.43.0
Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On 29/02/2024 14.38, Florian Schmaus wrote:
> Signed-off-by: Florian Schmaus <flow@gentoo.org>
> ---
> eclass/texlive-module.eclass | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass
> index afcd4532975a..d1bf0f86185b 100644
> --- a/eclass/texlive-module.eclass
> +++ b/eclass/texlive-module.eclass
> @@ -85,6 +85,12 @@ HOMEPAGE="https://www.tug.org/texlive/"
>
> IUSE="doc source"
>
> +if [[ -z ${TL_PV} ]] \
> + && [[ ${EAPI} -ge 8 ]] \

I am skeptical of this construct, as in the past we had non-numeric
EAPIs. So I may have to go with EAPI == 8 for now. Input appreciated.

- Flow
Re: Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On Thu, 2024-02-29 at 14:47 +0100, Florian Schmaus wrote:
> >
> > +if [[ -z ${TL_PV} ]] \
> > + && [[ ${EAPI} -ge 8 ]] \
>
> I am skeptical of this construct, as in the past we had non-numeric
> EAPIs. So I may have to go with EAPI == 8 for now. Input appreciated.
>


The eclass only supports EAPIs {7,8,...} so it should suffice to
blacklist EAPI=7.
Re: Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On 29/02/2024 15.08, Michael Orlitzky wrote:
> On Thu, 2024-02-29 at 14:47 +0100, Florian Schmaus wrote:
>>>
>>> +if [[ -z ${TL_PV} ]] \
>>> + && [[ ${EAPI} -ge 8 ]] \
>>
>> I am skeptical of this construct, as in the past we had non-numeric
>> EAPIs. So I may have to go with EAPI == 8 for now. Input appreciated.
>>
>
>
> The eclass only supports EAPIs {7,8,...} so it should suffice to
> blacklist EAPI=7.

Fair point, but that would mean to remember to adjust this line once the
eclass gets support for EAPI 9.

It appears that bash does the right thing:

$ if [[ "eapi-future" -gt 8 ]]; then echo "is greater than 8"; else echo
"is NOT greater than 8"; fi
is NOT greater than 8

even considering

$ if [[ "9-eapi-future" -gt 8 ]]; then echo "is greater than 8"; else
echo "is NOT greater than 8"; fi
is greater than 8

which would be fine.

Although I prefer the current approach, it is not a hill to die on for me.

- Flow
Re: Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On Thu, 2024-02-29 at 15:21 +0100, Florian Schmaus wrote:
> >
> > The eclass only supports EAPIs {7,8,...} so it should suffice to
> > blacklist EAPI=7.
>
> Fair point, but that would mean to remember to adjust this line once the
> eclass gets support for EAPI 9.
>

It should do the right thing automatically when EAPI=9 is added, no? If
the goal of "-gt 8" is to match EAPI=8 and newer, then rejecting (only)
the one EAPI that's older than 8 should be equivalent without involving
a numerical comparison.
Re: Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On 29/02/2024 15.34, Michael Orlitzky wrote:
> On Thu, 2024-02-29 at 15:21 +0100, Florian Schmaus wrote:
>>>
>>> The eclass only supports EAPIs {7,8,...} so it should suffice to
>>> blacklist EAPI=7.
>>
>> Fair point, but that would mean to remember to adjust this line once the
>> eclass gets support for EAPI 9.
>>
>
> It should do the right thing automatically when EAPI=9 is added, no? If
> the goal of "-gt 8" is to match EAPI=8 and newer, then rejecting (only)
> the one EAPI that's older than 8 should be equivalent without involving
> a numerical comparison.

Of course, you are right. Not sure how I could miss that.

I'll go with [[ ${EAPI} != 7 ]] then.

Thanks

- Flow
Re: Re: [PATCH 1/3] texlive-module.eclass: implicitly set TL_PV if not explicitly set [ In reply to ]
On Thu, 2024-02-29 at 15:21 +0100, Florian Schmaus wrote:
> On 29/02/2024 15.08, Michael Orlitzky wrote:
> > On Thu, 2024-02-29 at 14:47 +0100, Florian Schmaus wrote:
> > > >
> > > > +if [[ -z ${TL_PV} ]] \
> > > > + && [[ ${EAPI} -ge 8 ]] \
> > >
> > > I am skeptical of this construct, as in the past we had non-numeric
> > > EAPIs. So I may have to go with EAPI == 8 for now. Input appreciated.
> > >
> >
> >
> > The eclass only supports EAPIs {7,8,...} so it should suffice to
> > blacklist EAPI=7.
>
> Fair point, but that would mean to remember to adjust this line once the
> eclass gets support for EAPI 9.
>
> It appears that bash does the right thing:
>
> $ if [[ "eapi-future" -gt 8 ]]; then echo "is greater than 8"; else echo
> "is NOT greater than 8"; fi
> is NOT greater than 8
>
> even considering
>
> $ if [[ "9-eapi-future" -gt 8 ]]; then echo "is greater than 8"; else
> echo "is NOT greater than 8"; fi
> is greater than 8
>
> which would be fine.
>
> Although I prefer the current approach, it is not a hill to die on for me.
>

It is invalid to treat EAPI as an integer.

The standard practice is to explicitly list old EAPIs, so that no
changes need to preserve the new behavior for new EAPIs.

--
Best regards,
Micha? Górny