Mailing List Archive

[PATCH 2/3] texlive-common.eclass: check exit status of texmf-update
The texlive eclasses where traditionally lenient when it comes to the
exit status of texmf-update and fmtutil-sys, as they would return a
non-zero exit status in certain situations, especially when bootstraping
the texlive installation, i.e., when texlive-core is installed.

With the upcoming Texlive 2023 bbump we can make this more strict,
having texlive-core use nonfatal.

Signed-off-by: Florian Schmaus <flow@gentoo.org>
---
eclass/texlive-common.eclass | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass
index fab6ff66ecd5..96e962cb8027 100644
--- a/eclass/texlive-common.eclass
+++ b/eclass/texlive-common.eclass
@@ -178,6 +178,10 @@ etexmf-update() {
if has_version 'app-text/texlive-core' ; then
if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then
"${EPREFIX}"/usr/sbin/texmf-update
+ local res="${?}"
+ if [[ "${?}" -ne 0 ]] && ver_test -ge 2023; then
+ die -n "texmf-update returned non-zero exit status ${res}"
+ fi
else
ewarn "Cannot run texmf-update for some reason."
ewarn "Your texmf tree might be inconsistent with your configuration"
--
2.43.0
Re: [PATCH 2/3] texlive-common.eclass: check exit status of texmf-update [ In reply to ]
>>>>> On Thu, 29 Feb 2024, Florian Schmaus wrote:

> @@ -178,6 +178,10 @@ etexmf-update() {
> if has_version 'app-text/texlive-core' ; then
> if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then
> "${EPREFIX}"/usr/sbin/texmf-update
> + local res="${?}"
> + if [[ "${?}" -ne 0 ]] && ver_test -ge 2023; then

This condition will always be false.

Ulrich
Re: [PATCH 2/3] texlive-common.eclass: check exit status of texmf-update [ In reply to ]
On 29/02/2024 21.40, Ulrich Mueller wrote:
>>>>>> On Thu, 29 Feb 2024, Florian Schmaus wrote:
>
>> @@ -178,6 +178,10 @@ etexmf-update() {
>> if has_version 'app-text/texlive-core' ; then
>> if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then
>> "${EPREFIX}"/usr/sbin/texmf-update
>> + local res="${?}"
>> + if [[ "${?}" -ne 0 ]] && ver_test -ge 2023; then
>
> This condition will always be false.

Is it because assigning 'res' will set '$?'?

- Flow
Re: [PATCH 2/3] texlive-common.eclass: check exit status of texmf-update [ In reply to ]
>>>>> On Fri, 01 Mar 2024, Florian Schmaus wrote:

> On 29/02/2024 21.40, Ulrich Mueller wrote:
>>>>>>> On Thu, 29 Feb 2024, Florian Schmaus wrote:
>>
>>> @@ -178,6 +178,10 @@ etexmf-update() {
>>> if has_version 'app-text/texlive-core' ; then
>>> if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then
>>> "${EPREFIX}"/usr/sbin/texmf-update
>>> + local res="${?}"
>>> + if [[ "${?}" -ne 0 ]] && ver_test -ge 2023; then
>> This condition will always be false.

> Is it because assigning 'res' will set '$?'?

Yes, the local command will return success status. So you should check
for ${res} not $?.

Ulrich