Have a directory to hold the splitted hyphen informations

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=58
This commit is contained in:
Dr. Werner Fink 2016-06-21 15:34:09 +00:00 committed by Git OBS Bridge
parent 1847173876
commit ca6b6678d8
3 changed files with 172 additions and 53 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jun 20 07:54:36 UTC 2016 - werner@suse.de
- Have a directory to hold the splitted hyphen informations
-------------------------------------------------------------------
Tue Jun 7 16:44:43 UTC 2016 - werner@suse.de

View File

@ -19,7 +19,7 @@
%define texlive_version 2016
%define texlive_previous 2015
%define texlive_release 20160523
%define texlive_noarch 105
%define texlive_noarch 108
%define texlive_source texlive-20160523-source
%define __perl_requires %{nil}
@ -4306,6 +4306,7 @@ popd
mkdir -p %{buildroot}%{_texmfconfdir}/tex/plain/cyrplain
mkdir -p %{buildroot}%{_texmfconfdir}/web2c
mkdir -p %{buildroot}%{_texmfconfdir}/xdvi
mkdir -p %{buildroot}%{_texmfdistdir}/tex/generic/config/language.splits
mkdir -p %{buildroot}%{_texmfdistdir}/scripts/m-tx
mkdir -p %{buildroot}%{_texmfdistdir}/scripts/pmx
mkdir -p %{buildroot}%{_texmfmaindir}/scripts/texlive
@ -13391,6 +13392,7 @@ fi
%dir %{_texmfdistdir}/doc
%dir %{_texmfdistdir}/doc/chktex
%dir %{_texmfdistdir}/doc/bibtex8
%dir %{_texmfdistdir}/tex/generic/config/language.splits
%dir %{_texmfdistdir}/scripts
%dir %{_texmfdistdir}/scripts/chktex
%dir %{_texmfdistdir}/scripts/ps2eps

View File

