summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-11-28 01:14:35 +0000
committerrillig <rillig@pkgsrc.org>2005-11-28 01:14:35 +0000
commit8ba3dc01c06c729cf4834a7840f0968ebe246d59 (patch)
tree7d4705e0a5f4603cf3866edf4977336fd8d02da8
parent10d90257142e6c7f9e7957cd6cadeacce1adc5de (diff)
downloadpkgsrc-8ba3dc01c06c729cf4834a7840f0968ebe246d59.tar.gz
- 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.
-rw-r--r--mk/bulk/printindex26
-rw-r--r--mk/bulk/printindex.111
2 files changed, 16 insertions, 21 deletions
diff --git a/mk/bulk/printindex b/mk/bulk/printindex
index d73da7fde36..f5cbb9f4076 100644
--- a/mk/bulk/printindex
+++ b/mk/bulk/printindex
@@ -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 @@ yes) mkbulkdir="${MKDIR}";;
*) 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 --git a/mk/bulk/printindex.1 b/mk/bulk/printindex.1
index b82dd1cbf91..8c052bf46cb 100644
--- a/mk/bulk/printindex.1
+++ b/mk/bulk/printindex.1
@@ -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 @@ must be called from a pkgsrc root directory.
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