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 DDC5A15808B for ; Mon, 12 Feb 2024 15:02:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 039B5E29F5; Mon, 12 Feb 2024 15:02:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF856E29F5 for ; Mon, 12 Feb 2024 15:02:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 2771E34308C for ; Mon, 12 Feb 2024 15:02:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C491C1437 for ; Mon, 12 Feb 2024 15:02:15 +0000 (UTC) From: "Florian Schmaus" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Florian Schmaus" Message-ID: <1707732281.97b43be4c50c34648fddc478146fed66dcd3458b.flow@gentoo> Subject: [gentoo-commits] proj/tex-overlay:main commit in: eclass/ X-VCS-Repository: proj/tex-overlay X-VCS-Files: eclass/texlive-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: flow X-VCS-Committer-Name: Florian Schmaus X-VCS-Revision: 97b43be4c50c34648fddc478146fed66dcd3458b X-VCS-Branch: main Date: Mon, 12 Feb 2024 15:02:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e96587bb-ad06-41ed-8e16-d76e010b5640 X-Archives-Hash: b29140b1b01800886e81e1434bc50745 commit: 97b43be4c50c34648fddc478146fed66dcd3458b Author: Florian Schmaus gentoo org> AuthorDate: Mon Feb 12 10:04:41 2024 +0000 Commit: Florian Schmaus gentoo org> CommitDate: Mon Feb 12 10:04:41 2024 +0000 URL: https://gitweb.gentoo.org/proj/tex-overlay.git/commit/?id=97b43be4 texlive-common.eclass: add --ignore-errors to etexmf-update and efmtutil-sys Signed-off-by: Florian Schmaus gentoo.org> eclass/texlive-common.eclass | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index eb012f2..adfb7da 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -168,16 +168,23 @@ dobin_texmf_scripts() { } # @FUNCTION: etexmf-update +# @USAGE: [--ignore-errors] # @DESCRIPTION: # Runs texmf-update if it is available and prints a warning otherwise. This # function helps in factorizing some code. Useful in ebuilds' pkg_postinst and # pkg_postrm phases. +# If --ignore-errors is provided, then a non-zero exit status of texmf-update does not +# cause die to be invoked. # Called by app-text/dvipsk, app-text/texlive-core, dev-libs/kpathsea, and # texlive-module.eclass. 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 || die + "${EPREFIX}"/usr/sbin/texmf-update + local res="${?}" + if [[ "${?}" -ne 0 && "${#}" -ne 1 && "${1}" != "--ignore-errors" ]] && ver_test -ge 2023; then + die "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" @@ -187,15 +194,22 @@ etexmf-update() { } # @FUNCTION: efmtutil-sys +# @USAGE: [--ignore-errors] # @DESCRIPTION: # Runs fmtutil-sys if it is available and prints a warning otherwise. This # function helps in factorizing some code. Used in ebuilds' pkg_postinst to # force a rebuild of TeX formats. +# If --ignore-errors is provided, then a non-zero exit status of fmtutil-sys does not +# cause die to be invoked. efmtutil-sys() { if has_version 'app-text/texlive-core' ; then if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/bin/fmtutil-sys ]] ; then einfo "Rebuilding formats" - "${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null || die + "${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null + local res="${?}" + if [[ "${?}" -ne 0 && "${#}" -ne 1 && "${1}" != "--ignore-errors" ]]; then + die "fmtutil-sys returned non-zero exit status ${res}" + fi else ewarn "Cannot run fmtutil-sys for some reason." ewarn "Your formats might be inconsistent with your installed ${PN} version"