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..0142fc6 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,33 @@ 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-- + 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 + return 1 +} + # # Go further # @@ -202,14 +230,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)