index : devops | |
Archlinux32 devs' convenience-scripts | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2020-01-14 08:57:07 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-01-14 08:57:07 +0100 |
commit | 90c542991e4aad8924ac6eeccfb87cb7e5c3ee12 (patch) | |
tree | d1a363191bf70b69d9659d6f98797373d98dac7d | |
parent | 2e81aa9cda646d8486d2b3ae2d6158641510abca (diff) |
-rwxr-xr-x | watch-versions | 52 |
diff --git a/watch-versions b/watch-versions index ac42c72..85d16e9 100755 --- a/watch-versions +++ b/watch-versions @@ -95,27 +95,45 @@ case "${pkgbase}" in 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 + # It might be a (slightly modified) copy of an upstream package: + # Then we simply take the upstream pkgver. + newver=$( + for repository in /var/lib/pacman/sync/*.db; do + bsdtar -tf "${repository}" + done \ + | sed ' + s@^'"${pkgbase//./\.}"'-\([^-]\+\)-[0-9.]\+/desc$@\1@ + t + d + ' \ + | sort -V \ + | tail -n1 + ) + if [ -z "${newver}" ]; then + >&2 printf 'Checking the version of package "%s" is not yet implemented!\n' "${pkgbase}" + exit 1 + fi ;; esac -if [ -z "${regex_b}" ]; then - regex_b="${regex}" -fi +if [ -z "${newver}" ]; then + if [ -z "${regex_b}" ]; then + regex_b="${regex}" + fi -newver=$( - curl -LSs "${url}" | \ - sed ' - '"${range}"' s/^.*'"${regex}"'.*$/\1/ - t - '"${range}"' s/^.*'"${regex_b}"'.*$/\1/ - t - d - ' | \ - sort -V | \ - tail -n1 -) + newver=$( + curl -LSs "${url}" | \ + sed ' + '"${range}"' s/^.*'"${regex}"'.*$/\1/ + t + '"${range}"' s/^.*'"${regex_b}"'.*$/\1/ + t + d + ' | \ + sort -V | \ + tail -n1 + ) +fi if [ "${newver}" != "${oldver}" ]; then if ${machine_readable}; then |