#!/bin/bash

package=sgmltexi
pkgdatadir=/usr/share/sgml/$package
pkgdocdir=/usr/share/doc/$package

centralized_catalog=/etc/sgml/$package.cat
ordinary_catalog=$pkgdatadir/$package.cat

ordinary_catalog_2003=$pkgdocdir/$package.cat.debian-2003-00-00

# Purge old centralized catalog (which was
# the same as the ordinary catalog), but
# only if it is no different than the
# current ordinary catalog.
# This prevents user changes from being lost.
# POSIX diff(1) supports only -b.
# http://www.opengroup.org/onlinepubs/007904975/utilities/diff.html

if test -f $centralized_catalog ; then
    if diff -b $centralized_catalog $ordinary_catalog_2003 >/dev/null ; then
	rm -f $centralized_catalog
    fi
fi

# sgml catalog update.
update-catalog --add $centralized_catalog $ordinary_catalog
update-catalog --add --super $centralized_catalog


#DEBHELPER#

