Subject: audit-packages -p pkg
To: None <pkgsrc-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: pkgsrc-users
Date: 11/05/2006 16:00:14
--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

when using audit-packages' -p option the specified package name has
to include the full version number, e.g. `php-4.4.4nb3' instead of
just `php':

$ audit-packages
Package php-4.4.4nb3 has a [...]
[...]
$ audit-packages -p php
$ 

Is this intended behaviour? In case it's not: the attached patch fixes
the problem. Comments are welcome.


Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: security/audit-packages/files/audit-packages
===================================================================
RCS file: /cvsroot/pkgsrc/security/audit-packages/files/audit-packages,v
retrieving revision 1.28
diff -u -p -r1.28 audit-packages
--- security/audit-packages/files/audit-packages	5 Oct 2006 14:26:42 -0000	1.28
+++ security/audit-packages/files/audit-packages	5 Nov 2006 14:30:06 -0000
@@ -197,8 +197,9 @@ while read pat type url; do
 		vulnpkgs=`@PKG_TOOLS_BIN@/pkg_info -e "$pat"`
 	else
 		vulnpkgs=
-		if `@PKG_TOOLS_BIN@/pkg_admin pmatch "$pat" "$one_package"` ; then
-			vulnpkgs=$one_package
+		one_pkg=`@PKG_TOOLS_BIN@/pkg_info -e "$one_package"`
+		if `@PKG_TOOLS_BIN@/pkg_admin pmatch "$pat" "$one_pkg"` ; then
+			vulnpkgs=$one_pkg
 		fi
 	fi
 	for pkg in $vulnpkgs ; do

--PNTmBPCT7hxwcZjr--