pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/bulk - Don't use the .pkglist cache anymore, as the...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/86cf12fcacea
branches:  trunk
changeset: 503741:86cf12fcacea
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Nov 28 01:14:35 2005 +0000

description:
- Don't use the .pkglist cache anymore, as the cache is quite cheap to
  regenerate. This change makes printdepends and printindex more
  independent, because before this change, printindex could use the
  cache provided by printdepends, but not the other way round.

- Fixed the section "Sanity checks, part 2" by allowing newline
  characters in the list of packages from which the index is built.
  This bug just hasn't been noticed because the list taken from the
  cache did not have newlines at all.

  The '-' character is not included in the $allowed variable because it
  is handled specially and differently by sh(1) and tr(1).

- Updated the printindex man page.

diffstat:

 mk/bulk/printindex   |  26 ++++++++++++++------------
 mk/bulk/printindex.1 |  11 ++---------
 2 files changed, 16 insertions(+), 21 deletions(-)

diffs (82 lines):

diff -r 9888a8af1581 -r 86cf12fcacea mk/bulk/printindex
--- a/mk/bulk/printindex        Mon Nov 28 00:33:55 2005 +0000
+++ b/mk/bulk/printindex        Mon Nov 28 01:14:35 2005 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: printindex,v 1.27 2005/11/19 11:19:10 rillig Exp $
+# $NetBSD: printindex,v 1.28 2005/11/28 01:14:35 rillig Exp $
 #
 
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -107,27 +107,29 @@
 *)     mkbulkdir=":";;
 esac
 
-if [ -r "${bulkfilesdir}/.pkglist" ]; then
-       . "${bulkfilesdir}/.pkglist"
-else
-       # fall back to all packages.
-       list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
-fi
+case ${PKGLIST-""} in
+"")    # List of all packages, from pkgsrc/*/Makefile
+       list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${GREP} -v regress/ | ${SED} 's,/Makefile.*=[[:space:]]*,/,'`
+       ;;
+*)     list="${PKGLIST}"
+       ;;
+esac
 
 #
 # Sanity checks, part 2
 #
 
-alnum="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+allowed="
+ +./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
 case $BULK_PREREQ in
-*[!-\ +./${alnum}_]*)
-       inval=`echo "${BULK_PREREQ}" | tr -d " +\\\\-./${alnum}_"`
+*[!-"${allowed}"]*)
+       inval=`echo "${BULK_PREREQ}" | tr -d " +\\\\-${allowed}"`
        echo "$0: error: BULK_PREREQ contains invalid characters (${inval})." 1>&2
        exit 1
 esac
 case $list in
-*[!-\ +./${alnum}_]*)
-       inval=`echo "${list}" | tr -d " +\\\\-./${alnum}_"`
+*[!-"${allowed}"]*)
+       inval=`echo "${list}" | tr -d " +\\\\-${allowed}"`
        echo "$0: error: The package list contains invalid characters (${inval})." 1>&2
        exit 1
 esac
diff -r 9888a8af1581 -r 86cf12fcacea mk/bulk/printindex.1
--- a/mk/bulk/printindex.1      Mon Nov 28 00:33:55 2005 +0000
+++ b/mk/bulk/printindex.1      Mon Nov 28 01:14:35 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: printindex.1,v 1.4 2005/11/20 15:46:48 rillig Exp $
+.\"    $NetBSD: printindex.1,v 1.5 2005/11/28 01:14:35 rillig Exp $
 .\"
 .\" Copyright (c) 2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -74,20 +74,13 @@
 Non-zero if writing to a log file fails, zero otherwise.
 .Sh ENVIRONMENT
 .Bl -tag -width XXXXXX
-.It Ev BMAKE
+.It Ev BMAKE Pq mandatory
 The
 .Xr make 1
 program used to build packages.
 .It Ev PKGLIST Pq optional
 The list of packages from which to build an index.
 .El
-.Sh FILES
-.Bl -tag -width XXXXXX
-.It Ar bulkfilesdir Ns / Ns .pkglist
-A cache for the list of packages when
-.Ev PKGLIST
-is unset.
-.El
 .\" .Sh EXAMPLES
 .Sh DIAGNOSTICS
 Diagnostics have one of the two forms



Home | Main Index | Thread Index | Old Index