From e87c39e130a56063cfee1e7d97ed9c3f09a2de83868beecff25615b7b26f5dc4 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 10 Feb 2014 10:07:39 +0000 Subject: [PATCH 1/4] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=39 --- texlive-filesystem.changes | 6 +++++ texlive-filesystem.spec | 2 +- update.texlive | 50 ++++++++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/texlive-filesystem.changes b/texlive-filesystem.changes index cea67c6..65ffca5 100644 --- a/texlive-filesystem.changes +++ b/texlive-filesystem.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 10 10:03:46 UTC 2014 - werner@suse.de + +- Avoid that missing formats for a hyphen file will cause high + load at installation + ------------------------------------------------------------------- Wed Aug 7 09:57:30 UTC 2013 - werner@suse.de diff --git a/texlive-filesystem.spec b/texlive-filesystem.spec index cb2385f..e6b27ed 100644 --- a/texlive-filesystem.spec +++ b/texlive-filesystem.spec @@ -1,7 +1,7 @@ # # spec file for package texlive-filesystem # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/update.texlive b/update.texlive index c0c7355..aa6ee9a 100644 --- a/update.texlive +++ b/update.texlive @@ -111,6 +111,7 @@ test -L "$TEXMFCNFFILE" && TEXMFCNFFILE="$(readlink -f "$TEXMFCNFFILE" 2> /dev/n # cnf_ldat=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.dat 2> /dev/null) cnf_ldef=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.def 2> /dev/null) +cnf_fmtu=$(TEXMF=$TEXMFSYSCONFIG kpsewhich fmtutil.cnf 2> /dev/null) if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then for cfg in ${cnf_ldat} ${cnf_ldef} ; do @@ -187,6 +188,35 @@ enablemaps () return $rc } + +has_formats() +{ + local hyphen + local OIFS="$IFS" + local IFS=$'\n' + + local -a list=($(sed -r '/^#/d; /^[[:blank:]]*$/d' cnf_fmtu)) + local -a line + IFS="$OIFS" + + local -i count=${#list[@]} + local -i last + + while ((count-- > 0)) ; do + line=(${list[count]}) + test ${line[2]} = "-" && continue + let last=${#line[@]} + let last-- + TEXMF=$TEXMFSYSCONFIG kpsewhich -progname=${line[0]} -format=tex ${line[last]#\*} &>/dev/null || continue + hyphen=$(TEXMF=$TEXMFSYSCONFIG kpsewhich -progname=${line[0]} -format=tex ${line[2]} 2>/dev/null) + test -n "$hyphen" -a -e "$hyphen" -a "$hyphen" = "$1" || continue + return 0 + done + return 1 +} + +has_formats "$1" + # # Go further # @@ -202,14 +232,18 @@ for run in /var/run/texlive/run-fmtutil* ; do echo $1 > ${md5_ldat} set -- $(md5sum < ${cnf_ldef}) echo $1 > ${md5_ldef} - test $VERBOSE = true && echo -en "\r[ ]Handle language.dat setups." - fmtutil-sys ${option:+$option} --byhyphen ${cnf_ldat} < /dev/null 1>&4 2>&4 - let rc+=$? - test $VERBOSE = true && echo - test $VERBOSE = true && echo -en "\r[ ]Handle language.def setups." - fmtutil-sys ${option:+$option} --byhyphen ${cnf_ldef} < /dev/null 1>&4 2>&4 - let rc+=$? - test $VERBOSE = true && echo + if has_formats ${cnf_ldat} ; then + test $VERBOSE = true && echo -en "\r[ ]Handle language.dat setups." + fmtutil-sys ${option:+$option} --byhyphen ${cnf_ldat} < /dev/null 1>&4 2>&4 + let rc+=$? + test $VERBOSE = true && echo + fi + if has_formats ${cnf_ldef} ; then + test $VERBOSE = true && echo -en "\r[ ]Handle language.def setups." + fmtutil-sys ${option:+$option} --byhyphen ${cnf_ldef} < /dev/null 1>&4 2>&4 + let rc+=$? + test $VERBOSE = true && echo + fi ((rc != 0)) || rm -f /var/run/texlive/run-fmtutil.language ;; refresh) From fb47146bc2b7788576d37d51e453e261aab2c7dc49e869424392aa446f53e275 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 10 Feb 2014 10:08:29 +0000 Subject: [PATCH 2/4] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=40 --- update.texlive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.texlive b/update.texlive index aa6ee9a..9cbc274 100644 --- a/update.texlive +++ b/update.texlive @@ -195,7 +195,7 @@ has_formats() local OIFS="$IFS" local IFS=$'\n' - local -a list=($(sed -r '/^#/d; /^[[:blank:]]*$/d' cnf_fmtu)) + local -a list=($(sed -r '/^#/d; /^[[:blank:]]*$/d' $cnf_fmtu)) local -a line IFS="$OIFS" From 18afa5ff34ebc7f1fa4e3d1244230fbc37338d4f6663bf3ce51c8201612fbea1 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 10 Feb 2014 10:12:56 +0000 Subject: [PATCH 3/4] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=41 --- update.texlive | 2 -- 1 file changed, 2 deletions(-) diff --git a/update.texlive b/update.texlive index 9cbc274..3bc9d6e 100644 --- a/update.texlive +++ b/update.texlive @@ -215,8 +215,6 @@ has_formats() return 1 } -has_formats "$1" - # # Go further # From e15b7c91981a4ffa045822bac2a86055a6738a110989145a9df4871cec2447c4 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 10 Feb 2014 10:22:30 +0000 Subject: [PATCH 4/4] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=42 --- update.texlive | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update.texlive b/update.texlive index 3bc9d6e..0142fc6 100644 --- a/update.texlive +++ b/update.texlive @@ -207,8 +207,8 @@ has_formats() test ${line[2]} = "-" && continue let last=${#line[@]} let last-- - TEXMF=$TEXMFSYSCONFIG kpsewhich -progname=${line[0]} -format=tex ${line[last]#\*} &>/dev/null || continue - hyphen=$(TEXMF=$TEXMFSYSCONFIG kpsewhich -progname=${line[0]} -format=tex ${line[2]} 2>/dev/null) + kpsewhich -progname=${line[0]} -format=tex ${line[last]#\*} &>/dev/null || continue + hyphen=$(kpsewhich -progname=${line[0]} -format=tex ${line[2]} 2>/dev/null) test -n "$hyphen" -a -e "$hyphen" -a "$hyphen" = "$1" || continue return 0 done