kiss-outdated: Show packages from repositories instead of installed.
This commit is contained in:
parent
cffaaa63a0
commit
a1b28dbb56
|
@ -3,21 +3,24 @@
|
||||||
|
|
||||||
old_IFS=$IFS
|
old_IFS=$IFS
|
||||||
|
|
||||||
# List via arguments or all installed packages.
|
kiss s "${@:-*}" | (while read -r pkg_loc _; do {
|
||||||
if [ "$1" ]; then
|
read -r ver _ < "$pkg_loc/version"
|
||||||
set -- printf '%s\n' "$@"
|
|
||||||
else
|
|
||||||
set -- kiss l
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$@" | (while read -r pkg _; do {
|
pkg=${pkg_loc##*/}
|
||||||
read -r ver _ < "/var/db/kiss/installed/$pkg/version"
|
|
||||||
|
|
||||||
# Fix some package names.
|
# Fix some package names.
|
||||||
case $pkg in
|
case $pkg in
|
||||||
*-bin) fix=${pkg%%-bin} ;;
|
*-bin) fix=${pkg%%-bin} ;;
|
||||||
|
*[0-9]r) fix=${pkg%%r} ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Ignore duplicates.
|
||||||
|
# shellcheck disable=2106
|
||||||
|
case $seen in
|
||||||
|
*" ${fix:-$pkg} "*) continue ;;
|
||||||
|
*) seen=" $seen ${fix:-$pkg} " ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Grab the repology version from the SVG file.
|
# Grab the repology version from the SVG file.
|
||||||
rep=$(curl -s "https://repology.org/badge/latest-versions/${fix:-$pkg}.svg")
|
rep=$(curl -s "https://repology.org/badge/latest-versions/${fix:-$pkg}.svg")
|
||||||
rep=${rep%</text>*}
|
rep=${rep%</text>*}
|
||||||
|
|
Loading…
Reference in New Issue