5caac467aa
PR: ports/53818 Submitted by: Hiroki Sato <hrs@FreeBSD.org>
36 lines
911 B
Bash
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
|