forked from mirrors/openup
check for pkg.conf installpath and/or PKG_PATH
This commit is contained in:
parent
331b94ef66
commit
20d2d91f3a
1 changed files with 12 additions and 3 deletions
15
openup
15
openup
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
# TODO
|
||||
# https://stable.mtier.org/vuxml/53.xml
|
||||
# check for pkg.conf installpath and/or PKG_PATH
|
||||
# check for installed binpatches from a previous release
|
||||
# extend usage() with doc from web; complete openup doc in usage()
|
||||
|
||||
|
|
@ -36,6 +35,11 @@ usage() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
error() {
|
||||
echo "!!! ${@}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "need root privileges to run this script"
|
||||
usage
|
||||
|
|
@ -46,8 +50,13 @@ set -A REL -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*
|
|||
REL_INT="$(echo ${REL[0]} | tr -d '.')"
|
||||
|
||||
if [ "${REL[1]}" == -!(stable) -o "${REL_INT}" -lt "${OPENUP_MINREL}" ]; then
|
||||
echo "!!! ${REL[0]}${REL[1]} is not a supported release"
|
||||
exit 1
|
||||
error "${REL[0]}${REL[1]} is not a supported release"
|
||||
fi
|
||||
|
||||
if ! grep -q installpath /etc/pkg.conf 2>/dev/null; then
|
||||
if [ -z "${PKG_PATH}" ]; then
|
||||
error "No package repository available (pkg.conf(5) and/or PKG_PATH)"
|
||||
fi
|
||||
fi
|
||||
|
||||
OPENUP_VERSION=2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue