Dr. Werner Fink 2017-07-18 11:04:01 +00:00 committed by Git OBS Bridge
parent f0d76853bf
commit 0f175d59a1
2 changed files with 77 additions and 59 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jul 18 11:02:31 UTC 2017 - werner@suse.de
- Make update.texlive faster and remove specific tag file after
creating specific format
-------------------------------------------------------------------
Wed Jul 12 07:41:21 UTC 2017 - werner@suse.de

View File

@ -178,15 +178,16 @@ do
mf|mfw|mf-nowin) fmt="$format.base"; kpse=mf; engine=metafont ;;
*) fmt="$format.fmt"; kpse=tex; engine=$engine ;;
esac
inifile=$(kpsewhich -progname=$format -format=$kpse $inifile 2>/dev/null) || continue
fmt="$(find ${WEB2C}/$engine -name $fmt)"
if test -z "$fmt"
test -d ${WEB2C}/$engine || mkdir -p ${WEB2C}/$engine
fmt="${WEB2C}/$engine/$fmt"
if test ! -e "$fmt"
then
# init=true
# > /var/run/texlive/run-fmtutil
continue
fi
test "$fmt" -nt "$TEXMFCNFFILE" || init=true
inifile=$(kpsewhich -progname=$format -format=$kpse $inifile 2>/dev/null) || continue
test "$fmt" -nt "$inifile" && continue
case "$engine" in
mpost) fmtutil-sys --byfmt "$egine" < /dev/null 1>&4 2>&4 ;;
@ -213,6 +214,7 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then
#
# Handle hyphens
#
typeset -i refresh=0
for run in /var/run/texlive/run-hyphen* ; do
test -e "$run" || break
tmp=${cnf_ldat}.$RANDOM
@ -224,6 +226,7 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then
cat "$dat"
done >> $tmp
mv -f $tmp ${cnf_ldat}
let refresh++
#
tmp=${cnf_ldef}.$RANDOM
cat ${TEXMFDIST}/tex/generic/config/language.us.def >> $tmp
@ -235,6 +238,7 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then
echo >> $tmp
echo '\uselanguage {USenglish} %%% This MUST be the last line of the file.' >> $tmp
mv -f $tmp ${cnf_ldef}
let refresh++
#
tmp=${cnf_llua}.$RANDOM
echo "-- Generated by ${TEXMFDIST}/texconfig/update on $(date)" > $tmp
@ -246,70 +250,78 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then
# Silent editor {
echo '}' >> $tmp
mv -f $tmp ${cnf_llua}
let refresh++
set +C
rm -f /var/run/texlive/run-hyphen*
done
#
# New md5 sums
#
md5_ldat=${MD5DIR}${cnf_ldat}
md5_ldef=${MD5DIR}${cnf_ldef}
md5_llua=${MD5DIR}${cnf_llua}
set -- $(md5sum < ${cnf_ldat}) ; md5ldat="$1"
set -- $(md5sum < ${cnf_ldef}) ; md5ldef="$1"
set -- $(md5sum < ${cnf_llua}) ; md5llua="$1"
if ((refresh > 0))
then
#
# New md5 sums
#
md5_ldat=${MD5DIR}${cnf_ldat}
md5_ldef=${MD5DIR}${cnf_ldef}
md5_llua=${MD5DIR}${cnf_llua}
set -- $(md5sum < ${cnf_ldat}) ; md5ldat="$1"
set -- $(md5sum < ${cnf_ldef}) ; md5ldef="$1"
set -- $(md5sum < ${cnf_llua}) ; md5llua="$1"
#
# Previous md5 sums
#
omd5ldat=0
omd5ldef=0
omd5llua=0
if test -e ${md5_ldat} -a -r ${md5_ldat} ; then
set -- $(cat ${md5_ldat}) ; omd5ldat="$1"
elif test ! -d ${md5_ldat%/*} ; then
mkdir -p ${md5_ldat%/*}
fi
if test -e ${md5_ldef} -a -r ${md5_ldef} ; then
set -- $(cat ${md5_ldef}) ; omd5ldef="$1"
elif test ! -d ${md5_ldef%/*} ; then
mkdir -p ${md5_ldef%/*}
fi
if test -e ${md5_llua} -a -r ${md5_llua} ; then
#
# Previous md5 sums
#
omd5ldat=0
omd5ldef=0
omd5llua=0
if test -e ${md5_ldat} -a -r ${md5_ldat} ; then
set -- $(cat ${md5_ldat}) ; omd5ldat="$1"
elif test ! -d ${md5_ldat%/*} ; then
mkdir -p ${md5_ldat%/*}
fi
echo "$md5ldat" > $md5_ldat
if test -e ${md5_ldef} -a -r ${md5_ldef} ; then
set -- $(cat ${md5_ldef}) ; omd5ldef="$1"
elif test ! -d ${md5_ldef%/*} ; then
mkdir -p ${md5_ldef%/*}
fi
echo "$md5ldef" > $md5_ldef
if test -e ${md5_llua} -a -r ${md5_llua} ; then
set -- $(cat ${md5_llua}) ; omd5llua="$1"
elif test ! -d ${md5_llua%/*} ; then
mkdir -p ${md5_llua%/*}
fi
elif test ! -d ${md5_llua%/*} ; then
mkdir -p ${md5_llua%/*}
fi
echo "$md5llua" > $md5_llua
#
# Create new formats for new language.dat and/or language.def if needed
#
while read format engine language rest
do
line=($rest)
last=${line[-1]}
inifile=${last#\*}
case "$engine" in
mpost) continue ;;
mf|mfw|mf-nowin) continue ;;
*) fmt="$format.fmt"; kpse=tex; engine=$engine ;;
esac
inifile=$(kpsewhich -progname=$format -format=$kpse $inifile 2>/dev/null) || continue
fmt="$(find ${WEB2C}/$engine -name $fmt)"
test -z "$fmt" && continue
for lang in ${language//,/ }
#
# Refresh formats for new language.dat and/or language.def if needed
#
while read format engine language rest
do
for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua}
line=($rest)
last=${line[-1]}
inifile=${last#\*}
case "$engine" in
mpost) continue ;;
mf|mfw|mf-nowin) continue ;;
*) fmt="$format.fmt"; kpse=tex; engine=$engine ;;
esac
test -d ${WEB2C}/$engine || mkdir -p ${WEB2C}/$engine
fmt="${WEB2C}/$engine/$fmt"
test -e "$fmt" || continue
inifile=$(kpsewhich -progname=$format -format=$kpse $inifile 2>/dev/null) || continue
for lang in ${language//,/ }
do
test $lang = "${cfg##*/}" || continue
test $fmt -nt $cfg && continue
> /var/run/texlive/run-fmtutil.language
break 3
for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua}
do
test $lang = "${cfg##*/}" || continue
test $fmt -nt $cfg && continue
> /var/run/texlive/run-fmtutil.language
break 3
done
done
done
done < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu")
unset format engine language lang rest line last inifile fmt kpse engine
done < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu")
unset format engine language lang rest line last inifile fmt kpse engine
fi
fi
tcfmgr ()
@ -428,7 +440,7 @@ for run in /var/run/texlive/run-fmtutil* ; do
fmtutil-sys ${option:+$option} --byfmt "${run#*fmtutil.}" < /dev/null 1>&4 2>&4
let rc+=$?
test $VERBOSE = true && echo
((rc != 0)) || rm -f /var/run/texlive/run-fmtutil
((rc != 0)) || rm -f "${run}"
esac
done