* lib/utils.exp (prune): Restore this proc.
authorBen Elliston <bje@gnu.org>
Wed, 24 Feb 2016 04:04:57 +0000 (15:04 +1100)
committerBen Elliston <bje@gnu.org>
Wed, 24 Feb 2016 04:04:57 +0000 (15:04 +1100)
* doc/ref.xml: Update documentation.
* doc/dejagnu.texi: Regenerate.
* NEWS: Update.

This reverts commit 992fbc3a8f03c3cd5e554eea5361f1a531e9e71f.

ChangeLog
NEWS
doc/dejagnu.texi
doc/ref.xml
lib/utils.exp

index 7bca566..2ca2041 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-24  Ben Elliston  <bje@gnu.org>
+
+       * lib/utils.exp (prune): Restore this proc.
+       * doc/ref.xml: Update documentation.
+       * doc/dejagnu.texi: Regenerate.
+       * NEWS: Update.
+
 2016-02-23  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * lib/libgloss.exp (find_gdc): New proc.
diff --git a/NEWS b/NEWS
index 3387ab1..1d3f672 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,8 @@ Changes since 1.5.3:
    2 if an exception is raised by the Tcl interpreter.
 3. runtest now exits with the standard exit codes of programs that are
    terminated by the SIGINT, SIGTERM and SIGQUIT signals.
-4. The user-visible utility procedures `absolute', `prune', `psource'
-   and `slay' have been removed.  If a testsuite uses any of these
+4. The user-visible utility procedures `absolute', `psource' and
+   `slay' have been removed.  If a testsuite uses any of these
    procedures, a copy of the procedure should be made and placed in
    the lib directory of the testsuite.
 5. Support was added for testing the D compiler.
index bff10cf..99dd8f1 100644 (file)
@@ -5412,6 +5412,7 @@ tool, and its version number.
 * Find Procedure: find procedure.
 * Which Procedure: which procedure.
 * Grep Procedure: grep procedure.
+* Prune Procedure: prune procedure.
 * Runtest_file_p Procedure: runtest_file_p procedure.
 * Diff Procedure: diff procedure.
 * Setenv Procedure: setenv procedure.
@@ -5498,7 +5499,7 @@ The executable program or shell script to look
 for.
 @end table
 
-@node grep procedure, runtest_file_p procedure, which procedure, Utility Procedures
+@node grep procedure, prune procedure, which procedure, Utility Procedures
 @subsubsection Grep Procedure
 
 Search the file called @file{filename} (a fully
@@ -5535,7 +5536,15 @@ Prefix the line number to each line where the
 regexp matches.
 @end table
 
-@node runtest_file_p procedure, diff procedure, grep procedure, Utility Procedures
+@node prune procedure, runtest_file_p procedure, grep procedure, Utility Procedures
+@subsubsection Prune Procedure
+
+This procedure is deprecated and will be removed in
+the next release of DejaGnu.  If a testsuite uses this
+procedure, a copy of the procedure should be made and placed
+in the lib directory of the testsuite.
+
+@node runtest_file_p procedure, diff procedure, prune procedure, Utility Procedures
 @subsubsection Runtest_file_p Procedure
 
 Search @emph{runtest}s for
index b1329e0..05013ae 100644 (file)
        </variablelist>
        </sect4>
 
+       <sect4 id="prune" xreflabel="prune procedure">
+         <title>Prune Procedure</title>
+         <para>This procedure is deprecated and will be removed in
+         the next release of &dj;.  If a testsuite uses this
+         procedure, a copy of the procedure should be made and placed
+         in the lib directory of the testsuite.</para>
+       </sect4>
+
        <sect4 id="runtestfilep" xreflabel="runtest_file_p procedure">
          <title>Runtest_file_p Procedure</title>
 
index 314fc2f..acad5bd 100644 (file)
@@ -203,6 +203,25 @@ proc grep { args } {
     return $grep_out
 }
 
+#
+# Remove elements based on patterns. elements are delimited by spaces.
+# pattern is the pattern to look for using glob style matching
+# list is the list to check against
+# returns the new list
+#
+proc prune { list pattern } {
+    set tmp {}
+    foreach i $list {
+       verbose "Checking pattern \"$pattern\" against $i" 3
+       if {![string match $pattern $i]} {
+           lappend tmp $i
+       } else {
+           verbose "Removing element $i from list" 3
+       }
+    }
+    return $tmp
+}
+
 
 # Check if a testcase should be run or not
 #