1 |
commit: 9eee03a809d88c230e2a57c72e69323dc7493b93 |
2 |
Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 19 21:51:23 2020 +0000 |
4 |
Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 20 09:34:01 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9eee03a8 |
7 |
|
8 |
texlive-common: kill POSIXism |
9 |
|
10 |
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org> |
11 |
|
12 |
eclass/texlive-common.eclass | 24 ++++++++++++------------ |
13 |
1 file changed, 12 insertions(+), 12 deletions(-) |
14 |
|
15 |
diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass |
16 |
index 593e8855871..ae34e876e9c 100644 |
17 |
--- a/eclass/texlive-common.eclass |
18 |
+++ b/eclass/texlive-common.eclass |
19 |
@@ -35,8 +35,8 @@ TEXMF_VAR_PATH=/var/lib/texmf |
20 |
|
21 |
texlive-common_handle_config_files() { |
22 |
# Handle config files properly |
23 |
- [ -d "${ED}${TEXMF_PATH}" ] || return |
24 |
- cd "${ED}${TEXMF_PATH}" |
25 |
+ [[ -d ${ED}${TEXMF_PATH} ]] || return |
26 |
+ cd "${ED}${TEXMF_PATH}" || doe |
27 |
for f in $(find . -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do |
28 |
if [ "${f#*config}" != "${f}" -o "${f#doc}" != "${f}" -o "${f#source}" != "${f}" -o "${f#tex}" != "${f}" ] ; then |
29 |
continue |
30 |
@@ -55,9 +55,9 @@ texlive-common_handle_config_files() { |
31 |
|
32 |
texlive-common_is_file_present_in_texmf() { |
33 |
local mark="${T}/$1.found" |
34 |
- [ -d texmf ] && find texmf -name $1 -exec touch "${mark}" \; |
35 |
- [ -d texmf-dist ] && find texmf-dist -name $1 -exec touch "${mark}" \; |
36 |
- [ -f "${mark}" ] |
37 |
+ [[ -d texmf ]] && find texmf -name $1 -exec touch "${mark}" \; |
38 |
+ [[ -d texmf-dist ]] && find texmf-dist -name $1 -exec touch "${mark}" \; |
39 |
+ [[ -f ${mark} ]] |
40 |
} |
41 |
|
42 |
# @FUNCTION: texlive-common_do_symlinks |
43 |
@@ -73,7 +73,7 @@ texlive-common_is_file_present_in_texmf() { |
44 |
# also do the fmtutil file parsing. |
45 |
|
46 |
texlive-common_do_symlinks() { |
47 |
- while [ $# != 0 ]; do |
48 |
+ while [[ $# != 0 ]]; do |
49 |
case $1 in |
50 |
cont-??|metafun|mptopdf) |
51 |
einfo "Symlink $1 skipped (special case)" |
52 |
@@ -82,10 +82,10 @@ texlive-common_do_symlinks() { |
53 |
einfo "Symlink $1 -> $2 skipped (texlive-core takes care of it)" |
54 |
;; |
55 |
*) |
56 |
- if [ $1 = $2 ]; |
57 |
+ if [[ $1 = $2 ]]; |
58 |
then |
59 |
einfo "Symlink $1 -> $2 skipped" |
60 |
- elif [ -e "${ED}/usr/bin/$1" -o -L "${ED}/usr/bin/$1" ]; |
61 |
+ elif [[ -e ${ED}/usr/bin/$1 -o -L ${ED}/usr/bin/$1 ]]; |
62 |
then |
63 |
einfo "Symlink $1 skipped (file exists)" |
64 |
else |
65 |
@@ -123,10 +123,10 @@ etexlinks() { |
66 |
# correctly set for the file that it will point to. |
67 |
|
68 |
dobin_texmf_scripts() { |
69 |
- while [ $# -gt 0 ] ; do |
70 |
+ while [[ $# -gt 0 ]] ; do |
71 |
local trg=$(basename ${1} | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]') |
72 |
einfo "Installing ${1} as ${trg} bin wrapper" |
73 |
- [ -x "${ED}/usr/share/${1}" ] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" |
74 |
+ [[ -x ${ED}/usr/share/${1} ]] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" |
75 |
dosym ../share/${1} /usr/bin/${trg} || die "failed to install ${1} as $trg" |
76 |
shift |
77 |
done |
78 |
@@ -140,7 +140,7 @@ dobin_texmf_scripts() { |
79 |
|
80 |
etexmf-update() { |
81 |
if has_version 'app-text/texlive-core' ; then |
82 |
- if [ -z "${ROOT%/}" ] && [ -x "${EPREFIX}"/usr/sbin/texmf-update ] ; then |
83 |
+ if [[ -z ${ROOT%/} ]] && [[ -x ${EPREFIX}/usr/sbin/texmf-update ]] ; then |
84 |
"${EPREFIX}"/usr/sbin/texmf-update |
85 |
else |
86 |
ewarn "Cannot run texmf-update for some reason." |
87 |
@@ -158,7 +158,7 @@ etexmf-update() { |
88 |
|
89 |
efmtutil-sys() { |
90 |
if has_version 'app-text/texlive-core' ; then |
91 |
- if [ -z "${ROOT%/}" ] && [ -x "${EPREFIX}"/usr/bin/fmtutil-sys ] ; then |
92 |
+ if [[ -z ${ROOT%/} ]] && [[ -x "${EPREFIX}"/usr/bin/fmtutil-sys ]] ; then |
93 |
einfo "Rebuilding formats" |
94 |
"${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null |
95 |
else |