aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-11 21:50:45 +0000
committermerakor <cem@ckyln.com>2020-04-11 21:50:45 +0000
commit7286ebf4428bca8780d0e83084c47e80636514d8 (patch)
tree7ac1788b521de8c34b794e0040864594d5520f22
parent7e692c85859c2f0e4f90f0317f8d744f658544df (diff)
downloadcpt-7286ebf4428bca8780d0e83084c47e80636514d8.tar.gz
kiss-outdated: actually fix printing empty versions, change user notice
FossilOrigin-Name: 71f44536fe3cadbe3769b5420aab24c87d5cb308dfb083e1d2e98813b6cc4778
-rwxr-xr-xcontrib/kiss-outdated19
1 files changed, 11 insertions, 8 deletions
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%</text>*}
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.