From 7286ebf4428bca8780d0e83084c47e80636514d8 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 11 Apr 2020 21:50:45 +0000 Subject: kiss-outdated: actually fix printing empty versions, change user notice FossilOrigin-Name: 71f44536fe3cadbe3769b5420aab24c87d5cb308dfb083e1d2e98813b6cc4778 --- contrib/kiss-outdated | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'contrib') diff --git a/contrib/kiss-outdated b/contrib/kiss-outdated index d8d5559..81f64e7 100755 --- a/contrib/kiss-outdated +++ b/contrib/kiss-outdated @@ -5,9 +5,9 @@ old_IFS=$IFS # Notify the user -printf '\033[1;33m-> \033[1;36mNOTE \033[m%s\n' \ - "Sometimes repology can reply with empty strings for a package" \ - "It is a good idea to double check the results." >&2 +printf '\033[1;33m-> \033[1;36mnote \033[m%s\n' \ + "If you are doing too many requests you will note be" \ + "able to get information for every package you have" >&2 # List via arguments or all installed packages. if [ "$1" ]; then @@ -26,17 +26,20 @@ fi # Grab the repology version from the SVG file. rep=$(curl -s "https://repology.org/badge/latest-versions/${fix:-$pkg}.svg") + + # Skip these instead of outputting empty + # version informations. + # shellcheck disable=2106 + case "$rep" in (*'Too Many Requests'*) continue ;; esac + rep=${rep%*} rep=${rep##*>} # Skip these. # shellcheck disable=2106 { - # Sometimes rep becomes whitespace so the - # other check passes. - [ "$rep" ] || continue - [ "$rep" = - ] && continue - [ "$ver" = git ] && continue + [ "${rep:--}" = - ] && continue + [ "$ver" = git ] && continue } # Split the comma separated list. -- cgit v1.2.3