#!/bin/sh
# update-fmtutil
# License: GPL

TXMF=/etc/texmf
if [ -f $TXMF/fmt.d/00tetex.cnf ] ; then
CNFFILES=`/bin/ls -1 $TXMF/fmt.d/*.cnf`
else
echo "Something seems wrong."
exit 1
fi
CNFDIR=$TXMF

if [ "x$1" = "x-v" ]; then
  VERBOSE=true
fi

if [ "$VERBOSE" = "true" ]; then
  if [ -f "$CNFDIR/fmtutil.cnf" ]; then
    echo -n "Regenerating $CNFDIR/fmtutil.cnf ... " >&2
  else
    echo -n "Generating $CNFDIR/fmtutil.cnf ... " >&2
  fi
fi

cat ${CNFFILES} > ${CNFDIR}/fmtutil.cnf_$$
mv ${CNFDIR}/fmtutil.cnf_$$ ${CNFDIR}/fmtutil.cnf

if [ "$VERBOSE" = "true" ]; then
  echo "done"
fi
