pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Renamed some more flavor-specific targets to have t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/46f831081fa3
branches:  trunk
changeset: 526397:46f831081fa3
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Mar 09 00:39:54 2007 +0000

description:
Renamed some more flavor-specific targets to have the form _flavor-*.

Split check-vulnerable into a general an a flavor-specific part, for
consistence with all the other targets.

diffstat:

 mk/check/check-vulnerable.mk |  29 +++++++++++++++-----------
 mk/depends/bsd.depends.mk    |   5 +++-
 mk/depends/depends.mk        |  19 ++--------------
 mk/flavor/README             |   8 +++---
 mk/flavor/pkg/check.mk       |  28 ++++++++++---------------
 mk/flavor/pkg/deinstall.mk   |  15 +++++++------
 mk/flavor/pkg/depends.mk     |  13 ++++-------
 mk/flavor/pkg/install.mk     |  45 ++++++++++++++++++-----------------------
 mk/flavor/pkg/metadata.mk    |   4 +-
 mk/install/deinstall.mk      |  15 +------------
 mk/install/install.mk        |  47 ++++---------------------------------------
 11 files changed, 81 insertions(+), 147 deletions(-)

diffs (truncated from 427 to 300 lines):

diff -r 1acff51114f5 -r 46f831081fa3 mk/check/check-vulnerable.mk
--- a/mk/check/check-vulnerable.mk      Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/check/check-vulnerable.mk      Fri Mar 09 00:39:54 2007 +0000
@@ -1,17 +1,22 @@
-# $NetBSD: check-vulnerable.mk,v 1.3 2006/07/05 09:08:35 jlam Exp $
+# $NetBSD: check-vulnerable.mk,v 1.4 2007/03/09 00:39:54 rillig Exp $
+#
+# Public targets:
+#
+# check-vulnerable:
+#      Checks for vulnerabilities in the package.
+#
 
-###########################################################################
-### check-vulnerable (PRIVATE, override)
-###########################################################################
-### check-vulnerable checks for vulnerabilities in the package.  This
-### should be overridden per package system flavor.
-#
-.PHONY: check-vulnerable
-.if !target(check-vulnerable)
-check-vulnerable:
-.  if defined(ALLOW_VULNERABLE_PACKAGES)
+.if defined(ALLOW_VULNERABLE_PACKAGES)
+check-vulnerable: .PHONY
        @${DO_NADA}
 .  else
+check-vulnerable: .PHONY _flavor-check-vulnerable
+       @${DO_NADA}
+.endif
+
+# A package flavor does not need to implement this target, so provide a
+# default implementation.
+.if !target(_flavor-check-vulnerable)
+_flavor-check-vulnerable:
        @${PHASE_MSG} "Skipping vulnerability checks."
-.  endif
 .endif
diff -r 1acff51114f5 -r 46f831081fa3 mk/depends/bsd.depends.mk
--- a/mk/depends/bsd.depends.mk Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/depends/bsd.depends.mk Fri Mar 09 00:39:54 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.10 2007/03/02 05:58:34 wiz Exp $
+# $NetBSD: bsd.depends.mk,v 1.11 2007/03/09 00:39:54 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to dependencies.
@@ -77,6 +77,9 @@
 ### depends-cookie creates the depends "cookie" state file.  This should
 ### be overridden per package system flavor.
 ###
+### XXX: Why? The other cookies are also created by pkgsrc, not by the
+### flavor.
+###
 .PHONY: depends-cookie
 .if !target(depends-cookie)
 depends-cookie:
diff -r 1acff51114f5 -r 46f831081fa3 mk/depends/depends.mk
--- a/mk/depends/depends.mk     Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/depends/depends.mk     Fri Mar 09 00:39:54 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.11 2007/01/02 17:23:41 rillig Exp $
+# $NetBSD: depends.mk,v 1.12 2007/03/09 00:39:54 rillig Exp $
 
 ######################################################################
 ### depends (PUBLIC)
@@ -39,7 +39,7 @@
 ###
 _REAL_DEPENDS_TARGETS+=        depends-message
 _REAL_DEPENDS_TARGETS+=        pre-depends-hook
-_REAL_DEPENDS_TARGETS+=        depends-install
+_REAL_DEPENDS_TARGETS+=        _flavor-install-dependencies
 _REAL_DEPENDS_TARGETS+=        depends-cookie
 _REAL_DEPENDS_TARGETS+=        error-check
 
@@ -51,23 +51,10 @@
        @${PHASE_MSG} "Installing dependencies for ${PKGNAME}"
 
 ######################################################################
