summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorjoerg <joerg>2009-06-09 08:40:27 +0000
committerjoerg <joerg>2009-06-09 08:40:27 +0000
commit169c728d44c995d61736fb4405d7ff0f3a788338 (patch)
treea97e9ab4b2cc82fd7e37b1b33aef2abe2071284c /mk/install
parentdb4b5579830b35e567ba2176e6d073b57617f811 (diff)
downloadpkgsrc-169c728d44c995d61736fb4405d7ff0f3a788338.tar.gz
Add support for using USE_DESTDIR=yes and replace together.
Based on the patch send to tech-pkg in 2008, but less intrusive.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/replace.mk15
1 files changed, 13 insertions, 2 deletions
diff --git a/mk/install/replace.mk b/mk/install/replace.mk
index a4f6c8db3a7..75cd16e44b0 100644
--- a/mk/install/replace.mk
+++ b/mk/install/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.10 2007/03/09 03:28:58 rillig Exp $
+# $NetBSD: replace.mk,v 1.11 2009/06/09 08:40:28 joerg Exp $
#
# Public targets:
#
@@ -14,12 +14,19 @@
# Private targets that must be defined by the package system flavor:
#
# _flavor-replace:
-# Updates a package in-place on the system.
+# Updates a package in-place on the system (USE_DESTDIR=no).
+#
+# _flavor-destdir-replace:
+# Updates a package in-place on the system (USE_DESTDIR=yes).
#
# _flavor-undo-replace:
# Undoes a previous "make _flavor-replace".
+.if ${_USE_DESTDIR} == "no"
_REPLACE_TARGETS+= ${_PKGSRC_BUILD_TARGETS}
+.else
+_REPLACE_TARGETS+= package
+.endif
_REPLACE_TARGETS+= replace-message
_REPLACE_TARGETS+= unprivileged-install-hook
@@ -38,7 +45,11 @@ replace-message: .PHONY
@${PHASE_MSG} "Replacing for ${PKGNAME}"
@${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR."
+.if ${_USE_DESTDIR} == "no"
su-replace: .PHONY _flavor-replace
+.else
+su-replace: .PHONY _flavor-destdir-replace
+.endif
MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes
#