cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 9358fb337b5f4177e31d5107d2236e049a3552d8
parent 792893530b970e90fb0e5660f75af9993795e305
Author: Cem Keylan <cem@ckyln.com>
Date:   Sun, 12 Apr 2020 00:50:45 +0300

kiss-outdated: actually fix printing empty versions, change user notice

Diffstat:
Mcontrib/kiss-outdated | 19+++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)

diff --git 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.