-### depends-install (PRIVATE, override)
-######################################################################
-### depends-install checks that all dependencies are installed, and will
-### install any missing dependencies.  This should be overridden per
-### package system flavor.
-###
-.if !target(depends-install)
-.PHONY: depends-install
-depends-install:
-       @${DO_NADA}
-.endif
-
-######################################################################
 ### pre-depends-hook (PRIVATE, override, hook)
 ######################################################################
 ### pre-depends-hook is a generic hook target that is run just before
-### dependencies are installed for depends-install.
+### dependencies are installed for _flavor-install-dependencies.
 ###
 .PHONY: pre-depends-hook
 pre-depends-hook:
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/README
--- a/mk/flavor/README  Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/README  Fri Mar 09 00:39:54 2007 +0000
@@ -45,12 +45,12 @@
 
 The following make targets must be implemented:
 
-* check-vulnerable
-* deinstall-pkg
+* _flavor-check-vulnerable
+* _flavor-deinstall
 * show-depends
-* depends-install
+* _flavor-install-dependencies
 * bootstrap-depends
-* register-pkg
+* _flavor-register
 * tarup (XXX: This doesn't sound like a target that should be defined
   here.)
 * tarup-pkg
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/pkg/check.mk
--- a/mk/flavor/pkg/check.mk    Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/pkg/check.mk    Fri Mar 09 00:39:54 2007 +0000
@@ -1,20 +1,15 @@
-# $NetBSD: check.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $
+# $NetBSD: check.mk,v 1.3 2007/03/09 00:39:54 rillig Exp $
+#
 
-######################################################################
-### check-vulnerable (PUBLIC, pkgsrc/mk/check/check.mk)
-######################################################################
-### check-vulnerable checks for any vulnerabilities in the package
-### without needing audit-packages to be installed.
-###
-### XXX This should really be invoking audit-packages directly.  Having
-### XXX a separately maintained piece of code that inspects the
-### XXX vulnerabilities database is poor.
-###
-.PHONY: check-vulnerable
-check-vulnerable:
-.if defined(ALLOW_VULNERABLE_PACKAGES)
-       @${DO_NADA}
-.else
+# _flavor-check-vulnerable:
+#      Checks for known vulnerabilities in the package without needing
+#      audit-packages to be installed.
+#
+#      XXX: This should really be invoking audit-packages directly.
+#      Having separately maintained piece of code that inspects the
+#      vulnerabilities database is poor.
+#
+_flavor-check-vulnerable: .PHONY
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        vulnfile=${PKGVULNDIR:Q}/pkg-vulnerabilities;                   \
        if ${TEST} ! -f "$$vulnfile"; then                              \
@@ -51,4 +46,3 @@
                ${ERROR_MSG} "Define ALLOW_VULNERABLE_PACKAGES if this package is absolutely essential"; \
                ${FALSE};                                               \
        fi
-.endif
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/pkg/deinstall.mk
--- a/mk/flavor/pkg/deinstall.mk        Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/pkg/deinstall.mk        Fri Mar 09 00:39:54 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $
+# $NetBSD: deinstall.mk,v 1.3 2007/03/09 00:39:55 rillig Exp $
 
 # Set the appropriate flags to pass to pkg_delete(1) based on the value
 # of DEINSTALLDEPENDS (see pkgsrc/mk/install/deinstall.mk).
@@ -23,12 +23,13 @@
 .  endif
 .endif
 
-######################################################################
-### deinstall-pkg (PRIVATE, pkgsrc/mk/install/deinstall.mk)
-######################################################################
-### deinstall-pkg removes the package from the system.
-###
-deinstall-pkg:
+# _flavor-deinstall:
+#      Removes a package from the system.
+#
+# See also:
+#      deinstall
+#
+_flavor-deinstall:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        found="`${PKG_INFO} -e \"${PKGNAME}\" || ${TRUE}`";             \
        case "$$found" in                                               \
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/pkg/depends.mk
--- a/mk/flavor/pkg/depends.mk  Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/pkg/depends.mk  Fri Mar 09 00:39:54 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.21 2007/03/08 15:38:47 rillig Exp $
+# $NetBSD: depends.mk,v 1.22 2007/03/09 00:39:55 rillig Exp $
 
 _DEPENDS_FILE=         ${WRKDIR}/.depends
 _REDUCE_DEPENDS_CMD=   ${SETENV} CAT=${CAT:Q}                          \
@@ -64,13 +64,10 @@
        done >> ${.TARGET}.tmp
        ${RUN} ${MV} ${.TARGET}.tmp ${.TARGET}
 
