summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-05-24 08:32:16 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-05-24 08:32:16 +0000
commitce3e785665fa02f39816dd144a7a3a1f33c094fa (patch)
treed4e11677a32ffd4dc57e6b3bc8b51a538d1e51bc /usr.sbin/syspatch/syspatch.sh
parentAlso trap INT when reverting a patch. (diff)
downloadwireguard-openbsd-ce3e785665fa02f39816dd144a7a3a1f33c094fa.tar.xz
wireguard-openbsd-ce3e785665fa02f39816dd144a7a3a1f33c094fa.zip
Don't fill up /tmp when installing or reverting multiple patches at once.
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 33785e74bb4..028d78725c7 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.107 2017/05/24 08:30:31 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.108 2017/05/24 08:32:16 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -67,6 +67,8 @@ apply_patch()
sp_err "Failed to apply patch ${_patch##${_OSrev}-}" 0
rollback_patch; return ${_ret}
fi
+ # don't fill up /tmp when installing multiple patches at once; non-fatal
+ rm -rf ${_edir} ${_TMP}/syspatch${_patch}.tgz
trap exit INT
}
@@ -226,7 +228,7 @@ rollback_patch()
if [[ ${_file} == @(bsd|bsd.mp) ]]; then
install_kernel ${_edir}/${_file} || _ret=$?
# remove the backup kernel if all kernel syspatches have
- # been reverted; non-fatal (`-f')
+ # been reverted; non-fatal
cmp -s /bsd /bsd.syspatch${_OSrev} &&
rm -f /bsd.syspatch${_OSrev}
else
@@ -236,6 +238,7 @@ rollback_patch()
((_ret == 0)) && rm -r ${_PDIR}/${_patch} ||
sp_err "Failed to revert patch ${_patch##${_OSrev}-}" ${_ret}
+ rm -rf ${_edir} # don't fill up /tmp when using `-R'; non-fatal
trap exit INT
}