public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tex-overlay:main commit in: eclass/
Date: Mon, 12 Feb 2024 15:02:15 +0000 (UTC)	[thread overview]
Message-ID: <1707732281.97b43be4c50c34648fddc478146fed66dcd3458b.flow@gentoo> (raw)

commit:     97b43be4c50c34648fddc478146fed66dcd3458b
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 12 10:04:41 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> 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 <flow <AT> 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"


             reply	other threads:[~2024-02-12 15:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 15:02 Florian Schmaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-26  7:47 [gentoo-commits] proj/tex-overlay:main commit in: eclass/ Florian Schmaus
2024-05-14  8:21 Florian Schmaus
2024-05-13  8:36 Florian Schmaus
2024-05-02 17:45 Florian Schmaus
2024-04-30 17:45 Florian Schmaus
2024-04-30 15:10 Florian Schmaus
2024-04-30 10:05 Florian Schmaus
2024-04-30  8:53 Florian Schmaus
2024-04-30  8:16 Florian Schmaus
2024-04-04 13:05 Florian Schmaus
2024-04-04 13:02 Florian Schmaus
2024-04-04 13:02 Florian Schmaus
2024-04-04  8:39 Florian Schmaus
2024-04-04  8:39 Florian Schmaus
2024-04-03 16:20 Florian Schmaus
2024-04-02 13:58 Florian Schmaus
2024-04-02 13:58 Florian Schmaus
2024-04-02  9:43 Florian Schmaus
2024-02-29 21:12 Florian Schmaus
2024-02-29 17:46 Florian Schmaus
2024-02-11 11:28 Florian Schmaus
2024-01-31 15:11 Florian Schmaus
2024-01-18 14:21 Florian Schmaus
2024-01-16 11:42 Florian Schmaus
2024-01-16 11:37 Florian Schmaus
2023-12-29 10:31 Florian Schmaus
2023-11-17  9:44 Florian Schmaus
2023-11-17  9:44 Florian Schmaus

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=1707732281.97b43be4c50c34648fddc478146fed66dcd3458b.flow@gentoo \
    --to=flow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.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