Subject: Re: More Update All
To: None <fb@enteract.com>
From: Alistair G. Crooks <agc@ftp.netbsd.org>
List: tech-pkg
Date: 03/27/2000 06:58:26
> On Sat, 25 Mar 2000, John Refling wrote:
> 
> > Why can't a few new targets be added to mk.bsd.pkg called
> > something like "make tag_for_update" which will simply
> > store the current package's directory (eg, print/tex) into
> > a data base.  You would run this from any package which you
> > want updated in the future.  You wouldn't want this flag
> > recursively carried into the build of dependent packages,
> > since dependancies for a package may change in the future.
> 
> The information's already in the database. Here's a way to get a list
> of directories for all installed packages...
> 
> pkg_info -a | cut -f "1" -d " " | xargs pkg_info -b | grep Makefile |
> cut -f "-2" -d "/" | sort

At the risk of cutting out a few extra execs etc, the following
will do the same job:

pkg_info -a -b | awk '/^Information/ { pkg = $3 } /Makefile/ { gsub("/Makefile.*", "", $0); printf("%s %s\n", pkg, $0); }' | sort

No doubt perl can do it in 60 chars of modem noise, but Perl isn't
guaranteed to be available everywhere.

Regards,
Alistair