From 13944f176d869ff2bbe3296dadc2acc6980e4227 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 27 Dec 2019 20:30:33 +0100 Subject: watch-versions: learn *-dummy packages --- watch-versions | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'watch-versions') diff --git a/watch-versions b/watch-versions index 9f8c920..3fd9f11 100755 --- a/watch-versions +++ b/watch-versions @@ -90,18 +90,32 @@ case "${pkgbase}" in url='https://github.com/pypa/setuptools/releases' regex='' ;; + *'-dummy') + rem_pkgbase="${pkgbase%-dummy}" + rem_pkgbase="${rem_pkgbase//+/%2B}" + url='https://www.archlinux.org/packages/?q='"${rem_pkgbase}" + range='/^
/' + regex='\([^-<>]\+\)-[0-9]\+<\/td>' + regex_b='\([^-<>]\+\)-[0-9]\+<\/span><\/td>' + ;; *) >&2 printf 'Checking the version of package "%s" is not yet implemented!\n' "${pkgbase}" exit 1 ;; esac +if [ -z "${regex_b}" ]; then + regex_b="${regex}" +fi + newver=$( curl -LSs "${url}" | \ - sed -n ' - s/^.*'"${regex}"'.*$/\1/ - T - p + sed ' + '"${range}"' s/^.*'"${regex}"'.*$/\1/ + t + '"${range}"' s/^.*'"${regex_b}"'.*$/\1/ + t + d ' | \ sort -V | \ tail -n1 -- cgit v1.2.3-70-g09d2