@ -12,10 +12,11 @@
# Copyright (c) 2004 SuSE LINUX AG, Germany. All rights reserved.
# Copyright (c) 2007-2009 SuSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011-2012 SuSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE Linux GmbH, Nuernberg, Germany.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# Author: Werner Fink, 1997-2012
# Author: Werner Fink, 1997-2012,2016
#
typeset -r OLDIFS="$IFS"
@ -111,10 +112,32 @@ 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_llua=$(TEXMF=$TEXMFSYSCONFIG kpsewhich language.dat.lua 2> /dev/null)
cnf_fmtu=$(TEXMF=$TEXMFSYSCONFIG kpsewhich fmtutil.cnf 2> /dev/null)
cnf_umap=$(TEXMF=$TEXMFSYSCONFIG kpsewhich updmap.cfg 2> /dev/null)
if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then
for cfg in ${cnf_ldat} ${cnf_ldef} ; do
if test -z "$cnf_llua" ; then
#
# RPM has trouble with symbolic links instead of files
#
old=$(TEXMF=$TEXMFDIST kpsewhich language.dat.lua 2> /dev/null)
if test -n "$old" -a -e "$old" -a ! -L "$old" ; then
base="${old##*/}"
path="${old%/*}"
if test -d ${TEXMFSYSCONFIG}${path#$TEXMFDIST}; then
cnf_llua="${TEXMFSYSCONFIG}${path#$TEXMFDIST}/$base"
if test -e "$cnf_llua" ; then
rm -f "$old"
else
mv "$old" "$cnf_llua"
fi
ln -sf "$cnf_llua" "$old"
fi
fi
fi
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
if test -e ${MD5DIR}${cfg} ; then
if test ${MD5DIR}${cfg} -nt ${OLDMD5DIR}${cfg} ; then
@ -126,16 +149,62 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then
fi
mv -f ${OLDMD5DIR}${cfg} ${MD5DIR}${cfg}
done
#
# Handle hyphens
#
for run in /var/run/texlive/run-hyphen* ; do
tmp=${cnf_ldat}.$RANDOM
set -C
echo "% Generated by ${TEXMFDIST}/texconfig/update on $(date)" > $tmp
cat ${TEXMFDIST}/tex/generic/config/language.us >> $tmp
for dat in ${TEXMFDIST}/tex/generic/config/language.splits/*.dat ; do
test -e "$dat" || break
cat "$dat"
done >> $tmp
mv -f $tmp ${cnf_ldat}
#
tmp=${cnf_ldef}.$RANDOM
cat ${TEXMFDIST}/tex/generic/config/language.us.def >> $tmp
for def in ${TEXMFDIST}/tex/generic/config/language.splits/*.def ; do
test -e "$def" || break
cat "$def"
done >> $tmp
echo '%%% No changes may be made beyond this point.' >> $tmp
echo >> $tmp
echo '\uselanguage {USenglish} %%% This MUST be the last line of the file.' >> $tmp
mv -f $tmp ${cnf_ldef}
#
tmp=${cnf_llua}.$RANDOM
echo "-- Generated by ${TEXMFDIST}/texconfig/update on $(date)" > $tmp
cat ${TEXMFDIST}/tex/generic/config/language.us.lua >> $tmp
for lua in ${TEXMFDIST}/tex/generic/config/language.splits/*.dat.lua ; do
test -e "$lua" || break
cat "$lua"
done >> $tmp
# Silent editor {
echo '}' >> $tmp
mv -f $tmp ${cnf_llua}
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"
#
# Previous md5 sums
#
omd5ldat=0
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"
@ -148,6 +217,12 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then
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%/*}
fi
#
# Create new formats for new language.dat and/or language.def if needed
@ -160,6 +235,10 @@ if test -n "${cnf_ldat}" -a -n "${cnf_ldef}" ; then
then
> /var/run/texlive/run-fmtutil.language
fi
if test $omd5llua = 0 -o \( $md5llua != $omd5lua -o "$md5_nt_llua" != "yes" \)
then
> /var/run/texlive/run-fmtutil.language
fi
fi
tcfmgr ()
@ -171,45 +250,47 @@ enablemaps ()
{
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' | \
local -a maps=($(sed -rn "s@^(\#\![[= =]]+)(Mixed|Kanji)?Map[[:blank:]]*@@gp" < $cnf_umap | \
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
emap=$(sed -rn "s/^\#\![[= =]]+((Mixed|Kanji)?Map)[[:blank:]]*(${line})/\1=\3/p" $cnf_umap)
updmap-sys --cnffile $cnf_umap --nohash --nomkmap --enable $emap
let rc+=$?
done
((hash > 0)) && > /var/run/texlive/run-mktexlsr
return $rc
}
has_formats()
{
local hyphen
local hyphen format=tex
local OIFS="$IFS"
local IFS=$'\n'
local -a list=($(sed -r '/^#/d; /^[[:blank:]]*$/d' $cnf_fmtu))
test -e "$cnf_fmtu" || return 1
local -a list=($(sed -r "/^(\#.*|[[:blank:]]*)$/d" "$cnf_fmtu"))
local -a line
IFS="$OIFS"
local -i count=${#list[@]}
local -i last
case "$1" in
*.lua) format=lua
esac
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
hyphen=$(kpsewhich -progname=${line[0]} -format=$format ${line[2]} 2>/dev/null) || continue
test -n "$hyphen" -a -e "$hyphen" -a "${hyphen##*/}" = "${1##*/}" || continue
return 0
done
return 1
@ -225,22 +306,35 @@ for run in /var/run/texlive/run-fmtutil* ; do
test $VERBOSE = true || option="--quiet"
case "${run#*fmtutil.}" in
language)
test -n "${cnf_ldat}" -a -n "${cnf_ldef}" || continue
set -- $(md5sum < ${cnf_ldat})
echo $1 > ${md5_ldat}
set -- $(md5sum < ${cnf_ldef})
echo $1 > ${md5_ldef}
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
if test -n "${cnf_ldat}" ; then
set -- $(md5sum < ${cnf_ldat})
echo $1 > ${md5_ldat}
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
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
if test -n "${cnf_ldef}" ; then
set -- $(md5sum < ${cnf_ldef})
echo $1 > ${md5_ldef}
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
fi
if test -n "${cnf_llua}" ; then
set -- $(md5sum < ${cnf_llua})
echo $1 > ${md5_llua}
if has_formats ${cnf_llua} ; then
test $VERBOSE = true && echo -en "\r[ ]Handle language.def setups."
fmtutil-sys ${option:+$option} --byhyphen ${cnf_llua} < /dev/null 1>&4 2>&4
let rc+=$?
test $VERBOSE = true && echo
fi
fi
((rc != 0)) || rm -f /var/run/texlive/run-fmtutil.language
;;
@ -264,18 +358,35 @@ done
for run in /var/run/texlive/run-updmap* ; do
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 -e "$cnf_umap" || break
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
updmap-sys --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
while read type map; do
case "$type" in
[Aa]dd*)
type=${type#[Aa]dd}
if grep -qsE "${type}[[:blank:]]+${map}" $cnf_umap ; then
sed -ri "s/^\#\![[= =]]+(${type}[[:blank:]]+${map})/\1/" $cnf_umap
else
echo "${type} ${map}" >> $cnf_umap
fi
;;
[Dd]elete*)
type=${type#[Dd]elete}
sed -ri "s/^(${type}[[:blank:]]+${map})/\#\! \1/" $cnf_umap
;;
*)
;;
esac
done < $run
updmap-sys --cnffile $cnf_umap --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
let rc+=$?
enablemaps $cfg < /dev/null 1>&4 2>&4
enablemaps $cnf_umap < /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
updmap-sys --cnffile $cnf_umap < /dev/null 1>&4 2>&4
let rc+=$?
else
updmap-sys --nohash < /dev/null 1>&4 2>&4
updmap-sys --cnffile $cnf_umap --nohash < /dev/null 1>&4 2>&4
let rc+=$?
fi
# test $VERBOSE = true && echo
@ -288,19 +399,18 @@ 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 -e "$cnf_umap" || break
test $VERBOSE = true && echo -en "\r[ ]Updating TeX font mappings."
updmap-sys --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
updmap-sys --cnffile $cnf_umap --nohash --nomkmap --syncwithtrees < /dev/null 1>&4 2>&4
let rc+=$?
enablemaps $cfg < /dev/null 1>&4 2>&4
enablemaps $cnf_umap < /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
updmap-sys --cnffile $cnf_umap < /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
updmap-sys --cnffile $cnf_umap --nohash < /dev/null 1>&4 2>&4
let rc+=$?
fi
# test $VERBOSE = true && echo
@ -342,7 +452,7 @@ for f in $(find ${WEB2C}/ -name '*.fmt' -name '*.mem' -o -name '*.base') ; do
done
if test $init = true ; then
test $VERBOSE = true && echo -en "\r[ ]Initialize TeX configuration and font mappings."
updmap-sys --syncwithtrees < /dev/null 1>&4 2>&4
updmap-sys --cnffile $cnf_umap --syncwithtrees < /dev/null 1>&4 2>&4
let rc+=$?
texconfig-sys init < /dev/null 1>&4 2>&4
let rc+=$?
@ -400,16 +510,16 @@ lp=""
if type -p lpoptions &>/dev/null && lpstat -r &>/dev/null ; then
dev=PS
size=a4
dpi=300
dpi=600
color=mono
IFS=$'\n'
lpopt=($(lpoptions -l 2> /dev/null))
IFS="$OLDIFS"
shopt -s extglob
for line in "${lpopt[@]}" ; do
while read line ; do
case "$line" in
PageSize*)
set -- $line
shift
while test -n "$1" ; do
case "$1" in
\**) size="${1:1}"; break
@ -417,13 +527,14 @@ if type -p lpoptions &>/dev/null && lpstat -r &>/dev/null ; then
shift
done
;;
Resolution*)
CN_DPI*|Resolution*)
set -- $line
reg='?(\*)@(+([0-9])|+([0-9])x+([0-9]))dpi'
shift
cur=0
while test -n "$1" ; do
case "$1" in
$reg) cur=${1%%+([[:alpha:]])}
?(\*)@(+([0-9])|+([0-9])x+([0-9]))dpi)
cur=${1%%+([[:alpha:]])}
esac
cur="${cur#\*}"
case "$1" in
@ -435,6 +546,7 @@ if type -p lpoptions &>/dev/null && lpstat -r &>/dev/null ; then
;;
ColorCorrection*)
set -- $line
shift
while test -n "$1" ; do
case "$1" in
\*RGB|\*CMYK) color=color; break
@ -443,7 +555,7 @@ if type -p lpoptions &>/dev/null && lpstat -r &>/dev/null ; then
done
;;
esac
done
done < <(lpoptions -l 2> /dev/null)
shopt -u extglob
lp="lp|${dev}-$(echo ${size}-auto-${color}-${dpi}|tr '[:upper:]' '[:lower:]')"
elif test -r /etc/printcap -a -d /var/lib/apsfilter/ ; then
@ -573,7 +685,7 @@ esac
#
# Parse the configured system main printer
# Ghostscript/PS <-> Metafont mode and paper size
# (UNTESTED, Sorry I've *not* enough printers around)
# UNTESTED, Sorry I've *not* enough printers around
#
function get_paper () {
(