summaryrefslogtreecommitdiff
path: root/www/geeklog/DEINSTALL
blob: 42e2acd5bb7d5f64cbc8ac4de21f83c81c9afa7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# $NetBSD: DEINSTALL,v 1.1.1.1 2006/06/15 13:26:42 taca Exp $

GEEKLOG_DIR="@GEEKLOG_DIR@"
GEEKLOG_EXAMPLESDIR="@GEEKLOG_EXAMPLESDIR@"
GEEKLOG_PUBDIR="@GEEKLOG_PUBDIR@"
GEEKLOG_TMPL_SUB="@GEEKLOG_TMPL_SUB@"
GEEKLOG_TMPL_DIR="@GEEKLOG_TMPL_DIR@"

case ${STAGE} in
DEINSTALL)
	cd ${GEEKLOG_TMPL_DIR}
	${FIND} ${GEEKLOG_TMPL_SUB} -type f -print | \
		while read f; do
			file="${GEEKLOG_PUBDIR}/$f"
			if ${TEST} -f ${file} -a -f ${f} && \
			    ${CMP} -s ${file} ${f}; then
				${RM} -f ${file}
			fi
		done
	cd ${GEEKLOG_PUBDIR}
	${FIND} -d ${GEEKLOG_TMPL_SUB} -type d -print |
		while read d; do
			${RMDIR} ${d} 2>/dev/null
		done
	# XXX: work around for remaining config.php
	conf="${GEEKLOG_DIR}/config.php"
	example="${GEEKLOG_EXAMPLESDIR}/config.php"
	if ${TEST} -f ${conf} -a -f ${example} && ${CMP} -s ${conf} ${example}; then
		${RM} ${conf}
	else
		${ECHO} "==========================================================================="
		${ECHO} "The following files are no longer being used by ${PKGNAME},"
		${ECHO} "and they can be removed if no other packages are using them:"
		${ECHO} ""
		${ECHO} "	${conf}"
		${ECHO} ""
		${ECHO} "==========================================================================="
	fi
	;;

POST-DEINSTALL)
	${RMDIR} -p ${GEEKLOG_DIR} 2>/dev/null
	if ${TEST} -d ${GEEKLOG_DIR}; then
		${ECHO} "==========================================================================="
		${ECHO} "The following directories are no longer being used by ${PKGNAME},"
		${ECHO} "and they can be removed if no other packages are using them:"
		${ECHO} ""
		${ECHO} "	${GEEKLOG_DIR}"
		${ECHO} ""
		${ECHO} "==========================================================================="
	fi
	;;

esac