4ea8c1
#!/bin/bash
4ea8c1
4ea8c1
# Regenerate the fmtutil.cnf file from the pieces which are currently present
4ea8c1
# in the fmtutil.cnf.d directory.
4ea8c1
4ea8c1
# Abort immediately if any command fails
4ea8c1
set -o errexit
4ea8c1
shopt -s nullglob
4ea8c1
4ea8c1
texdir=$1
4ea8c1
[[ -z $texdir ]] && texdir=/usr/share/texlive
4ea8c1
web2cdir=$texdir/texmf-dist/web2c
4ea8c1
4ea8c1
rm -f $web2cdir/fmtutil.cnf.rpmtmp
4ea8c1
4ea8c1
echo "# Generated by $0 on $(date)" > $web2cdir/fmtutil.cnf.rpmtmp
4ea8c1
4ea8c1
cat $web2cdir/fmtutil-hdr.cnf \
4ea8c1
    $texdir/fmtutil.cnf.d/* \
4ea8c1
    >> $web2cdir/fmtutil.cnf.rpmtmp
4ea8c1
4ea8c1
mv $web2cdir/fmtutil.cnf.rpmtmp $web2cdir/fmtutil.cnf