pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/bulk Properly handle package directories containing...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/34e083ca39e6
branches:  trunk
changeset: 502938:34e083ca39e6
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Nov 11 09:18:57 2005 +0000

description:
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:

 mk/bulk/printindex |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 38810f31f9f4 -r 34e083ca39e6 mk/bulk/printindex
--- a/mk/bulk/printindex        Fri Nov 11 07:45:03 2005 +0000
+++ b/mk/bulk/printindex        Fri Nov 11 09:18:57 2005 +0000
@@ -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 @@
        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 @@
                continue;;
        esac
        case $detect_duplicates in yes)
-               case $done_pkgs in *=${pkgdir}=*)
+               case $done_pkgs in *="${pkgdir}"=*)
                        continue;;
                esac;;
        esac



Home | Main Index | Thread Index | Old Index