aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-11 19:56:20 +0000
committermerakor <cem@ckyln.com>2020-04-11 19:56:20 +0000
commit7e692c85859c2f0e4f90f0317f8d744f658544df (patch)
treebeaa5083cbad54f75c25976c288185f4e0c6e30a
parent95e745453f7026f7a96578cd9a2a01e3eedc4e76 (diff)
downloadcpt-7e692c85859c2f0e4f90f0317f8d744f658544df.tar.gz
kiss-outdated: fix printing empty version information
FossilOrigin-Name: 45e90f7bd5c55e9128c89738f68ded2633742647a98c916ce5c951c3e52d41a9
-rwxr-xr-xcontrib/kiss-outdated12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/kiss-outdated b/contrib/kiss-outdated
index db2b421..d8d5559 100755
--- a/contrib/kiss-outdated
+++ b/contrib/kiss-outdated
@@ -4,6 +4,11 @@
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
+
# List via arguments or all installed packages.
if [ "$1" ]; then
set -- printf '%s\n' "$@"
@@ -27,8 +32,11 @@ fi
# Skip these.
# shellcheck disable=2106
{
- [ "${rep:--}" = - ] && continue
- [ "$ver" = git ] && continue
+ # Sometimes rep becomes whitespace so the
+ # other check passes.
+ [ "$rep" ] || continue
+ [ "$rep" = - ] && continue
+ [ "$ver" = git ] && continue
}
# Split the comma separated list.