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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5B3931581E7 for ; Sun, 28 Apr 2024 12:13:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 13DE7E2A25; Sun, 28 Apr 2024 12:13:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 C7A8BE2A19 for ; Sun, 28 Apr 2024 12:13:40 +0000 (UTC) From: Ulrich Mueller To: Florian Schmaus Cc: gentoo-dev@lists.gentoo.org, tex@gentoo.org Subject: Re: [gentoo-dev] [PATCH] texlive-common.eclass: add newline between tlbobj entries in tlpdb In-Reply-To: <20240428084001.32729-1-flow@gentoo.org> (Florian Schmaus's message of "Sun, 28 Apr 2024 10:40:00 +0200") References: <20240428084001.32729-1-flow@gentoo.org> Date: Sun, 28 Apr 2024 14:13:31 +0200 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: fce97fcc-a727-4369-8e94-59049f83ed30 X-Archives-Hash: b518091acd601d89a588ed9eb3ccd8f5 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> On Sun, 28 Apr 2024, Florian Schmaus wrote: > --- a/eclass/texlive-common.eclass > +++ b/eclass/texlive-common.eclass > @@ -270,10 +270,18 @@ texlive-common_update_tlpdb() { > touch "${new_tlpdb}" || die >=20 > if [[ -d "${tlpobj}" ]]; then > - find "${tlpobj}" -maxdepth 1 -type f -name "*.tlpobj" -print0 | > - sort -z | > - xargs -0 --no-run-if-empty cat >> "${new_tlpdb}" > - assert "generating tlpdb failed" > + all_tlpobjs() { > + find "${tlpobj}" -maxdepth 1 -type f -name "*.tlpobj" -print0 | > + sort -z > + assert "Error enumerating all tlpobj files" > + } > + ( > + while IFS=3D"" read -d $'\0' -r f; do > + cat "${f}" || die "Failed to read ${f}" > + # Ensure there is an empty line between every tlpobj entry. > + echo > + done < <(all_tlpobjs) > + ) >> "${new_tlpdb}" > fi >=20 > if [[ -f ${tlpdb} ]]; then Looks complicated. AFAICS a one-line change like the following would also do the job: =2D xargs -0 --no-run-if-empty cat >> "${new_tlpdb}" + xargs -0 --no-run-if-empty sed -s '$G' >> "${new_tlpdb}" Alternatively, "sed -s '$s/$/\n/'" would also work (but is longer and maybe harder to read). Ulrich --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmYuPWsPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uuTEH/RRvkE0af68HrmkDjj35Xp2zNkRCntzQgTMn LA6Eq/OfbI37L2Kx/28B6EcFBmgYJS/1THdfeh49qeR4vCWRTDfUYQzDj8zRgIez j1xo0dmFTxC511P/bXFG7ji+VG9K5+FmxPi/GQyElBrlfYljAkKbDxPLilh7mNZI j8VxSaouOHLG/jNWNdL1DeIh0NwmaJsdBy1lJaV9qjpCf7ATEERoOdpk0FTDGZW4 HVkJrkwDRmOnSExZi6v+FDyk54i/wBNuLeVFqg3RyFKZV0vew41MqVEVDaL7cyPZ RJgUBFzaxiRlKMLZ1vzRabsQrjHrKJ2Nwu5BKAxgAo6CnblejBY= =1dbV -----END PGP SIGNATURE----- --=-=-=--