From: ajacoutot Date: Mon, 12 Oct 2015 18:13:59 +0000 (+0000) Subject: Only remove existing sum files on trap handlers. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=93bdad7191d6055bca0532b6699f57992fab55af;p=openbsd Only remove existing sum files on trap handlers. req. by semarie@ --- diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index 23589fca2db..858f96fb5ea 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.211 2015/09/18 18:03:47 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.212 2015/10/12 18:13:59 ajacoutot Exp $ # # Copyright (c) 2008-2014 Antoine Jacoutot # Copyright (c) 1998-2003 Douglas Barton @@ -38,12 +38,16 @@ stripcom() { sm_error() { (($#)) && echo "---- Error: $@" - rm -f /var/sysmerge/{etc,pkg,xetc}sum rm -rf ${_TMPROOT} exit 1 } -trap "sm_error; exit 1" 1 2 3 13 15 +sm_trap() { + sm_error + rm -f /var/sysmerge/{etc,pkg,xetc}sum +} + +trap "sm_trap; exit 1" 1 2 3 13 15 sm_info() { (($#)) && echo "---- Info: $@" || true