diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2020-12-07 21:19:29 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2020-12-07 21:19:29 +0000 |
commit | d3f07430db8b1f1b27cde0ab13b26c9e3269f3f4 (patch) | |
tree | 1638658acbda9151fcde4f68c2521c2c647f3520 | |
parent | b78e0555772d888b6fc57acec4de6fc627d91068 (diff) |
When asking to install patches and none are available, return 2.
man page and inputs from schwarze@
ok sthen@
-rw-r--r-- | usr.sbin/syspatch/syspatch.8 | 6 | ||||
-rw-r--r-- | usr.sbin/syspatch/syspatch.sh | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/syspatch/syspatch.8 b/usr.sbin/syspatch/syspatch.8 index 2c0e53c90b2..cb67e500712 100644 --- a/usr.sbin/syspatch/syspatch.8 +++ b/usr.sbin/syspatch/syspatch.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: syspatch.8,v 1.21 2020/07/25 15:45:44 solene Exp $ +.\" $OpenBSD: syspatch.8,v 1.22 2020/12/07 21:19:28 ajacoutot Exp $ .\" .\" Copyright (c) 2016 Antoine Jacoutot <ajacoutot@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 25 2020 $ +.Dd $Mdocdate: December 7 2020 $ .Dt SYSPATCH 8 .Os .Sh NAME @@ -64,6 +64,8 @@ of installed patches. .El .Sh EXIT STATUS .Ex -std syspatch +In particular, 2 indicates that applying patches was requested but no +additional patch was installed. .Sh SEE ALSO .Xr signify 1 , .Xr installurl 5 , diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh index 57247f40969..4eacb6205e0 100644 --- a/usr.sbin/syspatch/syspatch.sh +++ b/usr.sbin/syspatch/syspatch.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: syspatch.sh,v 1.166 2020/10/27 17:42:05 tb Exp $ +# $OpenBSD: syspatch.sh,v 1.167 2020/12/07 21:19:28 ajacoutot Exp $ # # Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org> # @@ -320,6 +320,7 @@ if ((OPTIND == 1)); then [[ -f ${_D}/rollback.tgz ]] || rm -r ${_D} done _PATCHES=$(ls_missing) # can't use errexit in a for loop + [[ -n ${_PATCHES} ]] || exit 2 for _PATCH in ${_PATCHES}; do apply_patch ${_OSrev}-${_PATCH} _PATCH_APPLIED=true |