Only invoke audit-packages if we do find the package-name prefix in
the vulnerabilities file. This cuts down significantly on the time spent running sort-packages: On 3228 packages before: 20259.43s real 9888.82s user 13138.60s system With this change: 6595.97s real 3215.58s user 4265.13s system
This commit is contained in:
parent
161bfb99b6
commit
853b673667
1 changed files with 8 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
#! /bin/sh
|
||||
# $NetBSD: sort-packages,v 1.4 2006/10/01 14:54:16 rillig Exp $
|
||||
# $NetBSD: sort-packages,v 1.5 2007/02/20 06:46:20 jschauma Exp $
|
||||
|
||||
# This program scans all binary packages in the current directory and
|
||||
# creates three lists of files in OUTDIR:
|
||||
|
@ -65,12 +65,14 @@ for pkg in *${PKG_SUFX}; do
|
|||
|
||||
if [ "${restricted}" = "no" ] && [ "${no_bin_on_ftp}" = "no" ]; then
|
||||
# Check whether the package is vulnerable or not.
|
||||
vuln=`${AUDIT_PACKAGES} -p "${pkg}"`
|
||||
if [ "${vuln}" = "" ]; then
|
||||
pkg_prefix="${pkg%%-*}"
|
||||
category="regular"
|
||||
else
|
||||
if grep "^${pkg_prefix}" /usr/pkgsrc/distfiles/pkg-vulnerabilities >/dev/null 2>&1; then
|
||||
vuln=`${AUDIT_PACKAGES} -p "${pkg}"`
|
||||
if [ -n "${vuln}" ]; then
|
||||
category="vulnerable"
|
||||
fi
|
||||
fi
|
||||
elif [ "${restricted}" != "unknown" ] && [ "${no_bin_on_ftp}" != "unknown" ]; then
|
||||
category="restricted"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue