changeset 430:227483dca0b3

1266 check-environment.sh should check for pkg5 build num of 1.1
author Alasdair Lumsden <al@everycity.co.uk>
date Sun, 24 Jul 2011 21:53:01 +0100
parents 47b2d6bede0d
children 278954ef396d
files tools/check-environment.sh
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/tools/check-environment.sh	Sun Jul 24 15:13:52 2011 +0100
+++ b/tools/check-environment.sh	Sun Jul 24 21:53:01 2011 +0100
@@ -61,22 +61,19 @@
 # is pkg the right version?
 check_pkg_ver()
 {
-	ver="`pkg list pkg://openindiana.org/package/pkg | awk \
-		'BEGIN{SKIP=1}(SKIP==1){SKIP=0;next}{print $2}'`"
+	ver="`/usr/bin/pkg list -H pkg:/package/pkg | \
+		/usr/bin/awk '{print $2}' | /usr/bin/sed 's/.*-//g'`"
 	resp="can't determine goodness"
 
-	case "$ver" in
-		0.5.11-0.*)
-			pkgver="`echo $ver | cut -d- -f2 | cut -d. -f2`"
-			;;
-		*)
+	okver=1.1
+	ok=`echo "if ($ver >= $okver) r=1 ; if ($ver < $okver) r=2 ; r" | bc`
+
+	case "$ok" in
+		2)
+			resp="too old"
 			;;
-	esac
-
-	case "$pkgver" in
-		[0-9][0-9][0-9])
-			resp="too old"
-			[ "$pkgver" -ge 151 ] && resp="ok"
+		1)
+			resp="ok"
 			;;
 		*)
 			;;