summaryrefslogtreecommitdiff
path: root/mk/bulk/printindex
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-19 10:55:45 +0000
committerrillig <rillig>2005-11-19 10:55:45 +0000
commit73d23f716262d1ad7887af697df392e6c58747e1 (patch)
tree889f598f117075c177dcde76137bea5d498df757 /mk/bulk/printindex
parent334ae4c4ddf867d0ffcc37cfa920f350057bd509 (diff)
downloadpkgsrc-73d23f716262d1ad7887af697df392e6c58747e1.tar.gz
- Moved the "man page" comment into a real man page.
- Added more sanity checks.
Diffstat (limited to 'mk/bulk/printindex')
-rw-r--r--mk/bulk/printindex35
1 files changed, 17 insertions, 18 deletions
diff --git a/mk/bulk/printindex b/mk/bulk/printindex
index a63236e76c2..ff60d66edcf 100644
--- a/mk/bulk/printindex
+++ b/mk/bulk/printindex
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: printindex,v 1.25 2005/11/16 22:11:11 rillig Exp $
+# $NetBSD: printindex,v 1.26 2005/11/19 10:55:45 rillig Exp $
#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,23 +37,6 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-# usage: printindex [brokenfile [bulkfilesdir]]
-#
-# Generates a mapping from pkgsrc directories to the current package
-# version and prints it on stdout. Each line of the output has two
-# fields: the package directory (in the form category/package) and the
-# package version (in the form package-1.456nb3).
-#
-# If <brokenfile> is given, package-specific errors are logged to
-# <bulkfilesdir>/${pkgdir}/<brokenfile>. Otherwise no additional logging
-# takes place.
-#
-# The default for <bulkfilesdir> is the pkgsrc directory itself. If
-# <bulkfilesdir> differs from the pkgsrc directory, all directories
-# that are needed for the log files are created automatically.
-#
-# Note: printindex must be called from a pkgsrc root directory.
-
set -e
#
@@ -132,6 +115,22 @@ else
fi
#
+# Sanity checks, part 2
+#
+
+case $BULK_PREREQ in
+*[!-\ +./0-9A-Z_a-z]*)
+ echo "$0: error: BULK_PREREQ contains invalid characters. (Its value is \"${BULK_PREREQ}\".)" 1>&2
+ exit 1
+esac
+case $list in
+*[!-\ +./0-9A-Z_a-z]*)
+ echo "$0: error: The package list contains invalid characters. (Its value is \"${list}\".)" 1>&2
+ echo "$list" | tr ' ' '\n' > .list
+ exit 1
+esac
+
+#
# Print the table of PKGPATH and PKGNAME.
#
# The check for duplicates is necessary to prevents double entries in