summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2020-12-07 21:19:28 +0000
committerajacoutot <ajacoutot@openbsd.org>2020-12-07 21:19:28 +0000
commit91cb7cd0534179111e18f0ec92f74506fd62dcd5 (patch)
treeecb204a841b47054635289834e75e224c724cbd2 /usr.sbin/syspatch
parentIn revision 1.18 of bt_parse.y, I missed the fact that the print() (diff)
downloadwireguard-openbsd-91cb7cd0534179111e18f0ec92f74506fd62dcd5.tar.xz
wireguard-openbsd-91cb7cd0534179111e18f0ec92f74506fd62dcd5.zip
When asking to install patches and none are available, return 2.
man page and inputs from schwarze@ ok sthen@
Diffstat (limited to 'usr.sbin/syspatch')
-rw-r--r--usr.sbin/syspatch/syspatch.86
-rw-r--r--usr.sbin/syspatch/syspatch.sh3
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