Subject: Re: Marking files for update
To: Martin Husemann <>
From: Alistair Crooks <>
List: tech-pkg
Date: 05/29/2001 08:59:07
On Sun, May 27, 2001 at 10:20:54AM +0200, Martin Husemann wrote:
> Hi!
> I wonder if it would be easy to implement & sensible to add a variant of
> the "show-downlevel" target that marks all pkgs it displays as "need to be
> updated" by creating a tag file in there?
> Then, whenever an "update" target checks dependencies for the installed 
> version of this pkg, it would make the version comparision fail and descend
> into the marked pkg.
> This would be very useable to create a minimal-rebuild-update-all script,
> which then could be similar to this pseudo code:
> while true;
> do
>   PKG=`make mark-show-downlevel | fgrep -v '===>' | awk '{ print $1}' | sed 1q`
>   if [ x$PKG = x ]; then exit 0
>   cd into $PKG's dir
>   make update
> done
> At the moment this would result in multiple builds if somewhere in the 
> dependency graph an installed pkg is found that is not up to date but enough
> to match the required dependency. The make update in question would proceed
> without updating that pkg and later the pkg will be seleceted in another
> iteration and be updated - by rebuilding all the things just rebuild again.
> An alternative would be an environment variable that makes any version check
> look into the -current version in the refered pkg and only succeed if installed
> version == -current version; which actually may be even simpler to implement.
> Martin

A couple of points:

"make show-downlevel" is a misnomer, really, quite useful but dumb,
about the best that we could do at the time - it merely flags the
packages where the installed version number is different to the one in
the package's Makefile.  Note that packages which have a "-current" or
"-devel" package in addition to the standard package need to be
handled specially.  It also only works with standard package
numbering, which is not used universally in pkgsrc.  I have something
that does this properly, but I have not had the time to deploy it
properly yet.  Once I do, then I think your suggestion would be a very
useful addition, thanks.

And from the nit department:

s/awk { print $1}' | sed 1q/awk '{ print $1; exit }'/