blob: 6e138340ba1948e8b52b7bb13234d05ed0747dcc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/bin/sh
# 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' |
while read url; do
rx="\b$pkgname[-_]?((src|source)[-_])?\K([^-/_\s]*?\d[^-/_\s]*?)(?=(?:[-_.](?:src|source|orig))?\.(?:[jt]ar|t[bglx]z|tbz2|zip))\b"
case "$url" in
*sourceforge.net/sourceforge*)
url="http://sourceforge.net/projects/$pkgname/rss?limit=200";;
*code.google.com*|*googlecode*)
url="http://code.google.com/p/$pkgname/downloads/list";;
*cpan.*)
pkgname=${pkgname#perl-};;
*github.com*)
githubname="$(echo $url | cut -d/ -f4,5)"
url="https://api.github.com/repos/$githubname/tags"
rx='"name":\s*"\K[^\d]*([\d\.]+)(?=")';;
esac
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
|