#!/bin/sh
# postrm for sgml-data
set -e

case "$1" in
    upgrade)
	# we are the old version being replaced
	# do not bother removing from sgml.catalog, it is just going
	# to be added by the new versions postinst
	:
	;;
    abort-upgrade|abort-install)
	# we are the new version being installed, but
	# we are backing out from an upgrade, because preinst failed
	# however, the catalog is not added until postinst, so NOOP
	:
	;;
    failed-upgrade)
	# we are the new version being installed, but
	# we are backing out from an upgrade, because postrm upgrade
	# failed.  Not sure if this is right, but NOOP
	:
	;;
    remove)
	if ! install-sgmlcatalog --quiet --remove sgml-data
	then
	    echo "WARNING: install-sgmlcatalog failed"
	    echo "         There may be sgml-data SGML entities left over"
	    echo "         in /etc/sgml.catalog.  Continuing anyway. "
	fi
	;;
    purge)
	# nothing new needing to be done
    	;;
    *)
        echo "postrm called with unknown argument \`$1\'" >&2
	;;
esac

exit 0
