From 9cb0ed1b2174b6edd451a591c5a026edcf35b2da Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 24 Jan 2024 22:06:40 +0000 Subject: [PATCH] Adjust report for when only dependent packages need upgrading --- bin/sokwedb-venv-report | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/sokwedb-venv-report b/bin/sokwedb-venv-report index e15e978..76d446d 100644 --- a/bin/sokwedb-venv-report +++ b/bin/sokwedb-venv-report @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2023 The Meme Factory, Inc. http://www.meme.com/ +# Copyright (C) 2023, 2024 The Meme Factory, Inc. http://www.meme.com/ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -30,7 +30,7 @@ # # Karl O. Pinc -TO_ADDR=sokwedb-venv-email-recipients +TO_ADDR=sokwedb-venv-email-recipients ;# do not modify; see above SUBJECT="$(hostname) outdated Python package report" export VENV_PATH=/srv/venvs @@ -55,8 +55,13 @@ report () { | awk -v pkg="${pkg}" \ '{if ($1 == pkg) print $2;}')" if [ "${available}" != "${installed}" ] ; then - printf 'Package %s is at version %s, but version %s is available\n' \ - "${pkg}" "${installed}" "${available}" + if [ -z "${available}" ] ; then + printf 'Package %s has upgradeable dependencies; %s\n' \ + "${pkg}" '"upgrade" the package to upgrade the dependencies' + else + printf 'Package %s is at version %s, but version %s is available\n' \ + "${pkg}" "${installed}" "${available}" + fi fi } @@ -77,4 +82,4 @@ if [ -s ${TMP_MSG} ] ; then printf "available.\n\n" cat ${TMP_MSG} } | mail -s "${SUBJECT}" ${TO_ADDR} -fi \ No newline at end of file +fi -- 2.34.1