void-packages/srcpkgs/xbps-triggers/files/texmf-dist

42 lines
770 B
Bash
Executable File

#!/bin/sh
#
# Updates texmf-dist hashes and format library.
#
# Arguments: $ACTION = [run/targets]
# $TARGET = [post-install/post-remove]
# $PKGNAME
# $VERSION
# $UPDATE = [yes/no]
#
ACTION="$1"
TARGET="$2"
PKGNAME="$3"
VERSION="$4"
UPDATE="$5"
texhash=usr/bin/texhash
fmtutil=usr/bin/fmtutil-sys
optional_engines="luahbtex,luajithbtex,luajittex,luatex,xetex"
case "$ACTION" in
targets)
echo "post-install post-remove"
;;
run)
if [ -x ${texhash} ]; then
echo "Updating texmf-dist hashes..."
${texhash} 2>&1 >/dev/null || true # silence strange errors
fi
if [ -x ${fmtutil} ]; then
echo "Updating texmf-dist formats..."
${fmtutil} --no-error-if-no-engine="${optional_engines}" \
--quiet --all >/dev/null || true
fi
;;
*)
exit 1
;;
esac
exit 0