Subject: Re: Bulk-Updating
To: None <tech-pkg@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: tech-pkg
Date: 09/08/2001 18:07:31
I had ~0 reaction to this last time I posted, so I suppose no one objects ;-)
Short summary: the below patch adds support for two environment variables:
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). Good ideas to make it stop ASAP are welcome ;-)
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.
The idea is to have a way to update all your installed packages and only
rebuild everything once.
Is it OK to commit this? (Since I'm not working on pkgsrc, I feel a bit
uncomfortable about me commiting this without review.)
Martin
Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.804
diff -c -u -r1.804 bsd.pkg.mk
--- bsd.pkg.mk 2001/08/27 15:05:54 1.804
+++ bsd.pkg.mk 2001/09/08 15:48:39
@@ -1320,6 +1320,10 @@
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
@@ -2725,6 +2729,13 @@
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 \