diff options
-rw-r--r-- | mk/bsd.pkg.mk | 32 | ||||
-rw-r--r-- | mk/bsd.pkg.update.mk | 23 | ||||
-rw-r--r-- | mk/depends/bsd.depends.mk | 21 | ||||
-rw-r--r-- | mk/flavor/pkg/deinstall.mk | 4 | ||||
-rw-r--r-- | mk/install/replace.mk | 6 |
5 files changed, 45 insertions, 41 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 43b7b270191..059791718b5 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1836 2006/06/05 02:22:49 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1837 2006/06/05 17:21:54 jlam Exp $ # # This file is in the public domain. # @@ -761,36 +761,6 @@ BUILD_DEFS+= OSVERSION_SPECIFIC all: ${_PKGSRC_BUILD_TARGETS} .endif -.if !defined(DEPENDS_TARGET) -. if make(package) -DEPENDS_TARGET= package -. elif make(update) -. if defined(UPDATE_TARGET) && ${UPDATE_TARGET} == "replace" -DEPENDS_TARGET= ${UPDATE_TARGET} -. else -DEPENDS_TARGET= update -. endif -. elif make(bin-install) || make(real-su-bin-install) -DEPENDS_TARGET= bin-install -. else -DEPENDS_TARGET= reinstall -. endif -.endif - -.if !defined(UPDATE_TARGET) -. if ${DEPENDS_TARGET} == "update" -. if make(package) -UPDATE_TARGET= package -. else -UPDATE_TARGET= install -. endif -. else -UPDATE_TARGET= ${DEPENDS_TARGET} -. endif -.endif - -UPDATE_RUNNING?= NO - ################################################################ # The following are used to create easy dummy targets for # disabling some bit of default target behavior you don't want. diff --git a/mk/bsd.pkg.update.mk b/mk/bsd.pkg.update.mk index ef2247cf3b5..19e5f2ce4ec 100644 --- a/mk/bsd.pkg.update.mk +++ b/mk/bsd.pkg.update.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.update.mk,v 1.2 2006/06/04 08:25:53 jlam Exp $ +# $NetBSD: bsd.pkg.update.mk,v 1.3 2006/06/05 17:21:54 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and contains the targets # and variables for "make update". @@ -11,6 +11,21 @@ NOCLEAN?= NO # don't clean up after update REINSTALL?= NO # reinstall upon update +# UPDATE_TARGET is the target that is invoked when updating packages during +# a "make update". This variable is user-settable within /etc/mk.conf. +# +.if !defined(UPDATE_TARGET) +. if defined(DEPENDS_TARGET) && (${DEPENDS_TARGET} == "update") +. if make(package) +UPDATE_TARGET= package +. else +UPDATE_TARGET= install +. endif +. else +UPDATE_TARGET= ${DEPENDS_TARGET} +. endif +.endif + # The 'update' target can be used to update a package and all # currently installed packages that depend upon this package. @@ -28,7 +43,7 @@ update: "${_PKGSRC_IN}> Resuming update for ${PKGNAME}" . if ${REINSTALL} != "NO" && ${UPDATE_TARGET} != "replace" ${_PKG_SILENT}${_PKG_DEBUG} \ - ${MAKE} ${MAKEFLAGS} deinstall UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL + ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL . endif .else RESUMEUPDATE?= NO @@ -38,7 +53,7 @@ update: ${_PKG_SILENT}${_PKG_DEBUG}${MAKE} ${MAKEFLAGS} ${_DDIR} . if ${UPDATE_TARGET} != "replace" ${_PKG_SILENT}${_PKG_DEBUG}if ${PKG_INFO} -qe ${PKGBASE}; then \ - ${MAKE} ${MAKEFLAGS} deinstall UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \ + ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \ || (${RM} ${_DDIR} && ${FALSE}); \ fi . endif @@ -53,7 +68,7 @@ update: if [ "(" "${RESUMEUPDATE}" = "NO" -o \ "${REINSTALL}" != "NO" ")" -a \ "${UPDATE_TARGET}" != "replace" ] ; then \ - ${MAKE} ${MAKEFLAGS} deinstall UPDATE_RUNNING=YES; \ + ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES; \ fi && \ ${MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} \ DEPENDS_TARGET=${DEPENDS_TARGET:Q} ; \ diff --git a/mk/depends/bsd.depends.mk b/mk/depends/bsd.depends.mk index a660d161527..cb5c102bd35 100644 --- a/mk/depends/bsd.depends.mk +++ b/mk/depends/bsd.depends.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.depends.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $ +# $NetBSD: bsd.depends.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and provides all # variables and targets related to dependencies. @@ -10,6 +10,25 @@ _DEPENDS_COOKIE= ${WRKDIR}/.depends_done +# DEPENDS_TARGET is the target that is invoked to satisfy missing +# dependencies. This variable is user-settable in /etc/mk.conf. +# +.if !defined(DEPENDS_TARGET) +. if make(package) +DEPENDS_TARGET= package +. elif make(update) +. if defined(UPDATE_TARGET) && (${UPDATE_TARGET} == "replace") +DEPENDS_TARGET= ${UPDATE_TARGET} +. else +DEPENDS_TARGET= update +. endif +. elif make(bin-install) || make(real-su-bin-install) +DEPENDS_TARGET= bin-install +. else +DEPENDS_TARGET= reinstall +. endif +.endif + ###################################################################### ### depends (PUBLIC) ###################################################################### diff --git a/mk/flavor/pkg/deinstall.mk b/mk/flavor/pkg/deinstall.mk index f092c57a84f..08c9752361e 100644 --- a/mk/flavor/pkg/deinstall.mk +++ b/mk/flavor/pkg/deinstall.mk @@ -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:21:55 jlam Exp $ # Set the appropriate flags to pass to pkg_delete(1) based on the value # of DEINSTALLDEPENDS (see pkgsrc/mk/install/deinstall.mk). @@ -18,7 +18,7 @@ _PKG_ARGS_DEINSTALL+= -v .endif .if defined(PKG_PRESERVE) -. if !empty(UPDATE_RUNNING:M[yY][eE][sS]) +. if defined(_UPDATE_RUNNING) && !empty(_UPDATE_RUNNING:M[yY][eE][sS]) _PKG_ARGS_DEINSTALL+= -N -f # update w/o removing any files . endif .endif diff --git a/mk/install/replace.mk b/mk/install/replace.mk index 18623adf950..76aaa977258 100644 --- a/mk/install/replace.mk +++ b/mk/install/replace.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $ +# $NetBSD: replace.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $ ###################################################################### ### replace (PUBLIC) @@ -18,7 +18,7 @@ replace-message: @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR." su-replace: replace-pkg -MAKEFLAGS.su-replace= UPDATE_RUNNING=yes +MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes ###################################################################### ### undo-replace (PUBLIC) @@ -34,7 +34,7 @@ undo-replace-message: @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR." su-undo-replace: undo-replace-pkg -MAKEFLAGS.su-undo-replace= UPDATE_RUNNING=yes +MAKEFLAGS.su-undo-replace= _UPDATE_RUNNING=yes ###################################################################### ### replace-pkg (PRIVATE, override) |