From 3f5a30162c0ed12d2167d3f5371f2893777893fb Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 13 Jan 2003 23:07:07 +0000 Subject: [PATCH] 2003-01-13 Andrew Cagney * gdb_indent.sh: Update to version 2.2.9. Warn when not exact version match. --- gdb/ChangeLog | 5 +++++ gdb/gdb_indent.sh | 25 +++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 82d63fd..bfb822e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-01-13 Andrew Cagney + + * gdb_indent.sh: Update to version 2.2.9. Warn when not exact + version match. + 2003-01-13 Daniel Jacobowitz * symtab.c (find_pc_sect_line): Don't consider end-of-function diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh index c47ef95..b266138 100755 --- a/gdb/gdb_indent.sh +++ b/gdb/gdb_indent.sh @@ -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 -- 2.7.4