Support mkiv as well as lmtx ConTeXt formats

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=164
This commit is contained in:
Dr. Werner Fink 2023-04-05 08:37:26 +00:00 committed by Git OBS Bridge
parent 0876948934
commit 44b8f17445
2 changed files with 61 additions and 34 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Apr 5 08:24:31 UTC 2023 - Dr. Werner Fink <werner@suse.de>
- Support mkiv as well as lmtx ConTeXt formats
-------------------------------------------------------------------
Tue Apr 4 13:52:37 UTC 2023 - Dr. Werner Fink <werner@suse.de>

View File

@ -478,17 +478,64 @@ has_formats()
return 1
}
make_context_fmts()
{
local -i status=0
# luametatex/lmtx
for fmt in ${TEXMFDIST}/tex/context/base/mkxl/cont-[a-z][a-z].mkxl
do
test -x /usr/bin/mtxrun || break
fmt=${fmt##*/}
fmt=${fmt%.*}
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/context $fmt --make < /dev/null 1>&4 2>&4
let status+=$?
done
# luatex/mkiv
for fmt in ${TEXMFDIST}/tex/context/base/mkiv/cont-[a-z][a-z].mkiv
do
test -x /usr/bin/mtxrun || break
fmt=${fmt##*/}
fmt=${fmt%.*}
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/context $fmt --luatex --make < /dev/null 1>&4 2>&4
let status+=$?
done
# rehash database
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/mtxrun --script fonts --reload < /dev/null 1>&4 2>&4
let status+=$?
return status
}
#
# ConTeXt data bases
#
if test -x /usr/bin/mtxrun ; then
test $VERBOSE = true && { echo -en "\r[ ]Generate file database."; let nl++; }
# luametatex/lmtx
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/mtxrun --generate < /dev/null 1>&4 2>&4
let rc+=$?
# luatex/mkiv
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/context --luatex --generate < /dev/null 1>&4 2>&4
let rc+=$?
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
@ -526,18 +573,10 @@ for run in /var/run/texlive/run-fmtutil.* /var/run/texlive/run-fmtutil ; do
context)
test $VERBOSE = true && { echo -en "\r[ ](Re)fresh ConTeXt formats."; let nl++; }
for fmt in ${TEXMFDIST}/tex/context/base/mkxl/cont-[a-z][a-z].mkxl
do
test -x /usr/bin/mtxrun || break
fmt=${fmt##*/}
fmt=${fmt%.*}
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/mtxrun $fmt --make < /dev/null 1>&4 2>&4
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
done
make_context_fmts
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
((rc != 0)) || rm -f "${run}"
;;
language)
@ -571,17 +610,9 @@ for run in /var/run/texlive/run-fmtutil.* /var/run/texlive/run-fmtutil ; do
((nl == 0)) || { echo; let nl=0; }
elif test -x /usr/bin/mtxrun > /dev/null 2>&2 ; then
test $VERBOSE = true && { echo -en "\r[ ]Handle language.dat.lua setups."; let nl++; }
for fmt in ${TEXMFDIST}/tex/context/base/mkxl/cont-[a-z][a-z].mkxl
do
fmt=${fmt##*/}
fmt=${fmt%.*}
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/mtxrun $fmt --make < /dev/null 1>&4 2>&4
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
done
make_context_fmts
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
fi
fi
((rc != 0)) || rm -f /var/run/texlive/run-fmtutil.language
@ -591,23 +622,14 @@ for run in /var/run/texlive/run-fmtutil.* /var/run/texlive/run-fmtutil ; do
fmtutil-sys ${option:+$option} --refresh --no-strict < /dev/null 1>&4 2>&4
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
for fmt in ${TEXMFDIST}/tex/context/base/mkxl/cont-[a-z][a-z].mkxl
do
fmt=${fmt##*/}
fmt=${fmt%.*}
LUATEXDIR=${TEXMFDIST}/scripts/context/lua \
TEXMFCACHE=${TEXMFVAR} \
TEXMFCNF="home:texmf/web2c;${TEXMFCNFFILE%/*};${TEXMFDIST}/web2c" \
/usr/bin/mtxrun $fmt --make < /dev/null 1>&4 2>&4
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
done
((rc != 0)) || rm -f /var/run/texlive/run-fmtutil.refresh
;;
"/var/run/texlive/run-fmtutil")
test $VERBOSE = true && { echo -en "\r[ ]Missing TeX formats."; let nl++; }
fmtutil-sys ${option:+$option} --missing --no-strict < /dev/null 1>&4 2>&4
let rc+=$?
make_context_fmts
let rc+=$?
((nl == 0)) || { echo; let nl=0; }
((rc != 0)) || rm -f /var/run/texlive/run-fmtutil
;;