pkgsrc/misc/rpm/DEINSTALL
jlam 8e60140f36 * Use bsd.pkg.install.mk instead of homegrown INSTALL/DEINSTALL script
creation.

* Enhance INSTALL/DEINSTALL scripts so that they may remove the RPM
  databases on deinstallation if RPM was never used.

* Allow new knob RPM_DB_PREFIX that defaults to "/var/pkg" that is the
  prefix for the path to the RPM databases.  The databases are kept in
  ${RPM_DB_PREFIX}/lib/rpm.
2002-10-20 23:09:27 +00:00

44 lines
895 B
Text

# DEINSTALL_TMPL replacement
#
# $NetBSD: DEINSTALL,v 1.2 2002/10/20 23:09:27 jlam Exp $
RPMDIR="@RPMDIR@"
case ${STAGE} in
DEINSTALL)
;;
POST-DEINSTALL)
for db in ${RPMDIR}/*.rpm; do
if [ ${RPMDIR}/.pre-timestamp -ot $db ] && \
[ ${RPMDIR}/.post-timestamp -nt $db ]; then
${RM} -f $db
fi
done
${RM} -f ${RPMDIR}/.pre-timestamp
${RM} -f ${RPMDIR}/.post-timestamp
${RMDIR} -p ${RPMDIR} 2>/dev/null || ${TRUE}
if [ -d ${RPMDIR} ]; then
${CAT} << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove:
${RPMDIR}
where the RPM database is stored.
Caution: you will lose any data ${PKGNAME} has about any installed
packages!
===========================================================================
EOF
fi
;;
*)
${ECHO} "Unexpected argument: ${STAGE}"
exit 1
;;
esac