forked from mirrors/openup
Minor tweaks.
This commit is contained in:
parent
b64e67315a
commit
4e40824649
1 changed files with 7 additions and 6 deletions
13
openup
13
openup
|
|
@ -27,7 +27,9 @@ PKG_PATH_MAIN="http://ftp.fr.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(arch
|
||||||
PKG_PATH_UPDATE="https://stable.mtier.org/updates/$(uname -r)/$(arch -s)"
|
PKG_PATH_UPDATE="https://stable.mtier.org/updates/$(uname -r)/$(arch -s)"
|
||||||
### end of user defined variables
|
### end of user defined variables
|
||||||
|
|
||||||
### DO NOT MODIFY ANYTHING BELOW THIS LINE!!!
|
########################################################################
|
||||||
|
### DO NOT MODIFY ANYTHING BELOW THIS LINE!!! #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
_OPENUP_VERSION=3
|
_OPENUP_VERSION=3
|
||||||
_OPENUP_MINREL=53
|
_OPENUP_MINREL=53
|
||||||
|
|
@ -41,8 +43,9 @@ usage() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_error() {
|
error() {
|
||||||
echo "!!! ${@}"
|
echo "!!! ${@}"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$(id -u)" -ne 0 ]; then
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
|
@ -55,8 +58,7 @@ set -A _REL -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]
|
||||||
_REL_INT="$(echo ${_REL[0]} | tr -d '.')"
|
_REL_INT="$(echo ${_REL[0]} | tr -d '.')"
|
||||||
|
|
||||||
if [ "${_REL[1]}" == -!(stable) -o "${_REL_INT}" -lt "${_OPENUP_MINREL}" ]; then
|
if [ "${_REL[1]}" == -!(stable) -o "${_REL_INT}" -lt "${_OPENUP_MINREL}" ]; then
|
||||||
pr_error "${_REL[0]}${_REL[1]} is not a supported release"
|
error "${_REL[0]}${_REL[1]} is not a supported release"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check that we have no installed binpatches from a previous release
|
# check that we have no installed binpatches from a previous release
|
||||||
|
|
@ -65,8 +67,7 @@ if [ -n "${_BPLIST}" ]; then
|
||||||
_i=$(echo ${_BPLIST} | wc -w)
|
_i=$(echo ${_BPLIST} | wc -w)
|
||||||
_v=$(echo ${_BPLIST} | grep "^binpatch${_REL_INT}" | wc -w)
|
_v=$(echo ${_BPLIST} | grep "^binpatch${_REL_INT}" | wc -w)
|
||||||
if [ "${_i}" -ne "${_v}" ]; then
|
if [ "${_i}" -ne "${_v}" ]; then
|
||||||
pr_error "Binpatch(es) from a previous release installed"
|
error "Binpatch(es) from a previous release installed"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset _BPLIST
|
unset _BPLIST
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue