1
0
Fork 0
forked from mirrors/openup

Fix runtime option parsing.

This commit is contained in:
Antoine Jacoutot 2013-08-08 10:54:59 +02:00
commit 7f59ecbcef

17
openup
View file

@ -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)"