Pullup ticket #3236 - requested by taca
[pkgsrcv2.git] / misc / rpm / DEINSTALL
1 # $NetBSD: DEINSTALL,v 1.2 2002/10/20 23:09:27 jlam Exp $
2
3 RPMDIR="@RPMDIR@"
4
5 case ${STAGE} in
6 POST-DEINSTALL)
7         for db in ${RPMDIR}/*.rpm; do
8                 if [ ${RPMDIR}/.pre-timestamp -ot $db ] && \
9                    [ ${RPMDIR}/.post-timestamp -nt $db ]; then
10                         ${RM} -f $db
11                 fi
12         done
13         ${RM} -f ${RPMDIR}/.pre-timestamp
14         ${RM} -f ${RPMDIR}/.post-timestamp
15
16         ${RMDIR} -p ${RPMDIR} 2>/dev/null || ${TRUE}
17         if [ -d ${RPMDIR} ]; then
18                 ${CAT} << EOF
19 ===========================================================================
20
21 If you won't be using ${PKGNAME} any longer, you may want to remove:
22
23         ${RPMDIR}
24
25 where the RPM database is stored.
26
27 Caution: you will lose any data ${PKGNAME} has about any installed
28 packages!
29
30 ===========================================================================
31 EOF
32         fi
33         ;;
34 esac