summaryrefslogtreecommitdiff
path: root/usr.sbin/sysmerge/sysmerge.sh
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2008-09-02 11:38:07 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2008-09-02 11:38:07 +0000
commitaf8762c8bd5971c07c227cc092130f4235b21274 (patch)
tree5eb48d50cba7f1460db5ccd777109b52c660ac55 /usr.sbin/sysmerge/sysmerge.sh
parent787fffcee76586c23d2157b80cd167ee70d96024 (diff)
- make sure they are no sendmail leftovers in src when sysmerge stops
unexpectedly feedback and ok sthen@
Diffstat (limited to 'usr.sbin/sysmerge/sysmerge.sh')
-rw-r--r--usr.sbin/sysmerge/sysmerge.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh
index 99058b2181c..73bbe28955e 100644
--- a/usr.sbin/sysmerge/sysmerge.sh
+++ b/usr.sbin/sysmerge/sysmerge.sh
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: sysmerge.sh,v 1.20 2008/08/29 08:17:28 ajacoutot Exp $
+# $OpenBSD: sysmerge.sh,v 1.21 2008/09/02 11:38:06 ajacoutot Exp $
#
# This script is based on the FreeBSD mergemaster script, written by
# Douglas Barton <DougB@FreeBSD.org>
@@ -30,7 +30,14 @@ PAGER="${PAGER:=/usr/bin/more}"
SWIDTH=`stty size | awk '{w=$2} END {if (w==0) {w=80} print w}'`
WRKDIR=`mktemp -d -p /var/tmp sysmerge.XXXXX` || exit 1
-trap "rm -rf ${WRKDIR}; exit 1" 1 2 3 13 15
+# clean leftovers created by make in src
+clean_src() {
+ if [ "${SRCDIR}" ]; then
+ cd ${SRCDIR}/gnu/usr.sbin/sendmail/cf/cf && make cleandir 1> /dev/null
+ fi
+}
+
+trap "clean_src; rm -rf ${WRKDIR}; exit 1" 1 2 3 13 15
if [ -z "${FETCH_CMD}" ]; then
if [ -z "${FTP_KEEPALIVE}" ]; then
@@ -418,10 +425,7 @@ do_post() {
fi
fi
- # clean leftovers created by make in src
- if [ "${SRCDIR}" ]; then
- cd ${SRCDIR}/gnu/usr.sbin/sendmail/cf/cf && make cleandir 1> /dev/null
- fi
+ clean_src
echo "===> Making sure your directory hierarchy has correct perms, running mtree"
mtree -qdef ${DESTDIR}/etc/mtree/4.4BSD.dist -p ${DESTDIR:=/} -U 1> /dev/null