.
OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=17
This commit is contained in:
parent
35b959c943
commit
4fa3108442
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 12 09:54:02 UTC 2012 - werner@suse.de
|
||||
|
||||
- Make update script to run updmap-sys only once on texhash
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 11 15:18:34 UTC 2012 - werner@suse.de
|
||||
|
||||
|
103
update.texlive
103
update.texlive
@ -46,12 +46,18 @@ test $size -lt 80 && > /var/run/texlive/run-mktexlsr
|
||||
|
||||
rotator ()
|
||||
{
|
||||
local -i i=0
|
||||
local -i i=0 n=0
|
||||
local -a elements=('|' '/' '-' '\')
|
||||
while read -s -n 1 ; do
|
||||
printf "\r[${elements[((i++%4))]}]"
|
||||
let n=1
|
||||
done
|
||||
echo
|
||||
((n > 0)) && echo
|
||||
}
|
||||
|
||||
atexit()
|
||||
{
|
||||
exec 4>&-
|
||||
}
|
||||
|
||||
if test $VERBOSE = true ; then
|
||||
@ -59,6 +65,7 @@ if test $VERBOSE = true ; then
|
||||
else
|
||||
exec 4> /dev/null
|
||||
fi
|
||||
trap atexit EXIT
|
||||
|
||||
type -p mktexlsr &> /dev/null || { echo "${0##*/}: No mktexlsr in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
|
||||
@ -72,6 +79,7 @@ for run in /var/run/texlive/run-mktexlsr* ; do
|
||||
let rc+=$?
|
||||
test $VERBOSE = true && echo
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
> /var/run/texlive/sync-updmap
|
||||
done
|
||||
|
||||
type -p kpsewhich &> /dev/null || { echo "${0##*/}: No kpsewhich in PATH ... skipping" 1>&2; exit 0 ; }
|
||||
@ -159,10 +167,23 @@ tcfmgr ()
|
||||
|
||||
enablemaps ()
|
||||
{
|
||||
updmap-sys --quiet --nohash --listmaps < /dev/null 2> /dev/null | \
|
||||
sed -n -r 's@(#![[:space:]])(Mixed)?Map[[:space:]]*@@gp' | \
|
||||
local -i rc=0
|
||||
local -i hash=0
|
||||
local maps=($(updmap-sys --quiet --nohash --listmaps < /dev/null 2> /dev/null | \
|
||||
sed -n -r 's@(#![[:blank:]])(Mixed|Kanji)?Map[[:blank:]]*@@gp' | \
|
||||
xargs -r kpsewhich --format=map 2> /dev/null | \
|
||||
sed -r 's@.*/([^/]*)@\1@g'
|
||||
sed -r 's@.*/([^/]*)@\1@g'))
|
||||
local line emap
|
||||
((${#maps} == 0)) && return $rc
|
||||
for line in ${maps[@]} ; do
|
||||
let hash++
|
||||
line='^#![[:blank:]]*((Mixed|Kanji)?Map)[[:blank:]]*('$line')'
|
||||
emap=$(sed -n -r "s/$line/\1=\3/p" ${cfg})
|
||||
updmap-sys --nohash --nomkmap --enable $emap
|
||||
let rc+=$?
|
||||
done
|
||||
((hash > 0)) && > /var/run/texlive/run-mktexlsr
|
||||
return $rc
|
||||
}
|
||||
|
||||
#
|
||||
@ -198,36 +219,51 @@ for run in /var/run/texlive/run-fmtutil* ; do
|
||||
done
|
||||
|
||||
for run in /var/run/texlive/run-updmap* ; do
|
||||
if test -e $run ; then
|
||||
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."
|
||||
test -e $run || break
|
||||
type -p updmap-sys &> /dev/null || { echo "${0##*/}: No updmap-sys in PATH ... skipping" 1>&2; break; }
|
||||
cfg=$(tcfmgr --cmd find --file updmap.cfg)
|
||||
test -e $cfg || break
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
|
||||
updmap-sys --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
enablemaps $cfg < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
if test -e /var/run/texlive/run-mktexlsr ; then
|
||||
updmap-sys < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
else
|
||||
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+=$?
|
||||
while read line ; do
|
||||
let n++
|
||||
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
|
||||
let rc+=$?
|
||||
done < <(enablemaps)
|
||||
if ((n > 0)) ; then
|
||||
updmap-sys < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
fi
|
||||
test $VERBOSE = true && echo
|
||||
fi
|
||||
fi
|
||||
# test $VERBOSE = true && echo
|
||||
rm -f /var/run/texlive/run-updmap*
|
||||
rm -f /var/run/texlive/sync-updmap*
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
done
|
||||
|
||||
for run in /var/run/texlive/sync-updmap* ; do
|
||||
test -e $run || break
|
||||
type -p updmap-sys &> /dev/null || break
|
||||
cfg=$(tcfmgr --cmd find --file updmap.cfg)
|
||||
test -e $cfg || break
|
||||
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
|
||||
updmap-sys --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
enablemaps $cfg < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
if test -e /var/run/texlive/run-mktexlsr ; then
|
||||
updmap-sys < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
else
|
||||
updmap-sys --nohash < /dev/null 1>&4 2>&4
|
||||
let rc+=$?
|
||||
fi
|
||||
# test $VERBOSE = true && echo
|
||||
rm -f /var/run/texlive/sync-updmap*
|
||||
rm -f /var/run/texlive/run-mktexlsr*
|
||||
done
|
||||
|
||||
if test -x /usr/bin/mtxrun ; then
|
||||
test $VERBOSE = true && echo -en "\r[ ]Generate file database."
|
||||
TEXMF=${TEXMFDIST} \
|
||||
@ -248,7 +284,7 @@ type -p texconfig-sys &> /dev/null || exit 0
|
||||
# Configuration broken
|
||||
#
|
||||
if test ! -e "$TEXMFCNFFILE" ; then
|
||||
echo "${0##*/}: Configuration of texlive installation not found."
|
||||
echo "${0##*/}: Configuration of texlive installation not found." 1>&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -607,8 +643,5 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $VERBOSE = true ; then
|
||||
exec 4>&-
|
||||
fi
|
||||
##
|
||||
exit $rc
|
||||
|
Loading…
Reference in New Issue
Block a user