2020-03-03 15:49:04 -07:00
|
|
|
#!/bin/sh
|
2020-11-05 23:29:09 -07:00
|
|
|
# Check repository for outdated packages
|
2020-03-03 15:49:04 -07:00
|
|
|
|
2021-09-06 03:10:15 -06:00
|
|
|
die() {
|
|
|
|
printf '%s\n' "$*" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
2020-09-23 05:01:35 -06:00
|
|
|
|
2021-09-06 03:10:15 -06:00
|
|
|
mkcd() {
|
|
|
|
mkdir -p "$1" && cd "$1"
|
2020-11-05 23:29:09 -07:00
|
|
|
}
|
2020-09-23 05:01:35 -06:00
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
repology_name() {
|
|
|
|
# Fix any known naming inconsistences between packages and Repology.
|
|
|
|
remote=$(
|
|
|
|
# Strip unrelated suffixes.
|
|
|
|
remote=${1%%-bin}
|
|
|
|
remote=${remote%%-git}
|
2020-03-03 15:49:04 -07:00
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
# Remote names are all lowercase.
|
2021-09-06 03:25:09 -06:00
|
|
|
tr '[:upper:]' '[:lower:]' <<EOF |
|
|
|
|
$remote
|
|
|
|
EOF
|
2020-11-05 23:29:09 -07:00
|
|
|
# Remote always uses -.
|
|
|
|
tr _ -
|
|
|
|
)
|
|
|
|
|
|
|
|
case $remote in
|
2022-09-09 05:36:37 -06:00
|
|
|
age)
|
|
|
|
remote=age-encryption
|
|
|
|
;;
|
|
|
|
|
2021-07-19 03:45:52 -06:00
|
|
|
baseinit|baselayout|kiss)
|
|
|
|
remote=-
|
2020-11-05 23:29:09 -07:00
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
|
|
|
|
bat)
|
|
|
|
remote=bat-cat
|
|
|
|
;;
|
|
|
|
|
2021-07-01 07:00:35 -06:00
|
|
|
clang)
|
|
|
|
remote=llvm
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
ctags)
|
2022-09-21 06:07:41 -06:00
|
|
|
remote=exuberant-ctags
|
2022-09-09 05:36:37 -06:00
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
dash)
|
|
|
|
remote=dash-shell
|
|
|
|
;;
|
|
|
|
|
|
|
|
dejavu-ttf)
|
|
|
|
remote=fonts:dejavu
|
|
|
|
;;
|
|
|
|
|
|
|
|
dsp)
|
|
|
|
remote=dsp-audio-processing
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
dust)
|
|
|
|
remote=du-dust
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
emacs-nox)
|
|
|
|
# TODO [community]: Make default emacs no x11?
|
|
|
|
remote=emacs
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
go-ipfs)
|
|
|
|
remote=ipfs
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
fd)
|
|
|
|
remote=fd-find
|
|
|
|
;;
|
|
|
|
|
2023-03-01 02:00:44 -07:00
|
|
|
fdm)
|
|
|
|
remote=fdm-email-fetcher
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
fetsh)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=fet.sh
|
|
|
|
;;
|
|
|
|
|
|
|
|
firefox-esr)
|
|
|
|
remote=firefox
|
|
|
|
;;
|
|
|
|
|
|
|
|
font-awesome-ttf)
|
|
|
|
remote=fonts:fontawesome
|
|
|
|
;;
|
|
|
|
|
2021-09-06 03:39:07 -06:00
|
|
|
foot-pgo)
|
|
|
|
remote=foot
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
gc)
|
|
|
|
remote=boehm-gc
|
|
|
|
;;
|
|
|
|
|
|
|
|
gnugrep)
|
|
|
|
# shell-check is dumb here so this must be quoted.
|
|
|
|
remote='grep'
|
|
|
|
;;
|
|
|
|
|
|
|
|
gnupg[12])
|
|
|
|
# Reported to repology.org.
|
|
|
|
# https://github.com/repology/repology-rules/issues/285
|
|
|
|
remote=gnupg
|
|
|
|
;;
|
|
|
|
|
2021-07-03 09:57:09 -06:00
|
|
|
gtk+3)
|
2022-12-28 03:00:23 -07:00
|
|
|
remote=gtk3-classic
|
2020-11-05 23:29:09 -07:00
|
|
|
;;
|
|
|
|
|
|
|
|
gst-*)
|
|
|
|
remote=gstreamer:${remote##*-}
|
|
|
|
;;
|
|
|
|
|
|
|
|
gtar)
|
|
|
|
remote=tar
|
|
|
|
;;
|
|
|
|
|
2021-07-19 03:45:52 -06:00
|
|
|
eiwd)
|
|
|
|
remote=iwd
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
hack)
|
|
|
|
# It might be nice to adopt Repology's naming scheme for
|
|
|
|
# fonts as it also makes them self-documenting and easy
|
|
|
|
# to search for ('kiss s font:\*).
|
|
|
|
remote=fonts:hack
|
|
|
|
;;
|
|
|
|
|
|
|
|
harfbuzz-icu)
|
|
|
|
# TODO: Report to repology.org?
|
|
|
|
# Package split.
|
|
|
|
remote=harfbuzz
|
|
|
|
;;
|
|
|
|
|
2021-07-19 03:49:31 -06:00
|
|
|
libelf)
|
|
|
|
remote=elfutils
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
liberation-fonts)
|
|
|
|
remote=fonts:liberation
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
libjpeg)
|
|
|
|
remote=ijg-libjpeg
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
libmupdf | libxaw3d)
|
|
|
|
# TODO [community]: Rename packages?
|
|
|
|
remote=${remote##lib}
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
libnghttp2)
|
|
|
|
remote=nghttp2
|
|
|
|
;;
|
|
|
|
|
|
|
|
libportaudio2)
|
|
|
|
remote=portaudio
|
|
|
|
;;
|
|
|
|
|
2021-11-07 07:33:27 -07:00
|
|
|
libseat)
|
|
|
|
remote=seatd
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
libzmq)
|
|
|
|
remote=zeromq
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
links2)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=links
|
|
|
|
;;
|
|
|
|
|
2021-07-03 05:26:44 -06:00
|
|
|
linux-headers)
|
|
|
|
remote=linux
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
lpeg)
|
|
|
|
remote=lua:lpeg
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
lux)
|
|
|
|
remote=lux-brightness-ventto
|
|
|
|
;;
|
|
|
|
|
|
|
|
man-pages)
|
|
|
|
# TODO: Report to repology.org.
|
|
|
|
# man-pages -> manpages
|
|
|
|
# man-pages-posix -> man-pages-posix
|
|
|
|
remote=manpages
|
|
|
|
;;
|
2020-09-23 02:51:19 -06:00
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
netsurf-fb)
|
|
|
|
remote=netsurf
|
|
|
|
;;
|
2020-03-03 15:49:04 -07:00
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
noto-emoji)
|
|
|
|
remote=fonts:noto-emoji
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
openjpeg2)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=openjpeg
|
|
|
|
;;
|
|
|
|
|
|
|
|
osh)
|
|
|
|
remote=oil-shell
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
pass)
|
|
|
|
remote=password-store
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
pinentry-dmenu)
|
|
|
|
remote=pinentry-dmenu-cemkeylan
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
pybind11)
|
|
|
|
remote=python:pybind11
|
|
|
|
;;
|
|
|
|
|
|
|
|
python-psutil)
|
|
|
|
remote=python:psutil
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
pyqt5)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=python-qt
|
|
|
|
;;
|
|
|
|
|
|
|
|
python2)
|
|
|
|
remote=python
|
|
|
|
;;
|
|
|
|
|
2023-01-03 06:07:56 -07:00
|
|
|
python-docutils)
|
|
|
|
remote=python:docutils
|
|
|
|
;;
|
|
|
|
|
|
|
|
python-mako)
|
|
|
|
remote=python:mako
|
|
|
|
;;
|
|
|
|
|
|
|
|
python-markupsafe)
|
|
|
|
remote=python:markupsafe
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
qt5*)
|
|
|
|
remote=qt
|
|
|
|
;;
|
|
|
|
|
|
|
|
rage)
|
2022-09-09 05:36:37 -06:00
|
|
|
remote=rage-encryption
|
2020-11-05 23:29:09 -07:00
|
|
|
;;
|
|
|
|
|
|
|
|
sane)
|
|
|
|
remote=sane-backends
|
|
|
|
;;
|
|
|
|
|
|
|
|
spleen-font)
|
|
|
|
remote=fonts:spleen
|
|
|
|
;;
|
|
|
|
|
|
|
|
sshfs)
|
|
|
|
remote=fusefs:sshfs
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
slides)
|
|
|
|
remote=slides-presentation-tool
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
surf)
|
|
|
|
remote=surf-browser
|
|
|
|
;;
|
|
|
|
|
|
|
|
st)
|
|
|
|
remote=st-term
|
|
|
|
;;
|
|
|
|
|
2021-09-06 03:39:07 -06:00
|
|
|
sway-no-seat | sway-tiny)
|
|
|
|
remote=sway
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
tea)
|
|
|
|
remote=gitea-tea
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
terminus-font)
|
|
|
|
remote=fonts:terminus
|
|
|
|
;;
|
|
|
|
|
|
|
|
tiv)
|
2022-09-09 05:36:37 -06:00
|
|
|
remote=tiv-terminalimageviewer
|
|
|
|
;;
|
|
|
|
|
|
|
|
tree)
|
|
|
|
remote=tree-steve-baker
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttf-font-awesome)
|
|
|
|
remote=font-awesome6
|
2020-11-05 23:29:09 -07:00
|
|
|
;;
|
|
|
|
|
|
|
|
unifont)
|
|
|
|
remote=fonts:unifont
|
|
|
|
;;
|
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
vis)
|
|
|
|
remote=vis-editor
|
|
|
|
;;
|
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
webkit2gtk)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=webkitgtk
|
|
|
|
;;
|
|
|
|
|
|
|
|
xf86-*)
|
|
|
|
remote=xdrv:${remote##*-}
|
|
|
|
;;
|
|
|
|
|
|
|
|
xmlsec1)
|
|
|
|
# TODO [community]: Rename package?
|
|
|
|
remote=xmlsec
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2021-09-06 03:39:07 -06:00
|
|
|
repology_version() {
|
|
|
|
[ -f "$1.svg" ] || return 1
|
|
|
|
read -r remote_ver < "$1.svg" || :
|
|
|
|
remote_ver=${remote_ver%</text>*}
|
|
|
|
remote_ver=${remote_ver##*>}
|
|
|
|
}
|
|
|
|
|
|
|
|
repo_version() {
|
|
|
|
read -r ver _ 2>/dev/null < "$2/version" || {
|
|
|
|
printf '%-30s local version not found\n' "$1" >&2
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
[ "$ver" != git ]
|
|
|
|
}
|
|
|
|
|
|
|
|
get_outdated() {
|
2022-10-21 01:50:35 -06:00
|
|
|
repo=${PWD%%/}
|
2021-09-06 03:10:15 -06:00
|
|
|
printf '\n[Checking Repology for outdated packages in %s]\n\n' "$repo" >&2
|
2020-09-23 03:34:49 -06:00
|
|
|
|
2020-11-05 23:29:09 -07:00
|
|
|
for pkg in */; do
|
|
|
|
pkg=${pkg%%/}
|
2021-09-06 03:10:15 -06:00
|
|
|
repology_name "${pkg##*/}"
|
2020-11-05 23:29:09 -07:00
|
|
|
|
2021-09-06 03:39:07 -06:00
|
|
|
[ "$remote" = - ] ||
|
|
|
|
set -- "$@" -z "$remote.svg" \
|
|
|
|
"https://repology.org/badge/latest-versions/$remote.svg"
|
2021-09-06 03:10:15 -06:00
|
|
|
done
|
|
|
|
|
|
|
|
mkcd "$tmp/${repo##*/}"
|
|
|
|
|
|
|
|
curl -SsZ --parallel-max 16 --remote-name-all "$@" ||
|
|
|
|
die 'fatal: network error'
|
|
|
|
|
|
|
|
for _pkg in "$OLDPWD"/*/; do
|
|
|
|
pkg=${_pkg%%/}
|
|
|
|
pkg=${pkg##*/}
|
|
|
|
|
2021-09-06 03:39:07 -06:00
|
|
|
repo_version "$pkg" "$_pkg" || continue
|
2021-09-06 03:10:15 -06:00
|
|
|
repology_name "$pkg"
|
2021-09-06 03:39:07 -06:00
|
|
|
repology_version "$remote" || continue
|
2020-11-05 23:29:09 -07:00
|
|
|
|
2022-09-09 05:36:37 -06:00
|
|
|
case $remote_ver in
|
|
|
|
*", $ver"* | *"$ver,"* | "$ver" | '') continue ;;
|
|
|
|
-) printf '%-30s no remote version found\n' "$pkg" >&2; continue ;;
|
2020-11-05 23:29:09 -07:00
|
|
|
esac
|
2021-09-06 03:10:15 -06:00
|
|
|
|
|
|
|
printf '%-30s %s -> %s\n' "$pkg" "$ver" "$remote_ver"
|
2020-11-05 23:29:09 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-09-06 03:10:15 -06:00
|
|
|
main() {
|
|
|
|
set -e
|
2021-07-17 23:37:01 -06:00
|
|
|
|
2023-01-20 00:52:57 -07:00
|
|
|
[ "$1" ] || set -- "$PWD"
|
2021-09-06 03:10:15 -06:00
|
|
|
|
|
|
|
mkdir -p "${tmp:=${XDG_CACHE_HOME:-"$HOME/.cache"}/kiss/repology}"
|
|
|
|
|
|
|
|
for repo do
|
|
|
|
old_pwd=$PWD
|
|
|
|
cd "$repo"
|
2021-09-06 03:39:07 -06:00
|
|
|
get_outdated
|
2021-09-06 03:10:15 -06:00
|
|
|
cd "$old_pwd"
|
|
|
|
done
|
|
|
|
}
|
2021-07-17 23:37:01 -06:00
|
|
|
|
2021-09-06 03:10:15 -06:00
|
|
|
main "$@"
|