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