From f3abb1b59ebd02a7d046ae6da3c5911372a3b715 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 19 Mar 2021 20:59:15 +0100 Subject: [PATCH] Fix exit code for pending updates (slackpkg 15.0.1) --- src/slackpkgplus.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index b1af55a..615ed4e 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -144,7 +144,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then # Get the current exit-code so that we can check if cleanup is # called in response of a CTRL+C (ie. $?=130) or not. local lEcode=$? - local retval=0 + local retval=${PENDING_UPDATES:-0} if [ "$CMD" == "info" ];then DETAILED_INFO=${DETAILED_INFO:-none} @@ -2269,6 +2269,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then if $UPDATES ; then echo "Slackpkg: Updated packages are available since last check." >&2 + PENDING_UPDATES=1 printf "\n [ %-24s ] [ %-20s ]\n" "Repository" "Status"