summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-07-22 09:59:08 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-07-22 09:59:08 +0000
commit2333d06433876fed3816253df1ec19705aa9f1c5 (patch)
tree8d6ce5239326207e681c0dcbc86a55fdca6749ee
parentUse monotonic clock for the time command in csh and ksh. (diff)
downloadwireguard-openbsd-2333d06433876fed3816253df1ec19705aa9f1c5.tar.xz
wireguard-openbsd-2333d06433876fed3816253df1ec19705aa9f1c5.zip
Cleanup previous release patches and backup kernel _before_ applying new
patches. This will mitigate possible /var overflow (previous behavior was to clean up _after_ applying all patches which means we would have rollback patches from the previous and current release before the previous ones got cleaned).
-rw-r--r--usr.sbin/syspatch/syspatch.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index fcc9790c4f2..9ecc19f2e23 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.115 2017/07/04 20:25:53 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.116 2017/07/22 09:59:08 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -262,11 +262,6 @@ sp_cleanup()
[[ -f ${_k} ]] || continue
[[ ${_k} == /bsd.syspatch${_OSrev} ]] || rm ${_k}
done
-
- # in case a patch added a new directory (install -D)
- mtree -qdef /etc/mtree/4.4BSD.dist -p / -U >/dev/null
- [[ -f /var/sysmerge/xetc.tgz ]] &&
- mtree -qdef /etc/mtree/BSD.x11.dist -p / -U >/dev/null
}
unpriv()
@@ -322,10 +317,15 @@ done
shift $((OPTIND - 1))
(($# != 0)) && usage
+# default action: apply all patches
if ((OPTIND == 1)); then
+ sp_cleanup
_PATCHES=$(ls_missing)
for _PATCH in ${_PATCHES}; do
apply_patch ${_OSrev}-${_PATCH}
done
- sp_cleanup
+ # in case a patch added a new directory (install -D)
+ mtree -qdef /etc/mtree/4.4BSD.dist -p / -U >/dev/null
+ [[ ! -f /var/sysmerge/xetc.tgz ]] ||
+ mtree -qdef /etc/mtree/BSD.x11.dist -p / -U >/dev/null
fi