summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-06-09 07:32:26 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-06-09 07:32:26 +0000
commitbb444e86f0275e87a93908324a156af360ad5f36 (patch)
treed60fb70c9d073e884954ebc85cc8dac7e8070292 /usr.sbin/syspatch
parentreturn failure rather than fatal() for more cases during mux (diff)
downloadwireguard-openbsd-bb444e86f0275e87a93908324a156af360ad5f36.tar.xz
wireguard-openbsd-bb444e86f0275e87a93908324a156af360ad5f36.zip
/etc/mtree/BSD.x11.dist is part of base, not X; so check for
/var/sysmerge/xetc.tgz to detect whether we have the x sets installed.
Diffstat (limited to 'usr.sbin/syspatch')
-rw-r--r--usr.sbin/syspatch/syspatch.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 425820b7e62..9f84c94d59a 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.112 2017/05/27 09:05:25 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.113 2017/06/09 07:32:26 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -246,7 +246,7 @@ rollback_patch()
sp_cleanup()
{
- local _d _k _m
+ local _d _k
# remove non matching release /var/syspatch/ content
for _d in ${_PDIR}/{.[!.],}*; do
@@ -262,9 +262,9 @@ sp_cleanup()
done
# in case a patch added a new directory (install -D)
- for _m in /etc/mtree/{4.4BSD,BSD.x11}.dist; do
- [[ -f ${_m} ]] && mtree -qdef ${_m} -p / -U >/dev/null
- done
+ mtree -qdef /etc/mtree/4.4BSD.dist -p / -U >/dev/null
+ [[ -f /var/sysmerge/xetc.tgz ]] &&
+ mtree -qdef /etc/mtree/BSD.x11.dist -p / -U >/dev/null
}
unpriv()
@@ -297,7 +297,6 @@ _MIRROR=$(while read _line; do _line=${_line%%#*}; [[ -n ${_line} ]] &&
print -r -- "${_line}"; done </etc/installurl | tail -1) 2>/dev/null
[[ ${_MIRROR} == @(file|http|https)://*/*[!/] ]] ||
sp_err "${0##*/}: invalid URL configured in /etc/installurl"
-
_MIRROR="${_MIRROR}/syspatch/${_KERNV[0]}/$(machine)"
(($(sysctl -n hw.ncpufound) > 1)) && _BSDMP=true || _BSDMP=false