blob: 1c9c4bd626dbea95d879201da40ea2661cb5e982 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# start of deinstall
#
# $NetBSD: deinstall,v 1.32 2005/02/02 10:33:01 jlam Exp $
case ${STAGE} in
VIEW-DEINSTALL)
case ${_PKG_CONFIG} in
YES)
case ${PKG_SYSCONFDEPOTBASE} in
"")
${TEST} -x ./+FILES &&
./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX}
;;
*)
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
${LINKFARM} -D -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
${RMDIR} -p ${PKG_SYSCONFVIEWBASE} 2>/dev/null || ${TRUE}
;;
esac
;;
esac
if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then
${ECHO} "===> Updating /etc/shells"
${CP} /etc/shells /etc/shells.pkgsrc."$$"
(${GREP} -v "^${PKG_SHELL}" /etc/shells.pkgsrc."$$" || ${TRUE}) > /etc/shells
${RM} /etc/shells.pkgsrc."$$"
fi
;;
DEINSTALL)
# Remove configuration files if they don't differ from the default
# config file.
#
case ${_PKG_CONFIG} in
YES) ${TEST} -x ./+FILES &&
./+FILES REMOVE ${PKG_METADATA_DIR} ;;
esac
case ${_PKG_CONFIG}${_PKG_RCD_SCRIPTS} in
YESYES) ${TEST} -x ./+RCD_SCRIPTS &&
./+RCD_SCRIPTS REMOVE ${PKG_METADATA_DIR} ;;
esac
;;
POST-DEINSTALL)
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \
"${_PKG_CONFIG}" = "YES" -a -n "${CONF_DEPENDS}" ]; then
if [ -h ${PKG_SYSCONFDIR} ]; then
${RM} -f ${PKG_SYSCONFDIR}
fi
${RMDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` 2>/dev/null || ${TRUE}
fi
#
# Remove empty directories and unused users/groups.
#
case ${_PKG_CONFIG} in
YES) ${TEST} -x ./+DIRS &&
./+DIRS REMOVE ${PKG_METADATA_DIR} ;;
esac
case ${_PKG_CREATE_USERGROUP} in
YES) ${TEST} -x ./+USERGROUP &&
./+USERGROUP REMOVE ${PKG_METADATA_DIR} ;;
esac
#
# Check for any existing bits after we're finished de-installing.
#
${TEST} -x ./+USERGROUP &&
./+USERGROUP CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} -x ./+FILES &&
./+FILES CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} -x ./+RCD_SCRIPTS &&
./+RCD_SCRIPTS CHECK-REMOVE ${PKG_METADATA_DIR}
${TEST} -x ./+DIRS &&
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
;;
esac
# end of deinstall
|