This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/rfc] Update gdb_indent.sh to version 2.2.9 ...


Hello,

The attached updates the gdb_indent.sh so that it expects gdb_indent.sh version 2.2.9.

- if it encounters an earlier or non 2.2* version, it aborts
- if it encounters a later version, it issues a warning (but continues)

A quick peak at the output indicates that 2.2.9 does change some things. For instance:

Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.20
diff -u -r1.20 main.c
--- main.c 26 Sep 2002 17:46:04 -0000 1.20
+++ main.c 9 Jan 2003 01:37:57 -0000
@@ -207,8 +207,7 @@
/* When var field is 0, use flag field to record the equivalent
short option (or arbitrary numbers starting at 10 for those
with no equivalent). */
- static struct option long_options[] =
- {
+ static struct option long_options[] = {
{"async", no_argument, &event_loop_p, 1},
{"noasync", no_argument, &event_loop_p, 0},
#if defined(TUI)

comments? I'll look to commit in >= 2 days.

Andrew
2003-01-08  Andrew Cagney  <ac131313@redhat.com>

	* gdb_indent.sh: Update to version 2.2.9.  Warn when not exact
	version match.

Index: gdb_indent.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdb_indent.sh,v
retrieving revision 1.4
diff -u -r1.4 gdb_indent.sh
--- gdb_indent.sh	24 Oct 2002 01:37:40 -0000	1.4
+++ gdb_indent.sh	9 Jan 2003 01:37:57 -0000
@@ -36,12 +36,29 @@
 # 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
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]