summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-05-23 12:05:53 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-05-23 12:05:53 +0000
commitc38c9a74c0eeb5d4ba360c70818bcd1a955ff844 (patch)
tree5e56541b834382e87b0639fd37f3ae716eb5cc01 /usr.sbin/syspatch
parentShorten varname. (diff)
downloadwireguard-openbsd-c38c9a74c0eeb5d4ba360c70818bcd1a955ff844.tar.xz
wireguard-openbsd-c38c9a74c0eeb5d4ba360c70818bcd1a955ff844.zip
Only install /bsd.mp on SP machines if it's already there (a default
installation will not have it).
Diffstat (limited to 'usr.sbin/syspatch')
-rw-r--r--usr.sbin/syspatch/syspatch.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index e878d5f3ce2..d177746048f 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.104 2017/05/23 12:01:53 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.105 2017/05/23 12:05:53 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -31,7 +31,7 @@ usage()
apply_patch()
{
- local _edir _file _files _patch=$1 _ret=0
+ local _edir _file _files _patch=$1 _ret=0 _s
[[ -n ${_patch} ]]
_edir=${_TMP}/${_patch}
@@ -42,9 +42,10 @@ apply_patch()
echo "Installing patch ${_patch##${_OSrev}-}"
install -d ${_edir} ${_PDIR}/${_patch}
- _files="$(tar xvzphf ${_TMP}/syspatch${_patch}.tgz -C ${_edir})"
- checkfs ${_files}
+ ! ${_BSDMP} && [[ ! -f /bsd.mp ]] && _s="-s /^bsd.mp$//"
+ _files="$(tar -xvzphf ${_TMP}/syspatch${_patch}.tgz -C ${_edir} ${_s})"
+ checkfs ${_files}
create_rollback ${_patch} "${_files}"
# create_rollback(): tar(1) was fed with an empty list of files; that is