summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjschauma <jschauma@pkgsrc.org>2007-02-20 06:46:20 +0000
committerjschauma <jschauma@pkgsrc.org>2007-02-20 06:46:20 +0000
commit853b67366729db9dc7493ddfc84cba91d34429cc (patch)
tree257fdd950511827cdb0f7ef27968c89ba08ba42c /mk
parent161bfb99b657f5d157318b17e11332f1bf0888a3 (diff)
downloadpkgsrc-853b67366729db9dc7493ddfc84cba91d34429cc.tar.gz
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
Diffstat (limited to 'mk')
-rw-r--r--mk/bulk/sort-packages14
1 files changed, 8 insertions, 6 deletions
diff --git a/mk/bulk/sort-packages b/mk/bulk/sort-packages
index fc315cbbeca..3303b02f734 100644
--- a/mk/bulk/sort-packages
+++ b/mk/bulk/sort-packages
@@ -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,11 +65,13 @@ 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
- category="regular"
- else
- category="vulnerable"
+ pkg_prefix="${pkg%%-*}"
+ category="regular"
+ 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"