Subject: Re: pkg/33229
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Brandon Bergren <bdragon@mailsnare.net>
List: pkgsrc-bugs
Date: 04/12/2006 21:15:04
The following reply was made to PR pkg/33229; it has been noted by GNATS.

From: Brandon Bergren <bdragon@mailsnare.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/33229
Date: Wed, 12 Apr 2006 16:12:50 -0500 (Central Daylight Time)

 I thought about this some more, and realized the ENVIRON calls aren't 
 really needed.
 
 Here's an updated patch that applies cleanly to HEAD.
 
 Also, here's another set of benchmarks.
 
 I ran check-vulnerable in the pkgsrc/news directory (which has one active 
 vulnerability in my checkout) five times both without and with the patch.
 
 Before:
 Run 1: 29.02user 28.98system 2:41.87elapsed 35%CPU, 3064378 minor pfaults
 Run 2: 29.30user 29.28system 2:42.25elapsed 36%CPU, 3063098 minor pfaults
 Run 3: 29.31user 29.34system 2:42.98elapsed 35%CPU, 3063715 minor pfaults
 Run 4: 34.62user 34.73system 3:18.22elapsed 34%CPU, 3062598 minor pfaults
 Run 5: 28.96user 29.08system 2:41.06elapsed 36%CPU, 3063340 minor pfaults
 
 After:
 Run 1: 6.62user 4.33system 0:38.70elapsed 28%CPU, 379995 minor pfaults
 Run 2: 6.23user 4.25system 0:26.83elapsed 39%CPU, 379966 minor pfaults
 Run 3: 5.62user 3.89system 0:23.36elapsed 40%CPU, 379937 minor pfaults
 Run 4: 6.63user 4.50system 0:28.42elapsed 39%CPU, 380016 minor pfaults
 Run 5: 5.32user 3.70system 0:22.57elapsed 39%CPU, 380009 minor pfaults
 
 
 
 
 The patch below is also available at
 
 http://todd.rtk0.net/drop/check-vulnerable-speedup.patch
 
 
 Index: bsd.pkg.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
 retrieving revision 1.1814
 diff -u -r1.1814 bsd.pkg.mk
 --- bsd.pkg.mk	10 Apr 2006 04:47:30 -0000	1.1814
 +++ bsd.pkg.mk	12 Apr 2006 20:41:25 -0000
 @@ -1248,12 +1248,7 @@
   		. ${PKG_SYSCONFDIR}/audit-packages.conf;		\
   	fi;								\
   	if [ -f ${PKGVULNDIR}/pkg-vulnerabilities ]; then		\
 -		${SETENV} PKGNAME=${PKGNAME:Q}				\
 -			  PKGBASE=${PKGBASE:Q}				\
 -			${AWK} '/^$$/ { next }				\
 -				/^#.*/ { next }				\
 -				$$1 !~ ENVIRON["PKGBASE"] && $$1 !~ /\{/ { next } \
 -				{ s = sprintf("${PKG_ADMIN} pmatch \"%s\" %s && ${ECHO} \"*** WARNING - %s vulnerability in %s - see %s for more information ***\"", $$1, ENVIRON["PKGNAME"], $$2, ENVIRON["PKGNAME"], $$3); system(s); }' < ${PKGVULNDIR}/pkg-vulnerabilities || ${FALSE}; \
 +		${AWK} '/^'${PKGBASE:Q}'[<=>].*/ { s = sprintf("${PKG_ADMIN} pmatch \"%s\" %s && ${ECHO} \"*** WARNING - %s vulnerability in %s - see %s for more information ***\"", $$1, "${PKGNAME:Q}", $$2, "${PKGNAME:Q}", $$3); system(s); } ' < ${PKGVULNDIR}/pkg-vulnerabilities || ${FALSE}; \
   	fi
 
   .PHONY: do-fetch