diff options
author | rillig <rillig> | 2007-03-09 00:39:54 +0000 |
---|---|---|
committer | rillig <rillig> | 2007-03-09 00:39:54 +0000 |
commit | 3b3503d7a1a4896e5289672056038aca0151797f (patch) | |
tree | 008807eeeda864fdd459d9968b98336e030621b9 | |
parent | aa2482e490d11b8ec0d308a8c903c4dd145678c6 (diff) | |
download | pkgsrc-3b3503d7a1a4896e5289672056038aca0151797f.tar.gz |
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.
-rw-r--r-- | mk/check/check-vulnerable.mk | 29 | ||||
-rw-r--r-- | mk/depends/bsd.depends.mk | 5 | ||||
-rw-r--r-- | mk/depends/depends.mk | 19 | ||||
-rw-r--r-- | mk/flavor/README | 8 | ||||
-rw-r--r-- | mk/flavor/pkg/check.mk | 28 | ||||
-rw-r--r-- | mk/flavor/pkg/deinstall.mk | 15 | ||||
-rw-r--r-- | mk/flavor/pkg/depends.mk | 13 | ||||
-rw-r--r-- | mk/flavor/pkg/install.mk | 45 | ||||
-rw-r--r-- | mk/flavor/pkg/metadata.mk | 4 | ||||
-rw-r--r-- | mk/install/deinstall.mk | 15 | ||||
-rw-r--r-- | mk/install/install.mk | 47 |
11 files changed, 81 insertions, 147 deletions
diff --git a/mk/check/check-vulnerable.mk b/mk/check/check-vulnerable.mk index 6bb3e096df5..4085cd6111c 100644 --- a/mk/check/check-vulnerable.mk +++ b/mk/check/check-vulnerable.mk @@ -1,17 +1,22 @@ -# $NetBSD: check-vulnerable.mk,v 1.3 2006/07/05 09:08:35 jlam Exp $ - -########################################################################### -### check-vulnerable (PRIVATE, override) -########################################################################### -### check-vulnerable checks for vulnerabilities in the package. This -### should be overridden per package system flavor. +# $NetBSD: check-vulnerable.mk,v 1.4 2007/03/09 00:39:54 rillig Exp $ +# +# Public targets: # -.PHONY: check-vulnerable -.if !target(check-vulnerable) -check-vulnerable: -. if defined(ALLOW_VULNERABLE_PACKAGES) +# check-vulnerable: +# Checks for vulnerabilities in the package. +# + +.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 --git a/mk/depends/bsd.depends.mk b/mk/depends/bsd.depends.mk index 0a0439556ff..96b00491013 100644 --- a/mk/depends/bsd.depends.mk +++ b/mk/depends/bsd.depends.mk @@ -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-clean: ### 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 --git a/mk/depends/depends.mk b/mk/depends/depends.mk index e17dec6204e..c0b29653c65 100644 --- a/mk/depends/depends.mk +++ b/mk/depends/depends.mk @@ -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 @@ ${_COOKIE.depends}: real-depends ### _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 @@ depends-message: @${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 --git a/mk/flavor/README b/mk/flavor/README index aca6fc0a9eb..36ca1b2a8e8 100644 --- a/mk/flavor/README +++ b/mk/flavor/README @@ -45,12 +45,12 @@ XXX: Why isn't this variable in the previous list? 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 --git a/mk/flavor/pkg/check.mk b/mk/flavor/pkg/check.mk index 8b4eddede20..f78515f44ff 100644 --- a/mk/flavor/pkg/check.mk +++ b/mk/flavor/pkg/check.mk @@ -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 @@ check-vulnerable: ${ERROR_MSG} "Define ALLOW_VULNERABLE_PACKAGES if this package is absolutely essential"; \ ${FALSE}; \ fi -.endif diff --git a/mk/flavor/pkg/deinstall.mk b/mk/flavor/pkg/deinstall.mk index 08c9752361e..07485b89fd8 100644 --- a/mk/flavor/pkg/deinstall.mk +++ b/mk/flavor/pkg/deinstall.mk @@ -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 @@ _PKG_ARGS_DEINSTALL+= -N -f # update w/o removing any files . 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 --git a/mk/flavor/pkg/depends.mk b/mk/flavor/pkg/depends.mk index 03e37a7f684..bcf9ca99c4b 100644 --- a/mk/flavor/pkg/depends.mk +++ b/mk/flavor/pkg/depends.mk @@ -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 @@ ${_DEPENDS_FILE}: 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 --git a/mk/flavor/pkg/install.mk b/mk/flavor/pkg/install.mk index 2ecd6273b87..3f2d9f6b76c 100644 --- a/mk/flavor/pkg/install.mk +++ b/mk/flavor/pkg/install.mk @@ -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 @@ install-check-conflicts: error-check ${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 @@ install-check-installed: error-check ${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 --git a/mk/flavor/pkg/metadata.mk b/mk/flavor/pkg/metadata.mk index 77f9368990d..fecdd62efc1 100644 --- a/mk/flavor/pkg/metadata.mk +++ b/mk/flavor/pkg/metadata.mk @@ -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 @@ ${_MESSAGE_FILE}: ${MESSAGE_SRC} # PKGSRC_MESSAGE_RECIPIENTS. # .PHONY: install-display-message -register-pkg: install-display-message +_flavor-register: install-display-message install-display-message: ${_MESSAGE_FILE} @${STEP_MSG} "Please note the following:" @${ECHO_MSG} "" diff --git a/mk/install/deinstall.mk b/mk/install/deinstall.mk index 40e67142409..a51b1daab6d 100644 --- a/mk/install/deinstall.mk +++ b/mk/install/deinstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: deinstall.mk,v 1.7 2006/11/03 08:04:06 joerg Exp $ +# $NetBSD: deinstall.mk,v 1.8 2007/03/09 00:39:55 rillig Exp $ # DEINSTALLDEPENDS controls whether dependencies and dependents are also # removed when a package is de-installed. The valid values are: @@ -22,7 +22,7 @@ deinstall: su-target .endif _SU_DEINSTALL_TARGETS= acquire-deinstall-lock -_SU_DEINSTALL_TARGETS+= deinstall-pkg +_SU_DEINSTALL_TARGETS+= _flavor-deinstall _SU_DEINSTALL_TARGETS+= release-deinstall-lock .if ${_USE_DESTDIR} == "no" _SU_DEINSTALL_TARGETS+= install-clean @@ -45,14 +45,3 @@ MAKEFLAGS.su-deinstall= DEINSTALLDEPENDS=${DEINSTALLDEPENDS} .if !target(reinstall) reinstall: install-clean install .endif - -###################################################################### -### deinstall-pkg (PRIVATE, override) -###################################################################### -### deinstall-pkg removes the package from the system. This should -### be overridden per package system flavor. -### -.if !target(deinstall-pkg) -deinstall-pkg: - @${DO_NADA} -.endif diff --git a/mk/install/install.mk b/mk/install/install.mk index cb85ba0fe02..c9e0ee4c65e 100644 --- a/mk/install/install.mk +++ b/mk/install/install.mk @@ -1,4 +1,4 @@ -# $NetBSD: install.mk,v 1.35 2007/03/02 09:08:33 wiz Exp $ +# $NetBSD: install.mk,v 1.36 2007/03/09 00:39:55 rillig Exp $ # # This file provides the code for the "install" phase. # @@ -138,8 +138,8 @@ release-install-localbase-lock: release-localbase-lock _INSTALL_ALL_TARGETS+= acquire-install-localbase-lock .endif .if ${_USE_DESTDIR} == "no" -_INSTALL_ALL_TARGETS+= install-check-conflicts -_INSTALL_ALL_TARGETS+= install-check-installed +_INSTALL_ALL_TARGETS+= _flavor-check-conflicts +_INSTALL_ALL_TARGETS+= _flavor-check-installed .endif _INSTALL_ALL_TARGETS+= install-check-umask .if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) @@ -165,7 +165,7 @@ _INSTALL_ALL_TARGETS+= check-files-post _INSTALL_ALL_TARGETS+= post-install-script .endif .if ${_USE_DESTDIR} == "no" -_INSTALL_ALL_TARGETS+= register-pkg +_INSTALL_ALL_TARGETS+= _flavor-register .endif _INSTALL_ALL_TARGETS+= privileged-install-hook .if ${_USE_DESTDIR} != "user-destdir" @@ -182,32 +182,6 @@ install-all: su-install-all su-install-all: ${_INSTALL_ALL_TARGETS} ###################################################################### -### install-check-conflicts (PRIVATE, override) -###################################################################### -### install-check-conflicts check for conflicts between the package and -### any installed packages. This should be overridden per package -### system flavor. -### -.PHONY: install-check-conflicts -.if !target(install-check-conflicts) -install-check-conflicts: - @${DO_NADA} -.endif - -###################################################################### -### install-check-installed (PRIVATE, override) -###################################################################### -### install-check-installed checks if the package (perhaps an older -### version) is already installed on the system. This should be -### overridden per package system flavor. -### -.PHONY: install-check-installed -.if !target(install-check-installed) -install-check-installed: - @${DO_NADA} -.endif - -###################################################################### ### install-check-umask (PRIVATE) ###################################################################### ### install-check-umask tests whether the umask is properly set and @@ -352,17 +326,6 @@ install-doc-handling: plist ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${PLIST} | ${GREP} -v "^@" | \ ${EGREP} ${_PLIST_REGEXP.man:Q} | ${_DOC_COMPRESS} -###################################################################### -### register-pkg (PRIVATE, override) -###################################################################### -### register-pkg registers the package as being installed on the system. -### -.PHONY: register-pkg -.if !target(register-pkg) -register-pkg: - @${DO_NADA} -.endif - privileged-install-hook: .PHONY @${DO_NADA} @@ -381,5 +344,5 @@ install-clean: package-clean check-clean ### bootstrap-register registers "bootstrap" packages that are installed ### by the pkgsrc/bootstrap/bootstrap script. ### -bootstrap-register: register-pkg clean +bootstrap-register: _flavor-register clean @${DO_NADA} |