From 80aa2722efa61222a3cbc89d9a165e65c4f87760 Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 8 Oct 2008 16:43:34 +0000 Subject: pbulk-0.36: Avoid grep -q and use awk instead. This has the side effect of parsing presolve only once for each file. grep -q doesn't exist on Solaris. --- pkgtools/pbulk/Makefile | 4 ++-- pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index f0819fa5441..ab253524735 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.47 2008/09/22 11:31:16 joerg Exp $ +# $NetBSD: Makefile,v 1.48 2008/10/08 16:43:34 joerg Exp $ -DISTNAME= pbulk-0.35 +DISTNAME= pbulk-0.36 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart index b5d09c29eb6..49a024464c8 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart +++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart @@ -1,5 +1,5 @@ #!@SH@ -# $NetBSD: bulkbuild-restart,v 1.2 2008/09/16 18:21:30 joerg Exp $ +# $NetBSD: bulkbuild-restart,v 1.3 2008/10/08 16:43:34 joerg Exp $ . @PBULK_CONFIG@ @@ -12,11 +12,15 @@ if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then fi check_list() { - while read pkg - do - grep -q "^PKGNAME=${pkg}$" ${loc}/presolve && continue - return 1 - done < "$1" + @AWK@ -v presolve=${loc}/presolve 'BEGIN { + while (getline < presolve) { + if ($0 ~ "^PKGNAME=") { + cur = substr($0, 9) + pkg[cur] = 1 + } + } + } + { if (!pkg[$0]) exit(1) }' "$1" || return 1 return 0 } -- cgit v1.2.3