summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwatch-versions52
1 files changed, 35 insertions, 17 deletions
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