#!/bin/sh
# update-vfontcap
# Copyright (c) 2001 Masato Taruishi <taru@debian.org>
# License: GPL

VFONTFILES=`/bin/ls -1 /etc/vfont/* | egrep -v '(.dpkg-[a-z]*|~)$'`
DEFOMACAP=/var/lib/defoma/vflib2.d/vfontcap
VFONTCAPDIR=/etc

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

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

(echo "### This file is automatically generated by update-vfontcap"; \
echo "#"; \
echo "# Please do not edit this file directly. If you want to change or add"; \
echo "# anything please take a look at the files in /etc/vfont, and invoke"; \
echo "# update-vfontcap.";  \
echo "#"; \
echo "###" ) > ${VFONTCAPDIR}/vfontcap.new

cat ${VFONTFILES} ${DEFOMACAP} >> ${VFONTCAPDIR}/vfontcap.new
mv ${VFONTCAPDIR}/vfontcap.new ${VFONTCAPDIR}/vfontcap

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