From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F18BB1581F0 for ; Wed, 11 Dec 2024 10:54:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF6C6E0B35; Wed, 11 Dec 2024 10:54:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0141FE0903 for ; Wed, 11 Dec 2024 10:54:26 +0000 (UTC) From: =?utf-8?Q?Ulrich_M=C3=BCller?= To: Florian Schmaus Cc: gentoo-dev@lists.gentoo.org, tex@gentoo.org Subject: Re: [gentoo-dev] [PATCH] texlive-module.eclass: use pipestatus In-Reply-To: <20241211085758.116168-1-flow@gentoo.org> (Florian Schmaus's message of "Wed, 11 Dec 2024 09:57:58 +0100") References: <20241211085758.116168-1-flow@gentoo.org> Date: Wed, 11 Dec 2024 11:54:09 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: 8e00f0f7-ae1c-494a-8cee-e65e58f70c9c X-Archives-Hash: afdbaa9859b25c0fb555cd5494761122 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> 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=3D1 >=20=20 > -inherit texlive-common > +inherit eapi9-pipestatus texlive-common >=20=20 > HOMEPAGE=3D"https://www.tug.org/texlive/" >=20=20 > @@ -537,16 +537,15 @@ texlive-module_src_install() { > grep_expressions+=3D(-e "/${f//./\\.}\$") > done >=20=20 > + local status > + # "success-status aware grep", returning exit status 0 instead of 1. > + sgrep() { grep "$@"; return "$(( $? <=3D 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=3D"${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} =3D=3D "0 "[01]" 0" ]] > - eend $? || die "error installing man pages (pipestatus: ${pipestatus}= )" > + status=3D$(pipestatus -v) > + eend $? || die "error installing man pages (PIPESTATUS: ${status})" >=20=20 > # Delete all man pages under texmf-dist/doc/man > find texmf-dist/doc/man -type f -name '*.[0-9n]' -delete || Otherwise LGTM. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmdZb1EPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uzkEH+gM0GrVbgK5kA+/1/Lj9nyuXwYACijeinJMK YUoQhV1c36X5cSWSfnBokth914NbtHkeBboPAm/EWaBYFD1MDum7KSeJuDaXacl1 wRmkdxJlXMvv3NnnCWNb2AvjMvFq5hNXYK5pahT/nkK7TQ5/Y+U+mBsQbVco956E S8BIAJT4ocYr5yx8WRRCNtxc12+KgQuJ8i91XwKgFSAZtUHnzWdU2KxkBL7u+g8L 7wDos5POeOBlJzVt4r32XcxykdEC+p5W5e5QJ1qmVcXfG55/0MHkgtxUrhaXyHS6 FQDCbFyz/rr+AAyQyBC487JtideOBpQtyXRGLg0jw1MwoI9Ok5s= =JJCK -----END PGP SIGNATURE----- --=-=-=--