index : devops | |
Archlinux32 devs' convenience-scripts | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-12-27 20:30:33 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-12-27 20:30:33 +0100 |
commit | 13944f176d869ff2bbe3296dadc2acc6980e4227 (patch) | |
tree | 50ad3bc5b708d9167a4c3f95f3aced804c77cb4a | |
parent | e97f284a35c12f30d48c45f4a9b09ba73ff3b657 (diff) |
-rwxr-xr-x | watch-versions | 22 |
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 |