From: "Ulrich Müller" <ulm@gentoo.org>
To: Florian Schmaus <flow@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org, tex@gentoo.org
Subject: Re: [gentoo-dev] [PATCH] texlive-module.eclass: use pipestatus
Date: Wed, 11 Dec 2024 11:54:09 +0100 [thread overview]
Message-ID: <u4j3atrqm@gentoo.org> (raw)
In-Reply-To: <20241211085758.116168-1-flow@gentoo.org> (Florian Schmaus's message of "Wed, 11 Dec 2024 09:57:58 +0100")
[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]
>>>>> On Wed, 11 Dec 2024, Florian Schmaus wrote:
> --- a/eclass/texlive-module.eclass
> +++ b/eclass/texlive-module.eclass
> @@ -79,7 +79,7 @@ esac
> if [[ -z ${_TEXLIVE_MODULE_ECLASS} ]]; then
> _TEXLIVE_MODULE_ECLASS=1
>
> -inherit texlive-common
> +inherit eapi9-pipestatus texlive-common
>
> HOMEPAGE="https://www.tug.org/texlive/"
>
> @@ -537,16 +537,15 @@ texlive-module_src_install() {
> grep_expressions+=(-e "/${f//./\\.}\$")
> done
>
> + local status
> + # "success-status aware grep", returning exit status 0 instead of 1.
> + sgrep() { grep "$@"; return "$(( $? <= 1 ? 0 : $? ))"; }
"sgrep" is rather generic as a function name and prone to name clashes.
I suggest "_tl_grep" instead.
> ebegin "Installing man pages"
> find texmf-dist/doc/man -type f -name '*.[0-9n]' -print |
> - grep -v "${grep_expressions[@]}" |
> + sgrep -v "${grep_expressions[@]}" |
> xargs -d '\n' --no-run-if-empty nonfatal doman
> - local pipestatus="${PIPESTATUS[*]}"
> - # The grep in the middle of the pipe may return 1 in case
> - # everything from the input is dropped.
> - # See https://bugs.gentoo.org/931994
> - [[ ${pipestatus} == "0 "[01]" 0" ]]
> - eend $? || die "error installing man pages (pipestatus: ${pipestatus})"
> + status=$(pipestatus -v)
> + eend $? || die "error installing man pages (PIPESTATUS: ${status})"
>
> # Delete all man pages under texmf-dist/doc/man
> find texmf-dist/doc/man -type f -name '*.[0-9n]' -delete ||
Otherwise LGTM.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
prev parent reply other threads:[~2024-12-11 10:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 8:57 [gentoo-dev] [PATCH] texlive-module.eclass: use pipestatus Florian Schmaus
2024-12-11 10:54 ` Ulrich Müller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u4j3atrqm@gentoo.org \
--to=ulm@gentoo.org \
--cc=flow@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=tex@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox