diff options
Diffstat (limited to 'xnuxnu')
-rwxr-xr-x | xnuxnu | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xnuxnu b/xnuxnu index aaf0105..9654c94 100755 --- a/xnuxnu +++ b/xnuxnu @@ -2,11 +2,14 @@ # xnuxnu - upstream version checker for XBPS templates pkgname=$1 +orig_pkgname=$pkgname IFS=' ' export LC_ALL=C +void_version=$(./xbps-src show "$1" | sed -n '/version/s/[^:]*:[\t]*//p') + ./xbps-src show "$1" | sed -n '/distfiles:/{s/[^:]*:[\t]*//;s|/[^/]*$|/|p}; /Upstream URL/s/[^:]*:[\t]*//p' | @@ -23,8 +26,16 @@ export LC_ALL=C rx='"name":\s*"\K[^\d]*([\d\.]+)(?=")';; esac - echo "fetching $url" 2>/dev/null + echo "fetching $url" 1>&2 curl -A xnuxnu -Ls $url | grep -Po -i "$rx" | sort -Vu + done | + { tee /dev/stderr | grep . || echo "NO VERSION found for $orig_pkgname" 1>&2; } | + while read version; do + xbps-uhelper cmpver "$orig_pkgname-${void_version}_1" "$orig_pkgname-${version}_1" + if [ $? = 255 ]; then + echo "NEWER VERSION $orig_pkgname-$version (have $orig_pkgname-${void_version})" + fi done + |