summary refs log tree commit diff
path: root/xnuxnu
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-09-06 16:46:15 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-09-06 16:46:15 +0200
commitfc3a7b17ee15ffe5815f305ffe625602a1a28951 (patch)
tree1a5a595bd29e67d7823eb214fa01a39241878956 /xnuxnu
parentf8d40b409c4d341be1d7f574ef045f980d05416f (diff)
downloadxtools-fc3a7b17ee15ffe5815f305ffe625602a1a28951.tar.gz
xtools-fc3a7b17ee15ffe5815f305ffe625602a1a28951.tar.xz
xtools-fc3a7b17ee15ffe5815f305ffe625602a1a28951.zip
xnuxnu: check against existing version
Diffstat (limited to 'xnuxnu')
-rwxr-xr-xxnuxnu13
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
+