From 93bdad7191d6055bca0532b6699f57992fab55af Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Mon, 12 Oct 2015 18:13:59 +0000 Subject: [PATCH] Only remove existing sum files on trap handlers. req. by semarie@ --- usr.sbin/sysmerge/sysmerge.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 -- 2.20.1