From f1c7ac9576fb4df5fb2b882f57a717a5efdaec32 Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Tue, 13 Aug 2013 14:15:45 +0200 Subject: [PATCH] Abort immediately if binpatch from an older release is installed. --- openup | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openup b/openup index 9541251..a4771ad 100755 --- a/openup +++ b/openup @@ -18,7 +18,6 @@ # TODO # https://stable.mtier.org/vuxml/53.xml -# check for installed binpatches from a previous release # extend usage() with doc from web; complete openup doc in usage() ### user defined variables @@ -27,8 +26,7 @@ PKG_CERT_URL='https://stable.mtier.org/mtier.cert' PKG_CERT_FPRINT='DE:29:0F:7F:B8:0E:36:5A:AF:A9:BF:E0:4E:08:C2:0F:2D:50:16:97' ### end of user defined variables - -# DO NOT MODIFY ANYTHING BELOW THIS LINE!!! +### DO NOT MODIFY ANYTHING BELOW THIS LINE!!! usage() { echo "usage: ${0##*/} [-SUn]" >&2 @@ -59,6 +57,17 @@ if ! grep -q installpath /etc/pkg.conf 2>/dev/null; then fi fi +# check that we have no installed binpatches from a previous release +_BPLIST=$(pkg_info -q |grep binpatch) +if [ -n "${_BPLIST}" ]; then + _i=$(echo ${_BPLIST} | wc -w) + _v=$(echo ${BPLIST} | grep binpatch${REL_INT} | wc -w) + if [ "${_i}" -ne "${_v}" ]; then + error "Binpatch(es) from a previous release installed" + fi +fi +unset _BPLIST + OPENUP_VERSION=2 OPENUP_MINREL=53 MEESA=$(readlink -f $0)