From 548e0c0a29ffd6e8a34754ae949c0b40c7550dd0 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Tue, 2 Sep 2008 11:38:06 +0000 Subject: [PATCH] - make sure they are no sendmail leftovers in src when sysmerge stops unexpectedly feedback and ok sthen@ --- usr.sbin/sysmerge/sysmerge.sh | 16 ++++++++++------ 1 file 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 @@ -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 -- 2.20.1