Gentoo Archives: gentoo-dev

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-dev@l.g.o
Cc: tex@g.o, "Ulrich Müller" <ulm@g.o>
Subject: [gentoo-dev] [PATCH v2 1/2] latex-package.eclass: Properly quote variables
Date: Wed, 13 Apr 2022 03:51:33
Message-Id: 20220413035043.28620-1-ulm@gentoo.org
1 Bug: https://bugs.gentoo.org/379571
2 Signed-off-by: Ulrich Müller <ulm@g.o>
3 ---
4 eclass/latex-package.eclass | 40 +++++++++++++++++++------------------
5 1 file changed, 21 insertions(+), 19 deletions(-)
6
7 diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
8 index 359b5177bb37..bee04b607de1 100644
9 --- a/eclass/latex-package.eclass
10 +++ b/eclass/latex-package.eclass
11 @@ -1,4 +1,4 @@
12 -# Copyright 1999-2020 Gentoo Authors
13 +# Copyright 1999-2022 Gentoo Authors
14 # Distributed under the terms of the GNU General Public License v2
15
16 # @ECLASS: latex-package.eclass
17 @@ -103,23 +103,24 @@ latex-package_src_doinstall() {
18 case ${1} in
19 "sh")
20 while IFS= read -r -d '' i; do
21 - dobin ${i}
22 + dobin "${i}"
23 done < <(find -maxdepth 1 -type f -name "*.${1}" -print0)
24 ;;
25
26 "sty" | "cls" | "fd" | "clo" | "def" | "cfg")
27 while IFS= read -r -d '' i; do
28 - insinto ${TEXMF}/tex/latex/${PN}
29 - doins ${i}
30 + insinto "${TEXMF}/tex/latex/${PN}"
31 + doins "${i}"
32 done < <(find -maxdepth 1 -type f -name "*.${1}" -print0)
33 ;;
34
35 "dvi" | "ps" | "pdf")
36 while IFS= read -r -d '' i; do
37 insinto /usr/share/doc/${PF}
38 - doins ${i}
39 - dosym /usr/share/doc/${PF}/$(basename ${i}) ${TEXMF}/doc/latex/${PN}/${i}
40 - docompress -x /usr/share/doc/${PF}/$(basename ${i})
41 + doins "${i}"
42 + dosym "/usr/share/doc/${PF}/$(basename "${i}")" \
43 + "${TEXMF}/doc/latex/${PN}/${i}"
44 + docompress -x "/usr/share/doc/${PF}/$(basename "${i}")"
45 done < <(find -maxdepth 1 -type f -name "*.${1}" -print0)
46 ;;
47
48 @@ -127,17 +128,18 @@ latex-package_src_doinstall() {
49 if ! in_iuse doc || use doc ; then
50 while IFS= read -r -d '' i; do
51 [[ -n ${LATEX_PACKAGE_SKIP} ]] &&
52 - has ${i##*/} ${LATEX_PACKAGE_SKIP} &&
53 + has "${i##*/}" ${LATEX_PACKAGE_SKIP} &&
54 continue
55
56 einfo "Making documentation: ${i}"
57 # some macros need compiler called twice, do it here.
58 - set -- pdflatex ${LATEX_DOC_ARGUMENTS} --halt-on-error --interaction=nonstopmode ${i}
59 + set -- pdflatex ${LATEX_DOC_ARGUMENTS} \
60 + --halt-on-error --interaction=nonstopmode "${i}"
61 if "${@}"; then
62 "${@}"
63 else
64 einfo "pdflatex failed, trying texi2dvi"
65 - texi2dvi -q -c --language=latex ${i} || die
66 + texi2dvi -q -c --language=latex "${i}" || die
67 fi
68 done < <(find -maxdepth 1 -type f -name "*.${1}" -print0)
69 fi
70 @@ -145,27 +147,27 @@ latex-package_src_doinstall() {
71
72 "tfm" | "vf" | "afm")
73 while IFS= read -r -d '' i; do
74 - insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
75 - doins ${i}
76 + insinto "${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}"
77 + doins "${i}"
78 done < <(find -maxdepth 1 -type f -name "*.${1}" -print0)
79 ;;
80
81 "pfb")
82 while IFS= read -r -d '' i; do
83 - insinto ${TEXMF}/fonts/type1/${SUPPLIER}/${PN}
84 - doins ${i}
85 + insinto "${TEXMF}/fonts/type1/${SUPPLIER}/${PN}"
86 + doins "${i}"
87 done < <(find -maxdepth 1 -type f -name "*.pfb" -print0)
88 ;;
89 "ttf")
90 while IFS= read -r -d '' i; do
91 - insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
92 - doins ${i}
93 + insinto "${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}"
94 + doins "${i}"
95 done < <(find -maxdepth 1 -type f -name "*.ttf" -print0)
96 ;;
97 "bst")
98 while IFS= read -r -d '' i; do
99 - insinto ${TEXMF}/bibtex/bst/${PN}
100 - doins ${i}
101 + insinto "${TEXMF}/bibtex/bst/${PN}"
102 + doins "${i}"
103 done < <(find -maxdepth 1 -type f -name "*.bst" -print0)
104 ;;
105
106 @@ -201,7 +203,7 @@ latex-package_src_compile() {
107 debug-print function $FUNCNAME $*
108 while IFS= read -r -d '' i; do
109 einfo "Extracting from ${i}"
110 - latex --halt-on-error --interaction=nonstopmode ${i} || die
111 + latex --halt-on-error --interaction=nonstopmode "${i}" || die
112 done < <(find -maxdepth 1 -type f -name "*.ins" -print0)
113 }
114
115 --
116 2.35.1

Replies

Subject Author
[gentoo-dev] [PATCH v2 2/2] latex-package.eclass: Support EAPI 8 "Ulrich Müller" <ulm@g.o>