summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-11 09:18:57 +0000
committerrillig <rillig>2005-11-11 09:18:57 +0000
commit89470e70f8cc825d68b01f824d68e67192b4fae7 (patch)
tree83af58ecd920501eea650426c6e933df80a1b188 /mk
parent448dd0c289711ee223f70ff8678b6c9e24a47b2a (diff)
downloadpkgsrc-89470e70f8cc825d68b01f824d68e67192b4fae7.tar.gz
Properly handle package directories containing shell special characters
like [], ?, *. They _really_ should not exist, but you never know. While here, added a rationale for the not-so-obvious :detect_duplicates: delimiter.
Diffstat (limited to 'mk')
-rw-r--r--mk/bulk/printindex13
1 files changed, 11 insertions, 2 deletions
diff --git a/mk/bulk/printindex b/mk/bulk/printindex
index 3b39932c1e1..2dfedb47725 100644
--- a/mk/bulk/printindex
+++ b/mk/bulk/printindex
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: printindex,v 1.19 2005/11/08 13:55:29 rillig Exp $
+# $NetBSD: printindex,v 1.20 2005/11/11 09:18:57 rillig Exp $
#
#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -94,6 +94,15 @@ else
list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
fi
+#
+# Print the table of PKGPATH and PKGNAME.
+#
+# The check for duplicates is necessary to prevents double entries in
+# the table. The use of the :detect_duplicates: delimiter prevents the
+# inner "case" from occuring too often, as the $done_pkgs string grows
+# to about 100k during one run of the program. This saves about
+# 40 seconds on a 1 GHz Athlon.
+#
done_pkgs=""
detect_duplicates=no
for pkgdir in $list :detect_duplicates: $BULK_PREREQ; do
@@ -103,7 +112,7 @@ for pkgdir in $list :detect_duplicates: $BULK_PREREQ; do
continue;;
esac
case $detect_duplicates in yes)
- case $done_pkgs in *=${pkgdir}=*)
+ case $done_pkgs in *="${pkgdir}"=*)
continue;;
esac;;
esac