This is the mail archive of the gdb-patches@sourceware.org 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]

[RFA] Make contrib/ari/gdb_find.sh script more configurable


    As we were talking about adding 
gdbserver to the list of directories that should
also be inspected by Awk regression scripts,
I propose hereby a patch allowing to include directory
gdbtk, gdbserver or gnulib to the list of inspected directories
by simply exporting a variable named check_XXX_dir
before running the scripts.

  Does this look OK to you?

  Is the ChangeLog entry OK?



Pierre Muller
as ARI maintainer


2012-12-11  Pierre Muller  <muller@sourceware.org>

        * contrib/ari/gdb_find.sh (add_pruned_directory): New function.
        (check_gdbtk_dir, check_gdbserver_dir, check_gnulib_dir): Add
        test for presence of variables to conditionally prune corresponding
        directory.


Index: contrib/ari/gdb_find.sh
===================================================================
RCS file: /cvs/src/src/gdb/contrib/ari/gdb_find.sh,v
retrieving revision 1.5
diff -u -p -r1.5 gdb_find.sh
--- contrib/ari/gdb_find.sh     7 Dec 2012 02:57:49 -0000       1.5
+++ contrib/ari/gdb_find.sh     11 Dec 2012 12:54:56 -0000
@@ -29,11 +29,38 @@ LC_ALL=C ; export LC_ALL
 # A find that prunes files that GDB users shouldn't be interested in.
 # Use sort to order files alphabetically.

-find "$@" \
-    -name testsuite -prune -o \
-    -name gdbserver -prune -o \
-    -name gdbtk -prune -o \
-    -name gnulib -prune -o \
+find_args=
+
+add_pruned_directory ()
+{
+  pruned_dir=$1
+  if [ ! -z "$verbose" ] ; then
+    echo "Adding directory \"$pruned_dir\" to list of pruned directories"
+  fi
+  findargs="$findargs -name $pruned_dir -prune -o "
+}
+
+# Setting environment variables
+# check_gdbtk_dir, check_gdbserver_dir and check_gnulib_dir
+# to non empty will trigger the addition of the files contained
+# in directory gdbtk and gdbserver respectively.
+# By default, these directory are not listed.
+
+if [ -z "$check_gdbtk_dir" ] ; then
+  add_pruned_directory gdbtk
+fi
+
+if [ -z "$check_gdbserver_dir" ] ; then
+  add_pruned_directory gdbserver
+fi
+
+if [ -z "$check_gnulib_dir" ] ; then
+  add_pruned_directory gnulib
+fi
+
+add_pruned_directory testsuite
+
+find "$@" $findargs \
     -name '*-stub.c' -prune -o \
     -name '*-exp.c' -prune -o \
     -name ada-lex.c -prune -o \


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