diff options
author | martin <martin@pkgsrc.org> | 2001-09-10 20:03:17 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2001-09-10 20:03:17 +0000 |
commit | 478cff1cb00e335fa2b2dabc6bed58fe14d4cbbb (patch) | |
tree | a0045b79bc769977cc9d5cdb16daa27b385ecc17 /mk/bsd.pkg.mk | |
parent | bc129b2d0369a20c803882a9b4ca71879f462cb5 (diff) | |
download | pkgsrc-478cff1cb00e335fa2b2dabc6bed58fe14d4cbbb.tar.gz |
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.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 13 |
1 files changed, 12 insertions, 1 deletions
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 \ |