diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2015-10-12 18:14:00 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2015-10-12 18:14:00 +0000 |
commit | abcc9b905598d1fec18f6f41382530eb233c75d6 (patch) | |
tree | bce3d1ae5eefd225a6bb5d3a99f73f6913a34bf0 /usr.sbin/sysmerge | |
parent | 782c812fd0ca6898a54f637da467b64a9a6aa792 (diff) |
Only remove existing sum files on trap handlers.
req. by semarie@
Diffstat (limited to 'usr.sbin/sysmerge')
-rw-r--r-- | usr.sbin/sysmerge/sysmerge.sh | 10 |
1 files 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 <ajacoutot@openbsd.org> # Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org> @@ -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 |