From 2b07b0f740bc8588c2d3ebe912222c93a9fe5798 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 10 Sep 2001 20:03:17 +0000 Subject: 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. --- mk/bsd.pkg.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mk/bsd.pkg.mk') diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 0157bad0677..f193ae9a5ae 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -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 \ -- cgit v1.2.3