Plugin pacman_pending_updates: handle absence of available updates properly
"checkupdates" returns the exit code 2, if no updates are pending. Previously the plugin did not output anything in this case. Closes: #1233
This commit is contained in:
parent
13b9078f76
commit
c2aa56531c
|
@ -58,14 +58,21 @@ EOM
|
|||
;;
|
||||
|
||||
*)
|
||||
if updates="$(checkupdates)"; then
|
||||
updates="$(checkupdates)"
|
||||
exitcode=$?
|
||||
if [ "$exitcode" = 0 ]; then
|
||||
if [ -n "$updates" ]; then
|
||||
echo "updates.value $(echo "$updates" | wc -l)"
|
||||
echo "updates.extinfo $(echo "$updates" | paste -s -d,)"
|
||||
else
|
||||
echo updates.value 0
|
||||
echo "updates.value 0"
|
||||
fi
|
||||
echo "updates.value U" && exit
|
||||
elif [ "$exitcode" = 2 ]; then
|
||||
# Surprisingly "checkupdates" returns the exitcode 2, if all packages are
|
||||
# up to date.
|
||||
echo "updates.value 0"
|
||||
else
|
||||
echo "updates.value U"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue