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 527631581E7 for ; Sun, 28 Apr 2024 08:40:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E2A59E2A17; Sun, 28 Apr 2024 08:40:11 +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 57D4AE2A10 for ; Sun, 28 Apr 2024 08:40:11 +0000 (UTC) From: Florian Schmaus To: gentoo-dev@lists.gentoo.org Cc: tex@gentoo.org, Florian Schmaus Subject: [gentoo-dev] [PATCH] texlive-common.eclass: add newline between tlbobj entries in tlpdb Date: Sun, 28 Apr 2024 10:40:00 +0200 Message-ID: <20240428084001.32729-1-flow@gentoo.org> X-Mailer: git-send-email 2.43.2 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-Transfer-Encoding: 8bit X-Archives-Salt: e6f31a19-d852-4e54-bcef-4ad04c3cb926 X-Archives-Hash: c6e1f364fe7cbad5b36c40108cc28680 We previously created the texlive.tlpdb by concatenating all tlpobj files. This means that the entries will be right after another. As it turns out, some TeX Live tools require a newline (e.g., tlmgr) between the entries, while others do not (e.g., texdoc). And the "official" tlpdb also has the entries separated by newlines. Therefore this changes texlive-common_update_tlpdb() to also add them. Signed-off-by: Florian Schmaus --- eclass/texlive-common.eclass | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index b32ea2af1121..929062c0444a 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -270,10 +270,18 @@ texlive-common_update_tlpdb() { touch "${new_tlpdb}" || die 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="" 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 if [[ -f ${tlpdb} ]]; then -- 2.43.2