-######################################################################
-### depends-install (PRIVATE, pkgsrc/mk/depends/depends.mk)
-######################################################################
-### depends-install installs any missing dependencies.
-###
-.PHONY: depends-install
-depends-install: ${_DEPENDS_FILE}
+# _flavor-install-dependencies:
+#      Installs any missing dependencies.
+#
+_flavor-install-dependencies: .PHONY ${_DEPENDS_FILE}
        ${RUN}                                                          \
        while read type pattern dir rest; do                            \
                { [ "$$dir" ] && [ ! "$$rest" ]; }                      \
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/pkg/install.mk
--- a/mk/flavor/pkg/install.mk  Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/pkg/install.mk  Fri Mar 09 00:39:54 2007 +0000
@@ -1,13 +1,22 @@
-# $NetBSD: install.mk,v 1.8 2006/07/07 21:24:28 jlam Exp $
+# $NetBSD: install.mk,v 1.9 2007/03/09 00:39:55 rillig Exp $
+#
+# _flavor-check-conflicts:
+#      Checks for conflicts between the package and installed packages.
+#
+#      XXX: Needs WRKDIR.
+#
+# _flavor-check-installed:
+#      Checks if the package (or an older version of it) is already
+#      installed on the system.
+#
+#      XXX: Needs WRKDIR.
+#
+# _flavor-register:
+#      Populates the package database with the appropriate entries to
+#      register the package as being installed on the system.
+#
 
-######################################################################
-### install-check-conflicts (PRIVATE, pkgsrc/mk/install/install.mk)
-######################################################################
-### install-check-conflicts checks for conflicts between the package
-### and and installed packages.
-###
-.PHONY: install-check-conflicts
-install-check-conflicts: error-check
+_flavor-check-conflicts: .PHONY error-check
        ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${WRKDIR}/.CONFLICTS
 .for _conflict_ in ${CONFLICTS}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
@@ -26,14 +35,7 @@
        ${ECHO} "Please remove conflicts first with pkg_delete(1).";    \
        ${RM} -f ${WRKDIR}/.CONFLICTS
 
-######################################################################
-### install-check-installed (PRIVATE, pkgsrc/mk/install/install.mk)
-######################################################################
-### install-check-installed checks if the package (perhaps an older
-### version) is already installed on the system.
-###
-.PHONY: install-check-installed
-install-check-installed: error-check
+_flavor-check-installed: .PHONY error-check
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        found="`${_PKG_BEST_EXISTS} ${PKGWILDCARD:Q} || ${TRUE}`";      \
        ${TEST} -n "$$found" || exit 0;                                 \
@@ -47,20 +49,13 @@
        ${ECHO} "    - \"${MAKE} replace\" to replace only the package without"; \
        ${ECHO} "      re-linking dependencies, risking various problems."
 
-######################################################################
-### register-pkg (PRIVATE, pkgsrc/mk/install/install.mk)
-######################################################################
-### register-pkg populates the package database with the appropriate
-### entries to register the package as being installed on the system.
-###
 _REGISTER_DEPENDENCIES=                                                        \
        ${SETENV} PKG_DBDIR=${_PKG_DBDIR:Q}                             \
                AWK=${TOOLS_AWK:Q}                                      \
                PKG_ADMIN=${PKG_ADMIN_CMD:Q}                            \
        ${SH} ${PKGSRCDIR}/mk/flavor/pkg/register-dependencies
 
-.PHONY: register-pkg
-register-pkg: generate-metadata ${_COOKIE.depends}
+_flavor-register: .PHONY generate-metadata ${_COOKIE.depends}
        @${STEP_MSG} "Registering installation for ${PKGNAME}"
        ${_PKG_SILENT}${_PKG_DEBUG}${RM} -fr ${_PKG_DBDIR}/${PKGNAME}
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_PKG_DBDIR}/${PKGNAME}
diff -r 1acff51114f5 -r 46f831081fa3 mk/flavor/pkg/metadata.mk
--- a/mk/flavor/pkg/metadata.mk Thu Mar 08 23:58:20 2007 +0000
+++ b/mk/flavor/pkg/metadata.mk Fri Mar 09 00:39:54 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.14 2007/03/02 09:08:33 wiz Exp $
+# $NetBSD: metadata.mk,v 1.15 2007/03/09 00:39:55 rillig Exp $
 
 ######################################################################
 ### The targets below are all PRIVATE.
@@ -233,7 +233,7 @@
 # PKGSRC_MESSAGE_RECIPIENTS.



Home | Main Index | Thread Index | Old Index