Add support for two environment variables to help update all your

installed packages and only rebuild everything once:

 STOP_DOWNLEVEL_AFTER_FIRST
    if set makes "make show-downlevel" stop a bit earlier (since with the
    other one below you will be only interested in the first downlevel
    pkg found).

 REBUILD_DOWNLEVEL_DEPENDS
    if set forces the pattern match for dependencies to fail whenever the
    installed pkg is not the version in the makefile (i.e. "make show-downlevel"    would print a version mismatch for the dependecy). This causes all
    downlevel dependencies (and everything depending on them) to be rebuild.

Enhancements, like making this all work with make command line flags and
settings in /etc/mk.conf are welcome. A way to stop "make show-downlevel"
through all upper levels of recursion imediately would be very usefull too.
This commit is contained in:
martin 2001-09-10 20:03:17 +00:00
parent bc129b2d03
commit 478cff1cb0

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.807 2001/09/10 09:56:05 agc Exp $
# $NetBSD: bsd.pkg.mk,v 1.808 2001/09/10 20:03:17 martin Exp $
#
# This file is in the public domain.
#
@ -1322,6 +1322,10 @@ show-downlevel:
found="`${PKG_INFO} -e \"${PKGBASE}\" || ${TRUE}`"; \
if [ "X$$found" != "X" -a "X$$found" != "X${PKGNAME}" ]; then \
${ECHO} "${PKGBASE} package: $$found installed, pkgsrc version ${PKGNAME}"; \
if [ "X$$STOP_DOWNLEVEL_AFTER_FIRST" != "X" ]; then \
${ECHO} "stoping after first downlevel pkg found"; \
exit 1; \
fi; \
fi
. endif
.endif
@ -2727,6 +2731,13 @@ install-depends: uptodate-pkgtools
pkg="${dep:C/:.*//}"; \
dir="${dep:C/[^:]*://:C/:.*$//}"; \
found=`${PKG_INFO} -e "$$pkg" || ${TRUE}`; \
if [ "X$$REBUILD_DOWNLEVEL_DEPENDS" != "X" ]; then \
pkgname=`cd $$dir ; ${MAKE} ${MAKEFLAGS} show-var VARNAME=PKGNAME`; \
if [ "X$$found" != "X" -a "X$$found" != "X$${pkgname}" ]; then \
${ECHO_MSG} "ignoring old installed package \"$$found\""; \
found=""; \
fi; \
fi; \
if [ "$$found" != "" ]; then \
instobjfmt=`${PKG_INFO} -B "$$pkg" | ${AWK} '/^OBJECT_FMT/ {print $$2}' | ${HEAD} -1`; \
if [ "$$instobjfmt" = "" ]; then \