diff options
Diffstat (limited to 'watch-versions')
-rwxr-xr-x | watch-versions | 22 |
1 files changed, 18 insertions, 4 deletions
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='<a href="\/pypa\/setuptools\/releases\/tag\/v\([0-9.]\+\)">' ;; + *'-dummy') + rem_pkgbase="${pkgbase%-dummy}" + rem_pkgbase="${rem_pkgbase//+/%2B}" + url='https://www.archlinux.org/packages/?q='"${rem_pkgbase}" + range='/^<div id="exact-matches"/,/^<\/div>/' + regex='<td>\([^-<>]\+\)-[0-9]\+<\/td>' + regex_b='<td><span class="flagged">\([^-<>]\+\)-[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 |