summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2016-12-08 09:47:37 +0000
committerajacoutot <ajacoutot@openbsd.org>2016-12-08 09:47:37 +0000
commite6d78d6ec2c9b6e5f747f677206ccbe6267d98b0 (patch)
treeb3a541f925426cd9e90698c6ab84759237c27ae6 /usr.sbin/syspatch/syspatch.sh
parentSimplify get_interfaces function, make it return NULL if we didn't find (diff)
downloadwireguard-openbsd-e6d78d6ec2c9b6e5f747f677206ccbe6267d98b0.tar.xz
wireguard-openbsd-e6d78d6ec2c9b6e5f747f677206ccbe6267d98b0.zip
Make it possible to install patches even if we don't have all sets installed
(e.g. no x sets); in this case, syspatch will skip the patch *but* it will still be listed as available. This will allow applying the patch in case sets are installed later on.
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 557890cb1f9..a65ed527529 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.77 2016/12/07 15:36:50 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.78 2016/12/08 09:47:37 ajacoutot Exp $
#
# Copyright (c) 2016 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -47,6 +47,12 @@ apply_patch()
create_rollback ${_patch} "${_files}"
+ # create_rollback(): tar(1) was fed with an empty list of files; that is
+ # not an error but no tarball is created; this happens if no earlier
+ # version of the files contained in the syspatch exists on the system
+ [[ ! -f ${_PDIR}/${_patch}/rollback.tgz ]] && unset _files &&
+ echo "Missing set, skipping patch ${_patch##${_OSrev}-}"
+
for _file in ${_files}; do
((_ret == 0)) || break
if [[ ${_file} == @(bsd|bsd.mp) ]]; then
@@ -122,9 +128,6 @@ create_rollback()
_ret=$?
fi
- # missing archive (empty _rbfiles list)
- [[ -f ${_PDIR}/${_patch}/rollback.tgz ]] || _ret=$?
-
if ((_ret != 0)); then
sp_err "Failed to create rollback patch ${_patch##${_OSrev}-}" 0
rm -r ${_PDIR}/${_patch}; return ${_ret}
@@ -180,7 +183,6 @@ ls_installed()
ls_missing()
{
- # XXX match with installed sets
local _c _idx=${_TMP}/idx.txt _l="$(ls_installed)"
unpriv -f "${_idx}" ${_FETCH} -o "${_idx}" "${_URL}/index.txt"