2003-01-13 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Mon, 13 Jan 2003 23:07:07 +0000 (23:07 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 13 Jan 2003 23:07:07 +0000 (23:07 +0000)
* gdb_indent.sh: Update to version 2.2.9.  Warn when not exact
version match.

gdb/ChangeLog
gdb/gdb_indent.sh

index 82d63fd..bfb822e 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-13  Andrew Cagney  <ac131313@redhat.com>
+
+       * gdb_indent.sh: Update to version 2.2.9.  Warn when not exact
+       version match.
+
 2003-01-13  Daniel Jacobowitz  <drow@mvista.com>
 
        * symtab.c (find_pc_sect_line): Don't consider end-of-function
index c47ef95..b266138 100755 (executable)
@@ -36,12 +36,29 @@ fi
 # Check that the indent found is both GNU and a reasonable version.
 # Different indent versions give different indentation.
 
-case `${indent} --version 2>/dev/null < /dev/null` in
-    GNU*2.2* ) ;;
-    *GNU* ) echo "Incorrect version of GNU indent" 1>&2 ;;
-    * ) echo "Indent is not GNU" 1>&2 ;;
+m1=2
+m2=2
+m3=9
+
+version=`${indent} --version 2>/dev/null < /dev/null`
+case "${version}" in
+    *GNU* ) ;;
+    * ) echo "error: GNU indent $m1.$m2.$m3 expected" 1>&2 ; exit 1;;
 esac
+v1=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\1/'`
+v2=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\2/'`
+v3=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3/'`
+
+if test $m1 -ne $v1 -o $m2 -ne $v2 -o $m3 -gt $v3
+then
+    echo "error: Must be GNU indent version $m1.$m2.$m3 or later" 1>&2
+    exit 1
+fi
 
+if test $m3 -ne $v3
+then
+    echo "warning: GNU indent version $m1.$m2.$m3 recommended" 1>&2
+fi
 
 # Check that we're in the GDB source directory