forked from pool/texlive-filesystem
.
OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=9
This commit is contained in:
parent
b4e08f03b7
commit
ea9fcfac51
@ -16,13 +16,27 @@ typeset -i rc=0
|
||||
|
||||
test -r /etc/sysconfig/suseconfig && . /etc/sysconfig/suseconfig
|
||||
|
||||
#
|
||||
# We need a check for an already modified texlive configuration:
|
||||
# therefore we use md5 check sums.
|
||||
#
|
||||
LIBDIR=/var/lib/texmf
|
||||
MD5DIR=$LIBDIR/md5
|
||||
OLDMD5DIR=/var/adm/SuSEconfig/md5
|
||||
mkdir -p $MD5DIR || exit 0
|
||||
|
||||
unset ${!LC_*}
|
||||
LANG=POSIX
|
||||
MKTEXLSR=true
|
||||
export LANG MKTEXLSR
|
||||
|
||||
mkdir -p /var/run/texlive
|
||||
test $? -gt 0 && exit 0
|
||||
mkdir -p /var/run/texlive || exit 0
|
||||
|
||||
#
|
||||
# Sanity check
|
||||
#
|
||||
size=$(find /etc/texmf/ls-R -follow -printf '%s')
|
||||
test $size -lt 80 && > /var/run/texlive/run-mktexlsr
|
||||
|
||||
rotator ()
|
||||
{
|
||||
@ -40,16 +54,30 @@ else
|
||||
exec 4> /dev/null
|
||||
fi
|
||||
|
||||
type -p mktexlsr &> /dev/null || exit 0
|
||||
type -p kpsewhich &> /dev/null || exit 0
|
||||
type -p updmap-sys &> /dev/null || exit 0
|
||||
type -p find &> /dev/null || { echo "${0##*/}: No find in PATH ... skipping"; exit 0 ; }
|
||||
type -p sort &> /dev/null || { echo "${0##*/}: No sort in PATH ... skipping"; exit 0 ; }
|
||||
type -p env &> /dev/null || { echo "${0##*/}: No env in PATH ... skipping"; exit 0 ; }
|
||||
type -p sed &> /dev/null || { echo "${0##*/}: No sed in PATH ... skipping"; exit 0 ; }
|
||||
type -p tr &> /dev/null || { echo "${0##*/}: No tr in PATH ... skipping"; exit 0 ; }
|
||||
type -p grep &> /dev/null || { echo "${0##*/}: No grep in PATH ... skipping"; exit 0 ; }
|
||||
type -p ed &> /dev/null || { echo "${0##*/}: No ed in PATH ... skipping"; exit 0 ; }
|
||||
type -p mktexlsr &> /dev/null || { echo "${0##*/}: No mktexlsr in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
|
||||
#
|
||||
# Straightforward ... here we go
|
||||
#
|
||||
for run in /var/run/texlive/run-mktexlsr* ; do
|
||||
test -e $run || break
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX hash data base."
|
||||
mktexlsr < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
done
|
||||
|
||||
type -p kpsewhich &> /dev/null || { echo "${0##*/}: No kpsewhich in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p md5sum &> /dev/null || { echo "${0##*/}: No md5sum in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p readlink &> /dev/null || { echo "${0##*/}: No readlink in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p find &> /dev/null || { echo "${0##*/}: No find in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p sort &> /dev/null || { echo "${0##*/}: No sort in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p env &> /dev/null || { echo "${0##*/}: No env in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p sed &> /dev/null || { echo "${0##*/}: No sed in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p tr &> /dev/null || { echo "${0##*/}: No tr in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p grep &> /dev/null || { echo "${0##*/}: No grep in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
type -p ed &> /dev/null || { echo "${0##*/}: No ed in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
|
||||
# Be sure that configuring in /etc/texmf will work even if
|
||||
# there are files relative to /etc/texmf ...
|
||||
@ -61,11 +89,62 @@ unset KPSE_DOT || true
|
||||
: ${TEXMFSYSCONFIG:=$(kpsewhich --expand-path='$TEXMFSYSCONFIG' 2> /dev/null)}
|
||||
: ${TEXMFLSR:=$(kpsewhich --show-path=ls-R 2> /dev/null)}
|
||||
: ${WEB2C:=$TEXMFVAR/web2c}
|
||||
|
||||
test -L "$TEXMFCNFFILE" && TEXMFCNFFILE="$(readlink -f "$TEXMFCNFFILE" 2> /dev/null)"
|
||||
|
||||
size=$(find /etc/texmf/ls-R -follow -printf '%s')
|
||||
test $size -lt 80 && > /var/run/texlive/run-mktexlsr
|
||||
#
|
||||
# Language and hyphenation setup
|
||||
#
|
||||
cnf_ldat=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.dat 2> /dev/null)
|
||||
cnf_ldef=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.def 2> /dev/null)
|
||||
|
||||
if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then
|
||||
for cfg in ${cnf_ldat} ${cnf_ldef} ; do
|
||||
test -s ${OLDMD5DIR}${cfg} || continue
|
||||
if test -e ${MD5DIR}${cfg} ; then
|
||||
if test ${MD5DIR}${cfg} -nt ${OLDMD5DIR}${cfg} ; then
|
||||
rm -f ${OLDMD5DIR}${cfg}
|
||||
continue
|
||||
fi
|
||||
else
|
||||
mkdir -p ${MD5DIR}${cfg%/*}
|
||||
fi
|
||||
mv -f ${OLDMD5DIR}${cfg} ${MD5DIR}${cfg}
|
||||
done
|
||||
md5_ldat=${MD5DIR}${cnf_ldat}
|
||||
md5_ldef=${MD5DIR}${cnf_ldef}
|
||||
set -- $(md5sum < ${cnf_ldat}) ; md5ldat="$1"
|
||||
set -- $(md5sum < ${cnf_ldef}) ; md5ldef="$1"
|
||||
|
||||
#
|
||||
# Previous md5 sums
|
||||
#
|
||||
omd5ldat=0
|
||||
omd5ldef=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
|
||||
|
||||
#
|
||||
# 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
|
||||
fi
|
||||
|
||||
tcfmgr ()
|
||||
{
|
||||
@ -81,36 +160,54 @@ enablemaps ()
|
||||
}
|
||||
|
||||
#
|
||||
# Straightforward ... here we go
|
||||
# Go further
|
||||
#
|
||||
for run in /var/run/texlive/run-mktexlsr* ; do
|
||||
test -e $run || break
|
||||
test $VERBOSE = true && echo -e "\r[ ]Updating TeX hash data base."
|
||||
mktexlsr < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
done
|
||||
for run in /var/run/texlive/run-fmtutil* ; do
|
||||
test -e $run || break
|
||||
test $VERBOSE = true && echo -e "\r[ ]Updating TeX formats."
|
||||
fmtutil-sys --missing < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
type -p fmtutil-sys &> /dev/null || { echo "${0##*/}: No fmtutil-sys in PATH ... skipping" 1>&2; break; }
|
||||
case "${run#*fmtutil.}" in
|
||||
language)
|
||||
test -n "${cnf_ldat}" -a -n "${cnf_ldef}" || continue
|
||||
set -- $(md5sum < ${cnf_ldat})
|
||||
set -- $(md5sum < ${cnf_ldef})
|
||||
echo $1 > ${md5_ldat}
|
||||
echo $1 > ${md5_ldef}
|
||||
test $VERBOSE = true && echo -en "\r[ ]Handle language.dat setups."
|
||||
fmtutil-sys --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 --byhyphen ${cnf_ldef} < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
;;
|
||||
*)
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX formats."
|
||||
fmtutil-sys --missing < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
;;
|
||||
esac
|
||||
rm -f /var/run/texlive/run-fmtutil*
|
||||
done
|
||||
for run in /var/run/texlive/run-updmap* ; do
|
||||
if test -e $run ; then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Updating TeX font mappings."
|
||||
type -p updmap-sys &> /dev/null || { echo "${0##*/}: No updmap-sys in PATH ... skipping" 1>&2; break; }
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
|
||||
updmap-sys --nohash < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
rm -f /var/run/texlive/run-updmap*
|
||||
else
|
||||
type -p updmap-sys &> /dev/null || break
|
||||
typeset -i n=0
|
||||
cfg=$(tcfmgr --cmd find --file updmap.cfg)
|
||||
if test -e ${cfg} ; then
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
|
||||
updmap-sys --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
enablemaps | \
|
||||
while read line ; do
|
||||
((n++ == 0)) && test $VERBOSE = true && echo -e "\r[ ]Updating TeX font mappings."
|
||||
line='^#![[:space:]]*((Mixed)?Map)[[:space:]]*('$line')'
|
||||
emap=$(sed -n -r "s/$line/\1=\3/p" ${cfg})
|
||||
updmap-sys --nohash --nomkmap --enable $emap < /dev/null 1>&4 2>&4
|
||||
@ -118,23 +215,24 @@ for run in /var/run/texlive/run-updmap* ; do
|
||||
done
|
||||
updmap-sys < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if test -x /usr/bin/mtxrun ; then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Generate file database."
|
||||
test $VERBOSE = true && echo -en "\r[ ]Generate file database."
|
||||
TEXMF=${TEXMFDIST} \
|
||||
TEXMFCACHE=${TEXMFVAR} \
|
||||
TEXMFCNF=${TEXMFCNFFILE%/*} \
|
||||
/usr/bin/mtxrun --generate < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
|
||||
#
|
||||
# If texmf.cnf has changed it may contain changed memory sizes
|
||||
# of various programs.
|
||||
#
|
||||
type -p readlink &> /dev/null || exit 0
|
||||
type -p texconfig-sys &> /dev/null || exit 0
|
||||
|
||||
#
|
||||
@ -153,48 +251,30 @@ for f in $(find ${WEB2C}/ -name '*.fmt' -name '*.mem' -o -name '*.base') ; do
|
||||
test -s "$f" && touch "$f"
|
||||
done
|
||||
if test $init = true ; then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Initialize TeX configuration and font mappings."
|
||||
test $VERBOSE = true && echo -en "\r[ ]Initialize TeX configuration and font mappings."
|
||||
updmap-sys --syncwithtrees < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
texconfig-sys init < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
|
||||
#
|
||||
# These are required.
|
||||
#
|
||||
type -p md5sum &> /dev/null || exit 0
|
||||
|
||||
#
|
||||
# We need a check for an already modified texlive configuration:
|
||||
# therefore we use md5 check sums.
|
||||
#
|
||||
LIBDIR=/var/lib/texmf
|
||||
MD5DIR=$LIBDIR/md5
|
||||
OLDMD5DIR=/var/adm/SuSEconfig/md5
|
||||
mkdir -p $MD5DIR
|
||||
test $? -gt 0 && exit 0
|
||||
|
||||
#
|
||||
# The main configuration files of TeXLive.
|
||||
#
|
||||
type -p fmtutil-sys &> /dev/null || exit 0
|
||||
|
||||
cnf_mfont=$(tcfmgr --cmd find --file mktex.cnf)
|
||||
cnf_xdvi=$(tcfmgr --cmd find --file XDvi)
|
||||
cnf_dvips=$(tcfmgr --cmd find --file config.ps)
|
||||
cnf_lang=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.dat 2> /dev/null)
|
||||
cnf_base=$(TEXMF=$TEXMFMAIN kpsewhich language.us 2> /dev/null)
|
||||
|
||||
test -n "${cnf_mfont}" || exit 0
|
||||
test -n "${cnf_xdvi}" || exit 0
|
||||
test -n "${cnf_dvips}" || exit 0
|
||||
test -n "${cnf_lang}" || exit 0
|
||||
|
||||
for cfg in ${cnf_mfont} ${cnf_xdvi} ${cnf_dvips} ${cnf_lang} cups ; do
|
||||
for cfg in ${cnf_mfont} ${cnf_xdvi} ${cnf_dvips} cups ; do
|
||||
test -s ${OLDMD5DIR}${cfg} || continue
|
||||
if test -e ${MD5DIR}${cfg} ; then
|
||||
if test -a ${MD5DIR}${cfg} -nt ${OLDMD5DIR}${cfg} ; then
|
||||
if test ${MD5DIR}${cfg} -nt ${OLDMD5DIR}${cfg} ; then
|
||||
rm -f ${OLDMD5DIR}${cfg}
|
||||
continue
|
||||
fi
|
||||
@ -207,7 +287,6 @@ done
|
||||
md5_mfont=${MD5DIR}${cnf_mfont}
|
||||
md5_xdvi=${MD5DIR}${cnf_xdvi}
|
||||
md5_dvips=${MD5DIR}${cnf_dvips}
|
||||
md5_lang=${MD5DIR}${cnf_lang}
|
||||
md5_cups=${MD5DIR}/cups
|
||||
|
||||
#
|
||||
@ -216,7 +295,6 @@ md5_dvips=${MD5DIR}${cnf_dvips}
|
||||
test -e ${cnf_mfont} || exit 0 # Default MetaFont mode
|
||||
test -e ${cnf_xdvi} || exit 0 # Default xdvi resolution
|
||||
test -e ${cnf_dvips} || exit 0 # Default printer mode
|
||||
test -e ${cnf_lang} || exit 0 # Default hyphenation
|
||||
|
||||
#
|
||||
# Current MD5 sums
|
||||
@ -224,31 +302,6 @@ test -e ${cnf_lang} || exit 0 # Default hyphenation
|
||||
set -- $(md5sum < ${cnf_mfont}) ; md5modes="$1"
|
||||
set -- $(md5sum < ${cnf_xdvi} ) ; md5xdvi="$1"
|
||||
set -- $(md5sum < ${cnf_dvips}) ; md5dvips="$1"
|
||||
set -- $(md5sum < ${cnf_lang} ) ; md5lang="$1"
|
||||
|
||||
#
|
||||
# Previous md5 sums
|
||||
#
|
||||
omd5lang=0
|
||||
if test -e ${md5_lang} -a -r ${md5_lang} ; then
|
||||
test ${md5_lang} -nt ${cnf_lang} && md5_nt_lang="yes"
|
||||
set -- $(cat ${md5_lang}) ; omd5lang="$1"
|
||||
elif test ! -d ${md5_lang%/*} ; then
|
||||
mkdir -p ${md5_lang%/*}
|
||||
fi
|
||||
|
||||
#
|
||||
# Create new formats for new language.dat if needed
|
||||
#
|
||||
if test $omd5lang = 0 -o \
|
||||
\( $md5lang != $omd5lang -o "$md5_nt_lang" != "yes" \)
|
||||
then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Handle language setups."
|
||||
set -- $(md5sum < ${cnf_lang})
|
||||
echo $1 > ${md5_lang}
|
||||
fmtutil-sys --byhyphen ${cnf_lang} < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
fi
|
||||
|
||||
#
|
||||
# The main system printer.
|
||||
@ -506,31 +559,34 @@ esac
|
||||
if test $omd5modes = 0 -o \
|
||||
\( $md5modes = $omd5modes -a "$prtcap_nt_mfont" = "yes" -a "$md5_nt_mfont" = "yes" \)
|
||||
then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Set MetaFont mode."
|
||||
test $VERBOSE = true && echo -en "\r[ ]Set MetaFont mode."
|
||||
env -i MKTEXLSR=true PATH=$PATH LANG=$LANG texconfig-sys mode $PRINTER < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
set -- $(md5sum < ${cnf_mfont})
|
||||
echo $1 > ${md5_mfont}
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
if test $omd5xdvi = 0 -o \
|
||||
\( $md5xdvi = $omd5xdvi -a "$prtcap_nt_xdvi" = "yes" -a "$md5_nt_xdvi" = "yes" \)
|
||||
then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Set XDvi paper size."
|
||||
test $VERBOSE = true && echo -en "\r[ ]Set XDvi paper size."
|
||||
env -i MKTEXLSR=true PATH=$PATH LANG=$LANG texconfig-sys xdvi paper $XDVISIZE < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
set -- $(md5sum < ${cnf_xdvi})
|
||||
echo $1 > ${md5_xdvi}
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
if test $omd5dvips = 0 -o \
|
||||
\( $md5dvips = $omd5dvips -a "$prtcap_nt_dvips" = "yes" -a "$md5_nt_dvips" = "yes" \)
|
||||
then
|
||||
test $VERBOSE = true && echo -e "\r[ ]Set dvips mode and paper size."
|
||||
test $VERBOSE = true && echo -en "\r[ ]Set dvips mode and paper size."
|
||||
env -i MKTEXLSR=true PATH=$PATH LANG=$LANG texconfig-sys dvips mode $PRINTER < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
env -i MKTEXLSR=true PATH=$PATH LANG=$LANG texconfig-sys dvips paper $DVIPSSIZE < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
set -- $(md5sum < ${cnf_dvips})
|
||||
echo $1 > ${md5_dvips}
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
if test "$prtcap_nt_dvips" = "manual" -a \
|
||||
\( $md5dvips = $omd5dvips -o $omd5dvips = 0 \)
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 25 12:09:26 UTC 2012 - werner@suse.de
|
||||
|
||||
- Reoder update script
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 22 16:45:19 UTC 2012 - werner@suse.de
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user