forked from mirrors/openup
Fix runtime option parsing.
This commit is contained in:
parent
824106a288
commit
7f59ecbcef
1 changed files with 8 additions and 9 deletions
17
openup
17
openup
|
|
@ -40,24 +40,23 @@ if [ "$(id -u)" -ne 0 ]; then
|
|||
usage
|
||||
fi
|
||||
|
||||
# magic taken from fw_update(1)
|
||||
set -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
|
||||
release=$1
|
||||
tag=$2
|
||||
release_int="$(echo ${release} | tr -d '.')"
|
||||
# regex taken from fw_update(1)
|
||||
set -A REL -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
|
||||
REL_INT="$(echo ${REL[0]} | tr -d '.')"
|
||||
|
||||
if [ "${tag}" == -!(stable) ]; then
|
||||
if [ "${REL[1]}" == -!(stable) ]; then
|
||||
error "XXX -current is a no-no"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${release_int}" -lt "${OPENUP_MINREL}" ]; then
|
||||
error "XXX release ${release} is a no-no (non-fatal)"
|
||||
if [ "${REL_INT}" -lt "${OPENUP_MINREL}" ]; then
|
||||
error "XXX release ${REL[0]} is a no-no (non-fatal)"
|
||||
fi
|
||||
|
||||
OPENUP_VERSION=1
|
||||
OPENUP_MINREL=53
|
||||
MEESA=$(readlink -f $0)
|
||||
REL_INT="$(echo ${REL[0]} | tr -d '.')"
|
||||
TMPDIR="${TMPDIR:=/tmp}"
|
||||
|
||||
error() {
|
||||
|
|
@ -131,7 +130,7 @@ update_self() {
|
|||
}
|
||||
|
||||
update_binpatches() {
|
||||
local _BP=$(pkg_info -Q binpatch${release_int}-$(arch -s) | sed 's/.[^-]*$//' | sort -u)
|
||||
local _BP=$(pkg_info -Q binpatch${REL_INT}-$(arch -s) | sed 's/.[^-]*$//' | sort -u)
|
||||
|
||||
if [ -n "$_BP" ]; then
|
||||
echo "===> Updating binpatch(es)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue