Subject: Re: More Update All
To: Alistair G. Crooks <agc@ftp.netbsd.org>
From: David Brownlee <abs@netbsd.org>
List: tech-pkg
Date: 03/27/2000 18:24:39
On Mon, 27 Mar 2000, Alistair G. Crooks wrote:

> 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.
> 
	Its a touch more than 60, but it is a good approximation for line
	noise, it sorts, and it doesn't pick up bogus entries like:

postgresql-6.5.3: databases/postgresql/../../databases/postgresql/files
abiword-personal-0.7.8: editors/abiword/files/GNUMakefile.install:#
$NetBSD: GNU
Makefile.install,v 1.2 2000/02/29 18:31:30 jlam Exp $

	You can probably just tighten up the /Makefile/ regex :)

	pkg_info -a -b | perl -ne
'/^Information.*\s(\S+:)/&&($p=$1);m#^([^/]+/[^/]+)/Makefile#&& 
push(@l,"$p $1\n");END{print sort @l}'

		David/absolute