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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 985CD1581F0 for ; Wed, 11 Dec 2024 11:42:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C567EE0B65; Wed, 11 Dec 2024 11:42:38 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 05F1FE0B5D for ; Wed, 11 Dec 2024 11:42:37 +0000 (UTC) From: Florian Schmaus To: gentoo-dev@lists.gentoo.org Cc: tex@gentoo.org, Florian Schmaus Subject: [gentoo-dev] [PATCH 1/3] latex-package.eclass: do not set $@ in latex-package_src_doinstall's loop Date: Wed, 11 Dec 2024 12:42:03 +0100 Message-ID: <20241211114218.143793-1-flow@gentoo.org> X-Mailer: git-send-email 2.45.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: bc7fb041-e294-4697-94d5-3167c09d241e X-Archives-Hash: 6a64da899bcdb28c44569108d6630e46 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 --- 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