freebsd-ports/textproc/xmlcatmgr/pkg-deinstall
Jun Kuriyama 5caac467aa Add xmlcatmgr 0.2, SGML/XML catalog manager.
PR:		ports/53818
Submitted by:	Hiroki Sato <hrs@FreeBSD.org>
2003-06-30 13:32:18 +00:00

36 lines
911 B
Bash

#!/bin/sh
# $FreeBSD$
PATH=${PATH}:/bin:/usr/bin:${LOCALBASE}/bin:${X11BASE}/bin
export PATH
CATALOG_MASTER_SGML=${PKG_PREFIX}/share/sgml/catalog
CATALOG_MASTER_XML=${PKG_PREFIX}/share/xml/catalog
CATALOG_PORTS_SGML=${PKG_PREFIX}/share/sgml/catalog.ports
CATALOG_PORTS_XML=${PKG_PREFIX}/share/xml/catalog.ports
XMLCATMGR=${PKG_PREFIX}/bin/xmlcatmgr
case $2 in
DEINSTALL)
${XMLCATMGR} -sc ${CATALOG_MASTER_SGML} remove catalog.ports
if [ ! -s ${CATALOG_MASTER_SGML} ]; then
rm -f ${CATALOG_MASTER_SGML}
fi
if [ ! -s ${CATALOG_PORTS_SGML} ]; then
rm -f ${CATALOG_PORTS_SGML}
fi
T=`mktemp /tmp/_catalog_xml.XXXXXX`
${XMLCATMGR} -c ${CATALOG_MASTER_XML} remove ${CATALOG_PORTS_XML}
${XMLCATMGR} -c /dev/stdout create > ${T}
if cmp -s ${T} ${CATALOG_MASTER_XML} ]; then
rm -f ${CATALOG_MASTER_XML}
fi
if cmp -s ${T} ${CATALOG_PORTS_XML} ]; then
rm -f ${CATALOG_PORTS_XML}
fi
rm -f ${T}
;;
esac