diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-13 23:07:07 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-13 23:07:07 +0000 |
commit | 000eddc39b8d3711b2f1853bf578794ff49e6eda (patch) | |
tree | 8f35be8910e15e55983906db1c4fe6b4c943ccfe /gdb/gdb_indent.sh | |
parent | 12a8812ad26a95f581b9100b741ad8824c0a8f81 (diff) | |
download | gdb-000eddc39b8d3711b2f1853bf578794ff49e6eda.tar.gz |
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* gdb_indent.sh: Update to version 2.2.9. Warn when not exact
version match.
Diffstat (limited to 'gdb/gdb_indent.sh')
-rwxr-xr-x | gdb/gdb_indent.sh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh index c47ef95828d..b2661380a35 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 |