summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-11-10 07:04:00 +0000
committerrillig <rillig@pkgsrc.org>2005-11-10 07:04:00 +0000
commit6b1abc9affa2da99900ade466aff812490e86959 (patch)
tree4714b568f70a71a0a103347499bb30a79a07179b /mk
parent213e5f0c1e7293493e8e2a89f2f1f27505d6575d (diff)
downloadpkgsrc-6b1abc9affa2da99900ade466aff812490e86959.tar.gz
Don't rely on the INDEXFILE having trailing white-space in each line.
Whoever had written such unusual code should have left a note in the printindex script that the trailing white-space was required. It is such an uncommon assumption that I treated it as a typo and removed it. Now it's fixed. I also replaced the use of grep|awk with a simple awk, as grep would have interpreted regular expressions in the package name. In general, please think more about _appropriate_ ways to handle data. grep(1) is not a tool for searching strings. It's a tool for searching regular expressions.
Diffstat (limited to 'mk')
-rw-r--r--mk/bulk/bsd.bulk-pkg.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk
index 016e361f719..3a5814f640e 100644
--- a/mk/bulk/bsd.bulk-pkg.mk
+++ b/mk/bulk/bsd.bulk-pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.bulk-pkg.mk,v 1.91 2005/11/07 18:22:22 tv Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.92 2005/11/10 07:04:00 rillig Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@NetBSD.org>
@@ -326,7 +326,7 @@ bulk-package:
for pkgname in `${PKG_INFO} -e \*` ; \
do \
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
- pkgdir=`${GREP} " $$pkgname " ${INDEXFILE} | ${AWK} '{print $$1}'` ;\
+ pkgdir=`${AWK} '$$2 == "'"$$pkgname"'" {print $$1}' ${INDEXFILE}`; \
if [ -z "$$pkgdir" ]; then \
pkgdir=unknown ; \
fi; \