summaryrefslogtreecommitdiff
path: root/mk
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
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')
-rw-r--r--mk/bulk/build25
-rw-r--r--mk/bulk/printdepends33
-rw-r--r--mk/bulk/printindex23
3 files changed, 63 insertions, 18 deletions
diff --git a/mk/bulk/build b/mk/bulk/build
index 28f69727c0b..c4012e9eb73 100644
--- a/mk/bulk/build
+++ b/mk/bulk/build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: build,v 1.12 2001/10/13 14:32:01 dmcmahill Exp $
+# $NetBSD: build,v 1.13 2001/10/14 20:34:53 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
@@ -70,12 +70,19 @@ else
sh mk/bulk/pre-build # make veryveryclean :)
fi
-cd pkgtools/pkglint
-DEPENDSTREEFILE=`make show-var VARNAME=DEPENDSTREEFILE`
-DEPENDSFILE=`make show-var VARNAME=DEPENDSFILE`
-SUPPORTSFILE=`make show-var VARNAME=SUPPORTSFILE`
-INDEXFILE=`make show-var VARNAME=INDEXFILE`
-ORDERFILE=`make show-var VARNAME=ORDERFILE`
+if [ -d pkgtools/pkglint ]; then
+ cd pkgtools/pkglint
+ DEPENDSTREEFILE=`make show-var VARNAME=DEPENDSTREEFILE`
+ DEPENDSFILE=`make show-var VARNAME=DEPENDSFILE`
+ SUPPORTSFILE=`make show-var VARNAME=SUPPORTSFILE`
+ INDEXFILE=`make show-var VARNAME=INDEXFILE`
+ ORDERFILE=`make show-var VARNAME=ORDERFILE`
+ BROKENFILE=`make show-var VARNAME=BROKENFILE`
+else
+ echo "The pkgtools/pkglint directory does not exist. Please update"
+ echo "your pkgsrc tree in ${USR_PKGSRC}"
+ exit 1
+fi
cd ${USR_PKGSRC}
# get the list of packages which should always be installed during the build
@@ -97,7 +104,7 @@ done
cd ${USR_PKGSRC}
if [ "$1" != "restart" ]; then
echo "Building dependency tree (this may take a while)..."
- sh mk/bulk/printdepends > $DEPENDSTREEFILE
+ sh mk/bulk/printdepends $BROKENFILE > $DEPENDSTREEFILE
echo "Sorting build order..."
tsort $DEPENDSTREEFILE > $ORDERFILE
@@ -107,7 +114,7 @@ if [ "$1" != "restart" ]; then
./mk/bulk/tflat -d $DEPENDSTREEFILE > $DEPENDSFILE
echo "Generating package name <=> package directory cross reference file (this may take a while)..."
- sh mk/bulk/printindex > $INDEXFILE
+ sh mk/bulk/printindex $BROKENFILE > $INDEXFILE
fi
diff --git a/mk/bulk/printdepends b/mk/bulk/printdepends
index 3b11fd623bb..0bddf0abb98 100644
--- a/mk/bulk/printdepends
+++ b/mk/bulk/printdepends
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: printdepends,v 1.8 2001/10/12 19:28:02 hubertf Exp $
+# $NetBSD: printdepends,v 1.9 2001/10/14 20:34:53 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
@@ -34,6 +34,15 @@
# Print list of pkg dependencies suitable for tsort(1).
# Start in /usr/pkgsrc.
#
+# If an argument is given, use it as a file name
+# to contain any failure messages in each package directory.
+#
+
+if [ ! -z "$1" ]; then
+ brokenfile=$1
+else
+ brokenfile=/dev/null
+fi
# /usr/pkgsrc
cwd=$PWD
@@ -54,14 +63,24 @@ do
cd $pkgdir
l=`make show-depends-dirs`
- if [ "$l" = "" ]; then
- # No dependencies
+ if [ $? != 0 ]; then
+ echo "WARNING (printdepends): the package in $pkgdir had problem with" > /dev/stderr
+ echo " make show-depends-dirs" > /dev/stderr
+ echo " dependency information in the cache will" > /dev/stderr
+ echo " be dropped for $pkgdir" > /dev/stderr
+ echo "make show-depends-dirs failed:" > $brokenfile
+ make show-depends-dirs >> $brokenfile 2>&1
echo "$pkgdir $pkgdir"
else
- for depdir in $l
- do
- echo "$depdir $pkgdir"
- done
+ if [ "$l" = "" ]; then
+ # No dependencies
+ echo "$pkgdir $pkgdir"
+ else
+ for depdir in $l
+ do
+ echo "$depdir $pkgdir"
+ done
+ fi
fi
fi
cd $cwd
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
;;