aboutsummaryrefslogtreecommitdiff
path: root/sysutils/etcupdate
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-08-04 15:55:58 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-08-04 15:55:58 +0000
commit9c1b64af748249054061d93a412c50b1562d9914 (patch)
treebe610495b37532b69a1fa862d6aa475d005ae45b /sysutils/etcupdate
parent47076b9bb04b6af2df2a1d4df853688b96baae17 (diff)
downloadports-9c1b64af748249054061d93a412c50b1562d9914.tar.gz
ports-9c1b64af748249054061d93a412c50b1562d9914.zip
Notes
Diffstat (limited to 'sysutils/etcupdate')
-rw-r--r--sysutils/etcupdate/Makefile2
-rw-r--r--sysutils/etcupdate/src/etcupdate.sh34
2 files changed, 15 insertions, 21 deletions
diff --git a/sysutils/etcupdate/Makefile b/sysutils/etcupdate/Makefile
index 94c014ff9d75..700dc24acf15 100644
--- a/sysutils/etcupdate/Makefile
+++ b/sysutils/etcupdate/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= etcupdate
-PORTVERSION= 0.1
+PORTVERSION= 0.2
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/etcupdate/src/etcupdate.sh b/sysutils/etcupdate/src/etcupdate.sh
index a8956f632e00..61aa95ca8345 100644
--- a/sysutils/etcupdate/src/etcupdate.sh
+++ b/sysutils/etcupdate/src/etcupdate.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
#
# Copyright (c) 2010 Advanced Computing Technologies LLC
# Written by: John H. Baldwin <jhb@FreeBSD.org>
@@ -188,37 +188,29 @@ build_tree()
log "Building tree at $1 with $make"
mkdir -p $1/usr/obj >&3 2>&1
- (cd $SRCDIR; $make DESTDIR=$1 distrib-dirs) >&3 2>&1
- if [ $? -ne 0 ]; then
- echo "Failed to build tree at $1"
- return 1
- fi
+ (cd $SRCDIR; $make DESTDIR=$1 distrib-dirs) >&3 2>&1 || return 1
if ! [ -n "$nobuild" ]; then
(cd $SRCDIR; \
MAKEOBJDIRPREFIX=$1/usr/obj $make _obj SUBDIR_OVERRIDE=etc &&
MAKEOBJDIRPREFIX=$1/usr/obj $make everything SUBDIR_OVERRIDE=etc &&
MAKEOBJDIRPREFIX=$1/usr/obj $make DESTDIR=$1 distribution) >&3 2>&1
- >&3 2>&1
+ >&3 2>&1 || return 1
else
- (cd $SRCDIR; $make DESTDIR=$1 distribution) >&3 2>&1
- fi
- if [ $? -ne 0 ]; then
- echo "Failed to build tree at $1"
- return 1
+ (cd $SRCDIR; $make DESTDIR=$1 distribution) >&3 2>&1 || return 1
fi
- chflags -R noschg $1 >&3 2>&1
- rm -rf $1/usr/obj >&3 2>&1
+ chflags -R noschg $1 >&3 2>&1 || return 1
+ rm -rf $1/usr/obj >&3 2>&1 || return 1
# Purge auto-generated files. Only the source files need to
# be updated after which these files are regenerated.
- rm -f $1/etc/*.db $1/etc/passwd >&3 2>&1
+ rm -f $1/etc/*.db $1/etc/passwd >&3 2>&1 || return 1
# Remove empty files. These just clutter the output of 'diff'.
- find $1 -type f -size 0 -delete >&3 2>&1
+ find $1 -type f -size 0 -delete >&3 2>&1 || return 1
# Trim empty directories.
- find -d $1 -type d -empty -delete >&3 2>&1
+ find -d $1 -type d -empty -delete >&3 2>&1 || return 1
return 0
}
@@ -229,14 +221,15 @@ extract_tree()
{
# If we have a tarball, extract that into the new directory.
if [ -n "$tarball" ]; then
- (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE) >&3 2>&1
- if [ $? -ne 0 ]; then
+ if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE) \
+ >&3 2>&1; then
echo "Failed to extract new tree."
remove_tree $NEWTREE
exit 1
fi
else
if ! build_tree $NEWTREE; then
+ echo "Failed to build new tree."
remove_tree $NEWTREE
exit 1
fi
@@ -1216,11 +1209,12 @@ build_cmd()
exit 1
fi
if ! build_tree $dir; then
+ echo "Failed to build tree."
remove_tree $dir
exit 1
fi
if ! tar cfj $1 -C $dir . >&3 2>&1; then
- echo "Failed to create tarball ."
+ echo "Failed to create tarball."
remove_tree $dir
exit 1
fi