pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Allow overrides of the public targets, e.g. "instal...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9f87eb84d8ed
branches:  trunk
changeset: 513895:9f87eb84d8ed
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jun 05 17:41:11 2006 +0000

description:
Allow overrides of the public targets, e.g. "install", "package", etc.
if PKG_SKIP_REASON or PKG_FAIL_REASON is defined.  This commit adds
!target(...) guards around those target definitions to avoid "duplicate
target definition" warnings.

diffstat:

 mk/depends/bsd.depends.mk |   4 +++-
 mk/depends/depends.mk     |   4 +++-
 mk/install/bsd.install.mk |   4 +++-
 mk/install/deinstall.mk   |   6 +++++-
 mk/install/install.mk     |   4 +++-
 mk/install/replace.mk     |   6 +++++-
 mk/package/bsd.package.mk |  10 +++++++---
 mk/package/package.mk     |   4 +++-
 8 files changed, 32 insertions(+), 10 deletions(-)

diffs (189 lines):

diff -r 996fd4d75921 -r 9f87eb84d8ed mk/depends/bsd.depends.mk
--- a/mk/depends/bsd.depends.mk Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/depends/bsd.depends.mk Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $
+# $NetBSD: bsd.depends.mk,v 1.3 2006/06/05 17:41:11 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to dependencies.
@@ -37,7 +37,9 @@
 ###
 .PHONY: depends
 .if defined(NO_DEPENDS)
+.  if !target(depends)
 depends: depends-cookie
+.  endif
 .else
 .  include "${PKGSRCDIR}/mk/depends/depends.mk"
 .endif
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/depends/depends.mk
--- a/mk/depends/depends.mk     Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/depends/depends.mk     Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.3 2006/06/05 14:11:39 jlam Exp $
+# $NetBSD: depends.mk,v 1.4 2006/06/05 17:41:11 jlam Exp $
 
 ######################################################################
 ### depends (PUBLIC)
@@ -11,7 +11,9 @@
 _DEPENDS_TARGETS+=     release-depends-lock
 
 .PHONY: depends
+.if !target(depends)
 depends: ${_DEPENDS_TARGETS}
+.endif
 
 .PHONY: acquire-depends-lock release-depends-lock
 acquire-depends-lock: acquire-lock
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/install/bsd.install.mk
--- a/mk/install/bsd.install.mk Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/install/bsd.install.mk Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.install.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: bsd.install.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to installing packages.
@@ -21,7 +21,9 @@
 ###
 .if defined(NO_INSTALL)
 .PHONY: install
+.  if !target(install)
 install: ${_PKGSRC_BUILD_TARGETS} install-cookie
+.  endif
 .else
 .  include "${PKGSRCDIR}/mk/install/install.mk"
 .endif
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/install/deinstall.mk
--- a/mk/install/deinstall.mk   Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/install/deinstall.mk   Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: deinstall.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
 
 # DEINSTALLDEPENDS controls whether dependencies and dependents are also
 # removed when a package is de-installed.  The valid values are:
@@ -16,8 +16,10 @@
 ### It will acquire elevated privileges just-in-time.
 ###
 .PHONY: deinstall su-deinstall
+.if !target(deinstall)
 deinstall: su-target
        @${ECHO_MSG} "${_PKGSRC_IN}> Deinstalling for ${PKGNAME}"
+.endif
 
 su-deinstall: deinstall-pkg install-clean
 
@@ -30,7 +32,9 @@
 ### It will acquire elevated privileges just-in-time.
 ###
 .PHONY: reinstall
+.if !target(reinstall)
 reinstall: install-clean install
+.endif
 
 ######################################################################
 ### deinstall-pkg (PRIVATE, override)
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/install/install.mk
--- a/mk/install/install.mk     Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/install/install.mk     Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: install.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
 
 ######################################################################
 ### install (PUBLIC)
@@ -12,7 +12,9 @@
 _INSTALL_TARGETS+=     release-install-lock
 
 .PHONY: install
+.if !target(install)
 install: ${_INSTALL_TARGETS}
+.endif
 
 .PHONY: acquire-install-lock release-install-lock
 acquire-install-lock: acquire-lock
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/install/replace.mk
--- a/mk/install/replace.mk     Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/install/replace.mk     Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $
+# $NetBSD: replace.mk,v 1.3 2006/06/05 17:41:11 jlam Exp $
 
 ######################################################################
 ### replace (PUBLIC)
@@ -11,7 +11,9 @@
 _REPLACE_TARGETS+=     unprivileged-install-hook
 
 .PHONY: replace su-replace
+.if !target(replace)
 replace: ${_REPLACE_TARGETS} su-target
+.endif
 
 replace-message:
        @${ECHO_MSG} "${_PKGSRC_IN}> Replacing for ${PKGNAME}"
@@ -27,7 +29,9 @@
 ### "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:
        @${ECHO_MSG} "${_PKGSRC_IN}> Undoing replacement for ${PKGNAME}"
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/package/bsd.package.mk
--- a/mk/package/bsd.package.mk Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/package/bsd.package.mk Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.package.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: bsd.package.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to binary packages.
@@ -17,11 +17,13 @@
 ###
 .if defined(NO_PACKAGE)
 .PHONY: package
+.  if !target(package)
 package: install
-.  if defined(SKIP_SILENT)
+.    if defined(SKIP_SILENT)
        @${DO_NADA}
-.  else
+.    else
        @${ECHO_MSG} "${_PKGSRC_IN}> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}"."
+.    endif
 .  endif
 .else
 .  include "${PKGSRCDIR}/mk/package/package.mk"
@@ -33,7 +35,9 @@
 ### repackage is a special target to re-run the package target.
 ###
 .PHONY: repackage
+.if !target(repackage)
 repackage: package-clean package
+.endif
 
 ######################################################################
 ### package-clean (PRIVATE)
diff -r 996fd4d75921 -r 9f87eb84d8ed mk/package/package.mk
--- a/mk/package/package.mk     Mon Jun 05 17:29:25 2006 +0000
+++ b/mk/package/package.mk     Mon Jun 05 17:41:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: package.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
 
 _PACKAGE_COOKIE=       ${WRKDIR}/.package_done
 
@@ -14,7 +14,9 @@
 _PACKAGE_TARGETS+=     release-package-lock
 
 .PHONY: package
+.if !target(package)
 package: ${_PACKAGE_TARGETS}
+.endif
 
 .PHONY: acquire-package-lock release-package-lock
 acquire-package-lock: acquire-lock



Home | Main Index | Thread Index | Old Index