diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2018-05-09 10:22:07 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2018-05-09 10:22:07 +0000 |
commit | b15d269d762de135a3c4deff287d8988f6c20496 (patch) | |
tree | 1e0140ea376b7c4315665027503d176948024f63 /usr.sbin/syspatch | |
parent | 18e66eb5c37d6ef4f0150a270e2592fc8d924b4e (diff) |
Remove empty syspatch dir if we fail to extract.
Diffstat (limited to 'usr.sbin/syspatch')
-rw-r--r-- | usr.sbin/syspatch/syspatch.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh index c06a3536eb1..91c1ee39e04 100644 --- a/usr.sbin/syspatch/syspatch.sh +++ b/usr.sbin/syspatch/syspatch.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: syspatch.sh,v 1.136 2018/04/26 12:50:41 ajacoutot Exp $ +# $OpenBSD: syspatch.sh,v 1.137 2018/05/09 10:22:06 ajacoutot Exp $ # # Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org> # @@ -44,7 +44,8 @@ apply_patch() ${_BSDMP} && _s="-s @usr/share/relink/kernel/GENERIC/.*@@g" || _s="-s @usr/share/relink/kernel/GENERIC.MP/.*@@g" - _files="$(tar -xvzphf ${_TMP}/syspatch${_patch}.tgz -C ${_edir} ${_s})" + _files="$(tar -xvzphf ${_TMP}/syspatch${_patch}.tgz -C ${_edir} \ + ${_s})" || { rm -r ${_PDIR}/${_patch}; return 1; } checkfs ${_files} create_rollback ${_patch} "${_files}" |