summaryrefslogtreecommitdiff
path: root/mk/pkginstall/deinstall
blob: ad5fc5cfe4fbabf170479f153958506480f18d4a (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
# $NetBSD: deinstall,v 1.5 2017/06/14 16:23:09 prlw1 Exp $

case ${STAGE} in
DEINSTALL)
  #
  # Unregister package from ocaml-findlib.
  #
  ${TEST} ! -x ./+OCAML_FINDLIB_REGISTER ||
    ./+OCAML_FINDLIB_REGISTER REMOVE ${OCAML_FINDLIB_DIR}

	#
	# Unregister info files.
	#
	${TEST} ! -x ./+INFO_FILES ||
		./+INFO_FILES REMOVE ${PKG_METADATA_DIR}
	#
	# Remove any icon theme caches.
	#
	${TEST} ! -x ./+ICON_THEMES ||
		./+ICON_THEMES REMOVE ${PKG_METADATA_DIR}
	#
	# Remove shells from /etc/shells.
	#
	${TEST} ! -x ./+SHELL ||
		./+SHELL REMOVE ${PKG_METADATA_DIR}
	${TEST} ! -x ./+SHELL ||
		./+SHELL CHECK-REMOVE ${PKG_METADATA_DIR}

	# Remove configuration files if they don't differ from the default
	# config file.
	#
	${TEST} ! -x ./+FILES ||
		./+FILES REMOVE ${PKG_METADATA_DIR}
	;;

POST-DEINSTALL)
	#
	# Update any fonts databases.
	#
	${TEST} ! -x ./+FONTS ||
		./+FONTS ${PKG_METADATA_DIR}
	#
	# Update any icon theme caches.
	#
	${TEST} ! -x ./+ICON_THEMES ||
		./+ICON_THEMES UPDATE ${PKG_METADATA_DIR}
	#
	# Rebuild the system run-time library search path database.
	#
	${TEST} ! -x ./+SHLIBS ||
		./+SHLIBS REMOVE ${PKG_METADATA_DIR}
	#
	# Remove empty directories and unused users/groups.
	#
	${TEST} ! -x ./+DIRS ||
		./+DIRS REMOVE ${PKG_METADATA_DIR}
	${TEST} ! -x ./+USERGROUP ||
		./+USERGROUP REMOVE ${PKG_METADATA_DIR}
	#
	# 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 ./+DIRS ||
		./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
	;;
esac