diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2016-11-01 16:05:54 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2016-11-01 16:05:54 +0000 |
commit | 30961ca52cd6000474866bdd36772d1e1bae37e3 (patch) | |
tree | a984f9619bda218ef581e946727fe2a48429beb7 /usr.sbin/syspatch/syspatch.sh | |
parent | 62a0fb547115c58233b69553aa4df992c0eb2090 (diff) |
Also remove non matching release rollback kernel.
Temporary unhook the cleanup function during tests.
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r-- | usr.sbin/syspatch/syspatch.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh index 8ed5d82298e..2289ad781e2 100644 --- a/usr.sbin/syspatch/syspatch.sh +++ b/usr.sbin/syspatch/syspatch.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: syspatch.sh,v 1.20 2016/11/01 15:51:04 ajacoutot Exp $ +# $OpenBSD: syspatch.sh,v 1.21 2016/11/01 16:05:53 ajacoutot Exp $ # # Copyright (c) 2016 Antoine Jacoutot <ajacoutot@openbsd.org> # @@ -191,7 +191,7 @@ ls_missing() sp_cleanup() { - local _d + local _d _k # remove non matching release /var/syspatch/ content cd ${_PDIR} && set -- * @@ -200,6 +200,13 @@ sp_cleanup() [[ ${_d} == ${_REL} ]] || rm -r ${_d} done + # remove non matching release rollback kernel + set -- /bsd.rollback* + for _k; do + [[ -f ${_k} ]] || continue + [[ ${_k} == /bsd.rollback${_RELINT} ]] || rm ${_k} + done + # remove rollback kernel if all kernel syspatches have been reverted cmp -s /bsd /bsd.rollback${_RELINT} && rm /bsd.rollback${_RELINT} } @@ -269,5 +276,4 @@ shift $(( OPTIND -1 )) [[ ${OPTIND} != 1 ]] || apply_patches -sp_cleanup rm -rf ${_TMP} |