public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] latex-package.eclass: do not set $@ in latex-package_src_doinstall's loop
@ 2024-12-11 11:42 Florian Schmaus
  2024-12-11 11:42 ` [gentoo-dev] [PATCH 2/3] latex-package.eclass: add default case to latex-package_src_doinstall Florian Schmaus
  2024-12-11 11:42 ` [gentoo-dev] [PATCH 3/3] dev-tex/minted: remove workaround for buggy latex-package.eclass Florian Schmaus
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Schmaus @ 2024-12-11 11:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: tex, Florian Schmaus

Since 595611085bc5 ("latex-package: kill POSIX and old EAPI"), the 'tex'
and 'dtx' case handling of latex-package_src_doinstall's loop would set
$@ to a pdflatex invocation. However, the main loop of this function
iterates over $@, and after $@ is set to a pdflatex command, this
iteration would continue to process the components of the pdflatex
command.

As result, ebuild have to

latex-package_src_doinstall doc
latex-package_src_doinstall pdf

when

latex-package_src_doinstall doc

should be sufficient, because the 'doc' case expands to the "tex dtx dvi
ps pdf" cases. However, once a 'tex' or 'dtx' case was processed, the
remaining onces are no longer be processed, due the bug described above.

The fix is simple: do not abuse $@ to save the pdflatex command,
instead, use a dedicated local variable.

Fixes: 595611085bc532afb9f31fa23cee734bc37d21a4
Signed-off-by: Florian Schmaus <flow@gentoo.org>
---
 eclass/latex-package.eclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
index 4082e161b843..d6426775f720 100644
--- a/eclass/latex-package.eclass
+++ b/eclass/latex-package.eclass
@@ -137,11 +137,16 @@ latex-package_src_doinstall() {
 						continue
 
 						einfo "Making documentation: ${i}"
+						local mypdflatex=(
+							pdflatex
+							${LATEX_DOC_ARGUMENTS}
+							--halt-on-error
+							--interaction=nonstopmode
+							"${i}"
+						)
 						# some macros need compiler called twice, do it here.
-						set -- pdflatex ${LATEX_DOC_ARGUMENTS} \
-							--halt-on-error --interaction=nonstopmode "${i}"
-						if "${@}"; then
-							"${@}"
+						if "${mypdflatex[@]}"; then
+							"${mypdflatex[@]}"
 						else
 							einfo "pdflatex failed, trying texi2dvi"
 							texi2dvi -q -c --language=latex "${i}" || die
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/3] latex-package.eclass: add default case to latex-package_src_doinstall
  2024-12-11 11:42 [gentoo-dev] [PATCH 1/3] latex-package.eclass: do not set $@ in latex-package_src_doinstall's loop Florian Schmaus
@ 2024-12-11 11:42 ` Florian Schmaus
  2024-12-11 11:42 ` [gentoo-dev] [PATCH 3/3] dev-tex/minted: remove workaround for buggy latex-package.eclass Florian Schmaus
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Schmaus @ 2024-12-11 11:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: tex, Florian Schmaus

Add a default case to the switch/case statement in
latex-package_src_doinstall, invoking die.

Signed-off-by: Florian Schmaus <flow@gentoo.org>
---
 eclass/latex-package.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
index d6426775f720..dfef7fc2836f 100644
--- a/eclass/latex-package.eclass
+++ b/eclass/latex-package.eclass
@@ -200,6 +200,9 @@ latex-package_src_doinstall() {
 			"all")
 				latex-package_src_doinstall styles fonts bin doc
 				;;
+			*)
+				die "Unknown module: ${1}"
+				;;
 		esac
 	shift
 	done
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 3/3] dev-tex/minted: remove workaround for buggy latex-package.eclass
  2024-12-11 11:42 [gentoo-dev] [PATCH 1/3] latex-package.eclass: do not set $@ in latex-package_src_doinstall's loop Florian Schmaus
  2024-12-11 11:42 ` [gentoo-dev] [PATCH 2/3] latex-package.eclass: add default case to latex-package_src_doinstall Florian Schmaus
@ 2024-12-11 11:42 ` Florian Schmaus
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Schmaus @ 2024-12-11 11:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: tex, Florian Schmaus

Now that latex-package.eclass is fixed, we can drop the workaround.

Signed-off-by: Florian Schmaus <flow@gentoo.org>
---
 dev-tex/minted/minted-3.4.0.ebuild | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/dev-tex/minted/minted-3.4.0.ebuild b/dev-tex/minted/minted-3.4.0.ebuild
index 2e59495b4426..1eee5a8d8056 100644
--- a/dev-tex/minted/minted-3.4.0.ebuild
+++ b/dev-tex/minted/minted-3.4.0.ebuild
@@ -79,11 +79,6 @@ src_install() {
 		local -x PYTHONPATH="${ED}/usr/lib/${EPYTHON}/site-packages"
 		local -x PATH="${ED}/usr/lib/python-exec/${EPYTHON}:${PATH}"
 		latex-package_src_doinstall doc
-		# The following line shouldn't be required, as 'doc' is expaned
-		# by latex-package.eclass to "… dtx … pdf", but without this,
-		# the pdf is *not* installed. Maybe a bug in
-		# latex-package.eclass?
-		latex-package_src_doinstall pdf
 	fi
 	popd &> /dev/null || die
 }
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-11 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 11:42 [gentoo-dev] [PATCH 1/3] latex-package.eclass: do not set $@ in latex-package_src_doinstall's loop Florian Schmaus
2024-12-11 11:42 ` [gentoo-dev] [PATCH 2/3] latex-package.eclass: add default case to latex-package_src_doinstall Florian Schmaus
2024-12-11 11:42 ` [gentoo-dev] [PATCH 3/3] dev-tex/minted: remove workaround for buggy latex-package.eclass Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox