From e472b578aa5e798d3e1cc78d581888431d30c44e871f43661aff125858ee8042 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 11 Jul 2017 14:09:14 +0000 Subject: [PATCH 1/3] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=66 --- texlive-filesystem.changes | 6 +++ update.texlive | 102 ++++++++++++++++++++++++++----------- 2 files changed, 77 insertions(+), 31 deletions(-) diff --git a/texlive-filesystem.changes b/texlive-filesystem.changes index abecdb1..9dfedd5 100644 --- a/texlive-filesystem.changes +++ b/texlive-filesystem.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 11 12:00:53 UTC 2017 - werner@suse.de + +- Modify update.texlive script in such a way that we detect old + format files and enforce a refresh based on hyphen (boo#1046277) + ------------------------------------------------------------------- Tue Jun 13 10:38:52 UTC 2017 - werner@suse.de diff --git a/update.texlive b/update.texlive index 9b04c74..573d385 100644 --- a/update.texlive +++ b/update.texlive @@ -107,6 +107,14 @@ unset KPSE_DOT || true : ${WEB2C:=$TEXMFVAR/web2c} test -L "$TEXMFCNFFILE" && TEXMFCNFFILE="$(readlink -f "$TEXMFCNFFILE" 2> /dev/null)" +# +# Configuration broken +# +if test ! -e "$TEXMFCNFFILE" ; then + echo "${0##*/}: Configuration of texlive installation not found." 1>&2 + exit 0 +fi + # # Language and hyphenation setup # @@ -137,6 +145,47 @@ if test -z "$cnf_llua" ; then cnf_llua=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.dat.lua 2> /dev/null) fi +# +# Do some sanity checks as well +# +for hyp in ${TEXMFDIST}/tex/generic/config/language.splits/hyphen* +do + test -e "$hyp" || continue + suffix=${hyp##*/} + suffix=${suffix#*.} + case "$suffix" in + dat.lua) + test "$hyp" -nt "$cnf_llua" ;; + dat) + test "$hyp" -nt "$cnf_ldat" ;; + def) + test "$hyp" -nt "$cnf_ldef" ;; + esac && { + > /var/run/texlive/run-hyphen + > /var/run/texlive/run-fmtutil.language + } +done +unset hyp suffix + +init=false +while read egine required +do + required="${required##* }" + required="$(kpsewhich "${required#\*}" 2>/dev/null)" + test -e "$required" || continue + fmt="$(find ${WEB2C} -name "${egine}.fmt" -o -name "${egine}.mem" -o -name "${egine}.base")" + test -e "$fmt" || continue + test "$fmt" -nt "$TEXMFCNFFILE" || init=true + test "$fmt" -nt "$required" && continue + case "${fmt##*.}" in + fmt) + > /var/run/texlive/run-fmtutil.refresh ;; + base|mem) + fmtutil-sys --byfmt "$egine" ;; + esac +done < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu") +unset egine fmt required + if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua} ; do test -s ${OLDMD5DIR}${cfg} || continue @@ -208,19 +257,16 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then omd5ldef=0 omd5llua=0 if test -e ${md5_ldat} -a -r ${md5_ldat} ; then - test ${md5_ldat} -nt ${cnf_ldat} && md5_nt_ldat="yes" 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 - test ${md5_ldef} -nt ${cnf_ldef} && md5_nt_ldef="yes" 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 - test ${md5_llua} -nt ${cnf_llua} && md5_nt_llua="yes" set -- $(cat ${md5_llua}) ; omd5llua="$1" elif test ! -d ${md5_llua%/*} ; then mkdir -p ${md5_llua%/*} @@ -229,18 +275,28 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then # # Create new formats for new language.dat and/or language.def if needed # - if test $omd5ldat = 0 -o \( $md5ldat != $omd5ldat -o "$md5_nt_ldat" != "yes" \) - then - > /var/run/texlive/run-fmtutil.language - fi - if test $omd5ldef = 0 -o \( $md5ldef != $omd5ldef -o "$md5_nt_ldef" != "yes" \) - then - > /var/run/texlive/run-fmtutil.language - fi - if test $omd5llua = 0 -o \( $md5llua != $omd5llua -o "$md5_nt_llua" != "yes" \) - then - > /var/run/texlive/run-fmtutil.language - fi + while read egine required + do + case "$required" in + *language.*) ;; + *) continue ;; + esac + language=language${required#*language} + language=${language%% *} + required="${required##* }" + required="$(kpsewhich "${required#\*}" 2>/dev/null)" + test -e "$required" || continue + fmt="$(find ${WEB2C} -name "${egine}.fmt")" + test -e "$fmt" || continue + for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua} + do + test $language = "${cfg##*/}" || continue + test $fmt -nt $cfg && continue + > /var/run/texlive/run-fmtutil.language + break 2 + done + done < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu") + unset egine fmt required fi tcfmgr () @@ -451,22 +507,6 @@ fi # of various programs. # type -p texconfig-sys &> /dev/null || exit 0 - -# -# Configuration broken -# -if test ! -e "$TEXMFCNFFILE" ; then - echo "${0##*/}: Configuration of texlive installation not found." 1>&2 - exit 0 -fi - -init=false -for f in $(find ${WEB2C}/ -name '*.fmt' -name '*.mem' -o -name '*.base') ; do - test -e "$f" || continue - test -L "$f" && continue - test "$TEXMFCNFFILE" -nt "$f" && init=true - test -s "$f" && touch "$f" -done if test $init = true ; then test $VERBOSE = true && echo -en "\r[ ]Initialize TeX configuration and font mappings." updmap-sys --cnffile $cnf_umap --syncwithtrees < /dev/null 1>&4 2>&4 From fc92c82502cef2096b2d8f8faf58cb29f37624cf9b13797c35765b323e4b32d5 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 11 Jul 2017 15:47:59 +0000 Subject: [PATCH 2/3] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=67 --- update.texlive | 73 +++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/update.texlive b/update.texlive index 573d385..ee03479 100644 --- a/update.texlive +++ b/update.texlive @@ -168,23 +168,33 @@ done unset hyp suffix init=false -while read egine required +while read format engine language rest do - required="${required##* }" - required="$(kpsewhich "${required#\*}" 2>/dev/null)" - test -e "$required" || continue - fmt="$(find ${WEB2C} -name "${egine}.fmt" -o -name "${egine}.mem" -o -name "${egine}.base")" - test -e "$fmt" || continue + line=($rest) + last=${line[-1]} + inifile=${last#\*} + case "$engine" in + mpost) fmt="$format.mem"; kpse=mpost; engine=metapost ;; + 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" + then +# init=true +# > /var/run/texlive/run-fmtutil + continue + fi test "$fmt" -nt "$TEXMFCNFFILE" || init=true - test "$fmt" -nt "$required" && continue - case "${fmt##*.}" in - fmt) - > /var/run/texlive/run-fmtutil.refresh ;; - base|mem) - fmtutil-sys --byfmt "$egine" ;; + test "$fmt" -nt "$inifile" && continue + case "$engine" in + mpost) fmtutil-sys --byfmt "$egine" < /dev/null 1>&4 2>&4 ;; + mf|mfw|mf-nowin) fmtutil-sys --byfmt "$egine" < /dev/null 1>&4 2>&4 ;; + *) > /var/run/texlive/run-fmtutil.refresh esac done < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu") -unset egine fmt required +unset format engine language rest line last inifile fmt kpse engine if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua} ; do @@ -275,28 +285,31 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" -a -n "${cnf_llua}" ; then # # Create new formats for new language.dat and/or language.def if needed # - while read egine required + while read format engine language rest do - case "$required" in - *language.*) ;; - *) continue ;; + 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 - language=language${required#*language} - language=${language%% *} - required="${required##* }" - required="$(kpsewhich "${required#\*}" 2>/dev/null)" - test -e "$required" || continue - fmt="$(find ${WEB2C} -name "${egine}.fmt")" - test -e "$fmt" || continue - for cfg in ${cnf_ldat} ${cnf_ldef} ${cnf_llua} + 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//,/ } do - test $language = "${cfg##*/}" || continue - test $fmt -nt $cfg && continue - > /var/run/texlive/run-fmtutil.language - break 2 + 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 < <(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu") - unset egine fmt required + unset format engine language lang rest line last inifile fmt kpse engine fi tcfmgr () From f0d76853bffe6268371c848ab1e3dd7f1314a33ec2f5d72c8defc5ecb33b3a3f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 12 Jul 2017 07:45:02 +0000 Subject: [PATCH 3/3] . OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=68 --- texlive-filesystem.changes | 6 ++++++ update.texlive | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/texlive-filesystem.changes b/texlive-filesystem.changes index 9dfedd5..cae8b29 100644 --- a/texlive-filesystem.changes +++ b/texlive-filesystem.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 12 07:41:21 UTC 2017 - werner@suse.de + +- Generate/remove specific formats at installation/erease of a + package (boo#1046277) + ------------------------------------------------------------------- Tue Jul 11 12:00:53 UTC 2017 - werner@suse.de diff --git a/update.texlive b/update.texlive index ee03479..0ef07aa 100644 --- a/update.texlive +++ b/update.texlive @@ -416,13 +416,19 @@ for run in /var/run/texlive/run-fmtutil* ; do test $VERBOSE = true && echo ((rc != 0)) || rm -f /var/run/texlive/run-fmtutil.refresh ;; - *) + "") test $VERBOSE = true && echo -en "\r[ ]Updating TeX formats." fmtutil-sys ${option:+$option} --missing < /dev/null 1>&4 2>&4 let rc+=$? test $VERBOSE = true && echo ((rc != 0)) || rm -f /var/run/texlive/run-fmtutil ;; + *) + test $VERBOSE = true && echo -en "\r[ ]Updating TeX format ${run#*fmtutil.}." + 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 esac done