From d6f92b70c0277c8c4e861159eedd46e640162407 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 5 Nov 2015 16:10:01 -0200 Subject: Do not consider only meta package, but also other pfSense main packages, also change exit code from -1 to 2 --- src/usr/local/sbin/pfSense-upgrade | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade index fbf6e59..eeee2b8 100755 --- a/src/usr/local/sbin/pfSense-upgrade +++ b/src/usr/local/sbin/pfSense-upgrade @@ -423,12 +423,25 @@ check_upgrade() { pkg_update if [ "$(compare_pkg_version ${_meta_pkg})" = "<" ]; then - _echo "A new ${product} version is available" - _exit -1 + local _new_version=$(pkg rquery %v ${_meta_pkg}) + _echo "${_new_version} version of ${product} is available" + _exit 2 else - _echo "Your system is up to date" - _exit 0 + for _pkg in $(pkg query -e "%n ~ ${product}-*" %n); do + # Ignore additional packages + if echo "${_pkg}" | grep -q "^${pkg_prefix}"; then + continue + fi + if [ "$(compare_pkg_version ${_pkg})" = "<" ]; then + local _new_version=$(pkg rquery %v ${_pkg}) + _echo "${_new_version} version of ${_pkg} is available" + _exit 2 + fi + done fi + + _echo "Your system is up to date" + _exit 0 } setup_nanobsd_env() { -- cgit v1.1