summaryrefslogtreecommitdiff
path: root/mk/install/replace.mk
blob: d2ed28f9f38b19918a9e53f89fb3201a437981d4 (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
# $NetBSD: replace.mk,v 1.6 2006/07/07 21:24:28 jlam Exp $

######################################################################
### replace (PUBLIC)
######################################################################
### replace is a public target to update a package in-place on the
### system.  It will acquire elevated privileges just-in-time.
###
_REPLACE_TARGETS+=	${_PKGSRC_BUILD_TARGETS}
_REPLACE_TARGETS+=	replace-message
_REPLACE_TARGETS+=	unprivileged-install-hook

.PHONY: replace su-replace
.if !target(replace)
.  if exists(${_COOKIE.barrier})
replace: ${_REPLACE_TARGETS} su-target
.  else
replace: barrier
.  endif
.endif

replace-message:
	@${PHASE_MSG} "Replacing for ${PKGNAME}"
        @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR."

su-replace: replace-pkg
MAKEFLAGS.su-replace=	_UPDATE_RUNNING=yes

######################################################################
### undo-replace (PUBLIC)
######################################################################
### undo-replace is a public target to undo the effects of the
### "replace" target.  It will acquire elevated privileges just-in-time.
###
.PHONY: undo-replace su-undo-replace
.if !target(undo-replace)
undo-replace: undo-replace-message su-target
.endif

undo-replace-message:
	@${PHASE_MSG} "Undoing replacement for ${PKGNAME}"
        @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR."

su-undo-replace: undo-replace-pkg
MAKEFLAGS.su-undo-replace=	_UPDATE_RUNNING=yes

######################################################################
### replace-pkg (PRIVATE, override)
######################################################################
### replace-pkg updates a package in-place on the system.  This should
### be overridden per package system flavor.
###
.if !target(replace-pkg)
replace-pkg:
	@${DO_NADA}
.endif

######################################################################
### undo-replace-pkg (PRIVATE, override)
######################################################################
### undo-replace-pkg undoes a "make replace".  This should be overridden
### per package system flavor.
###
.if !target(undo-replace-pkg)
undo-replace-pkg:
	@${DO_NADA}
.endif