summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-02-20 11:17:03 +0000
committerrillig <rillig@pkgsrc.org>2007-02-20 11:17:03 +0000
commita856ec03a1ef4bedc6c18e570e8d9d89526960e9 (patch)
treecf8b4f615738be684c7482b2339d4b0bb4d15f74 /mk/install
parent70e7958fdadfc293e46fef4bcefe8d95df80ffad (diff)
downloadpkgsrc-a856ec03a1ef4bedc6c18e570e8d9d89526960e9.tar.gz
Cleaned up the code:
- Targets that are not intended to be defined here (replace-pkg and undo-replace-pkg) are not defined here. (Sounds obvious, but apparently isn't.) - Targets that are intended to be defined here and only here (replace and undo-replace) do not need a multiple-definition protection. - Moved all comments to the top of the file.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/replace.mk71
1 files changed, 30 insertions, 41 deletions
diff --git a/mk/install/replace.mk b/mk/install/replace.mk
index 4053a70fac3..10fb3773d56 100644
--- a/mk/install/replace.mk
+++ b/mk/install/replace.mk
@@ -1,22 +1,37 @@
-# $NetBSD: replace.mk,v 1.7 2006/07/22 16:31:35 jlam Exp $
+# $NetBSD: replace.mk,v 1.8 2007/02/20 11:17:03 rillig Exp $
+#
+# Public targets:
+#
+# replace:
+# Updates a package in-place on the system.
+# It will acquire elevated privileges just-in-time.
+#
+# undo-replace:
+# Undoes the effects of a previous "make replace".
+# It will acquire elevated privileges just-in-time.
+#
+#
+# Private targets that must be defined by the package system flavor:
+#
+# replace-pkg:
+# Updates a package in-place on the system.
+#
+# undo-replace-pkg:
+# Undoes a previous "make replace-pkg".
-######################################################################
-### 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
+#
+# replace
+#
+
.PHONY: replace su-replace
-.if !target(replace)
-. if defined(_PKGSRC_BARRIER)
+.if defined(_PKGSRC_BARRIER)
replace: ${_REPLACE_TARGETS} su-target
-. else
+.else
replace: barrier
-. endif
.endif
replace-message:
@@ -26,16 +41,12 @@ replace-message:
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.
-###
+#
+# undo-replace
+#
+
.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}"
@@ -43,25 +54,3 @@ undo-replace-message:
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