#!/bin/sh -e
#
# update-texmf-config
# script used in maintainer script for updating the config files
# updmap.cfg, language.dat, fmtutil.cnf, and calling the respective
# triggers to allow tex-common trigger action to be run.
#
# Copyright (C) 2009 Norbert Preining
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA  02110-1301 USA.

DOLSR=off
DOLSRFULL=off
DOHYPHEN=off
DOUPDMAP=off

# for upgrading purpose we accept language as synonym for hyphen, and
# updmap for map
while [ $# -ne 0 ]; do
  case $1 in
    hyphen|language)
      DOHYPHEN=on
      shift;;
    map|updmap)
      DOUPDMAP=on
      shift;;
    lsr)
      DOLSR=on
      shift;;
    lsrfull)
      DOLSR=off
      DOLSRFULL=on
      shift;;
    *)
      echo "unknown option: $1"
      exit 1
      ;;
  esac
done

if [ $DOLSR = on ] ; then
  dpkg-trigger texmf-lsr
fi
if [ $DOLSRFULL = on ] ; then
  dpkg-trigger texmf-lsrfull
fi
if [ $DOHYPHEN = on ] ; then
  dpkg-trigger texmf-hyphen
fi
if [ $DOUPDMAP = on ] ; then
  dpkg-trigger texmf-map
fi

# vim:set expandtab tabstop=2: #
