summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-11-08 22:12:42 +0000
committerrillig <rillig@pkgsrc.org>2005-11-08 22:12:42 +0000
commit0be3c5b4d81c1897d0633e543d354a6854e442df (patch)
tree0cfc6221e0b1fb0906a8e9bb698c27bf245b0848
parentf651bf444cca6ae9d185628889aa7d01da05828b (diff)
downloadpkgsrc-0be3c5b4d81c1897d0633e543d354a6854e442df.tar.gz
- Improved error handling.
- Changed "foo; if [ $? -eg 0 ]; then" to "if foo; then" in three places.
-rw-r--r--mk/bulk/build15
1 files changed, 7 insertions, 8 deletions
diff --git a/mk/bulk/build b/mk/bulk/build
index 181ea603300..aa702923935 100644
--- a/mk/bulk/build
+++ b/mk/bulk/build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: build,v 1.71 2005/11/08 21:57:59 rillig Exp $
+# $NetBSD: build,v 1.72 2005/11/08 22:12:42 rillig Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@NetBSD.org>
@@ -360,13 +360,14 @@ echo "Starting actual build using the order specified in $ORDERFILE..."
# can make a progress-meter very simple to add!
# make sure we have something to grep in in the build loop
-touch "${BUILDLOG}"
+touch "${BUILDLOG}" || die "Cannot write to ${pkgsrc_dir}/${BUILDLOG}."
tot=`wc -l $ORDERFILE | ${AWK} '{print $1}'`
for pkgdir in `cat $ORDERFILE`
do
- ${GREP} -q "^${pkgdir}\$" $BUILDLOG
- if [ $? -ne 0 ]; then
+ if ${GREP} -q "^${pkgdir}\$" "${BUILDLOG}"; then
+ : "skip this package"
+ else
built=`wc -l $BUILDLOG | ${AWK} '{print $1}'`
percent=`echo $built $tot | ${AWK} '{printf("%4.1f%%",$1*100/$2);}'`
( cd "${pkgsrc_dir}/${pkgdir}" \
@@ -380,8 +381,7 @@ done
echo "Build finished. Removing all installed packages left over from build..."
for pkgname in `${PKG_TOOLS_BIN}/pkg_info -e \*`
do
- ${PKG_TOOLS_BIN}/pkg_info -qe $pkgname
- if [ $? -eq 0 ]; then
+ if ${PKG_TOOLS_BIN}/pkg_info -qe $pkgname; then
pkgdir=`${AWK} "/ $pkgname /"'{print $1}{}' $INDEXFILE`
case "${BULK_PREREQ}" in
*$pkgdir* )
@@ -390,8 +390,7 @@ do
* )
echo ${PKG_TOOLS_BIN}/pkg_delete -r $pkgname
${PKG_TOOLS_BIN}/pkg_delete -r $pkgname
- ${PKG_TOOLS_BIN}/pkg_info -qe $pkgname
- if [ $? -eq 0 ]; then
+ if ${PKG_TOOLS_BIN}/pkg_info -qe $pkgname; then
echo "$pkgname ($pkgdir) did not deinstall nicely. Forcing the deinstall"
${PKG_TOOLS_BIN}/pkg_delete -f $pkgname || true
fi