summaryrefslogtreecommitdiff
path: root/mk/bulk/printindex
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 /mk/bulk/printindex
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.
Diffstat (limited to 'mk/bulk/printindex')
-rw-r--r--mk/bulk/printindex26
1 files changed, 14 insertions, 12 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