summaryrefslogtreecommitdiff
path: root/mk/bulk/printindex
diff options
context:
space:
mode:
authordmcmahill <dmcmahill@pkgsrc.org>2001-10-14 20:34:53 +0000
committerdmcmahill <dmcmahill@pkgsrc.org>2001-10-14 20:34:53 +0000
commitd2b3a2b5e3b66518d166be7c673764dfbfaebfba (patch)
treec1e72c4027253f36f46b2fd84619f9815297517a /mk/bulk/printindex
parent15c0280d2da3eb1822b2e1076d68cc6c0baabffa (diff)
downloadpkgsrc-d2b3a2b5e3b66518d166be7c673764dfbfaebfba.tar.gz
add some more failure checks for robustness.
- if something fails while extracting the DEPENDS for a particular package, mark that package as broken and drop the DEPENDS info for it. This allows the build to continue and properly marks the package as broken. - if something fails while extracting the PKGNAME, also mark the pkg as broken. - be more careful about seeing if directories exist before cd'ing to them. Lack of such a test has caused problems elsewhere, so hopefully this will make the system more robust.
Diffstat (limited to 'mk/bulk/printindex')
-rw-r--r--mk/bulk/printindex23
1 files changed, 21 insertions, 2 deletions
diff --git a/mk/bulk/printindex b/mk/bulk/printindex
index 9f105612f49..ef72f33e9b4 100644
--- a/mk/bulk/printindex
+++ b/mk/bulk/printindex
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: printindex,v 1.5 2001/07/13 15:14:57 dmcmahill Exp $
+# $NetBSD: printindex,v 1.6 2001/10/14 20:34:53 dmcmahill Exp $
#
#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,8 @@
#
-# Generate package index.
+# Generate package index. If an argument is given, use it as a file name
+# to contain any failure messages in each package directory.
#
# generates a pkgsrc directory <-> package name database. eg.
# foo/bar bar-2.0
@@ -47,6 +48,12 @@
# Start in /usr/pkgsrc.
#
+if [ ! -z "$1" ]; then
+ brokenfile=$1
+else
+ brokenfile=/dev/null
+fi
+
# /usr/pkgsrc
cwd=$PWD
@@ -63,6 +70,12 @@ do
else
cd $pkgdir
pkgname=`make show-var VARNAME=PKGNAME`
+ if [ $? != 0 ]; then
+ echo "ERROR: printindex could not extract PKNAME for $pkgdir" > /dev/stderr
+ echo "make show-var VARNAME=PKGNAME failed" > $brokenfile
+ make show-var VARNAME=PKGNAME >> $brokenfile 2>&1
+ exit 1
+ fi
echo "$pkgdir $pkgname "
fi
cd $cwd
@@ -85,6 +98,12 @@ do
*)
cd $cwd/$pkgdir
pkgname=`make show-var VARNAME=PKGNAME`
+ if [ $? != 0 ]; then
+ echo "ERROR: printindex could not extract PKNAME for $pkgdir" > /dev/stderr
+ echo "make show-var VARNAME=PKGNAME failed" > $brokenfile
+ make show-var VARNAME=PKGNAME >> $brokenfile 2>&1
+ exit 1
+ fi
echo "$pkgdir $pkgname "
cd $cwd
;;