[tapx-dev] [commit] [157] Our version of prove now handles directories containing circular

andy at hexten.net andy at hexten.net
Sun Mar 18 18:16:22 GMT 2007


Revision: 157
Author:   andy
Date:     2007-03-18 18:16:22 +0000 (Sun, 18 Mar 2007)

Log Message:
-----------
Our version of prove now handles directories containing circular
links correctly [21938]

Modified Paths:
--------------
    trunk/Changes
    trunk/TH_TODO
    trunk/bin/prove

Modified: trunk/Changes
===================================================================
--- trunk/Changes	2007-03-18 17:56:41 UTC (rev 156)
+++ trunk/Changes	2007-03-18 18:16:22 UTC (rev 157)
@@ -54,6 +54,8 @@
     - Added libs and switches handling to T::H::Compatible. This and the
       previous change fix [24926]
     - Added PERLLIB to libraries stripped in _default_inc [12030]
+    - Our version of prove now handles directories containing circular
+      links correctly [21938]
       
 0.51 12 March 2007
     - 'execrc' file now allows 'regex' matches for tests.

Modified: trunk/TH_TODO
===================================================================
--- trunk/TH_TODO	2007-03-18 17:56:41 UTC (rev 156)
+++ trunk/TH_TODO	2007-03-18 18:16:22 UTC (rev 157)
@@ -10,7 +10,6 @@
 
 Need investigation:
 
-- [ ] 21938   Unable to handle circular links new     5 months ago        
 - [ ] 21063   forked processes from test scripts cause hang   new Normal 7
   months ago    2.63_02
 - [ ] 20688   HARNESS_PERL gets @INC wrong    new Normal 8 months ago        
@@ -76,6 +75,7 @@
 
 Fixed:
 
+- [*] 21938   Unable to handle circular links new     5 months ago        
 - [*] 12030   Test::Harness should propogate $PERLLIB in the same way it does
   $PERL5LIB should $PERL5LIB be unset open    Critical 5 months ago    2.46
 - [*] 24926   prove -b and -l should use absolute paths   new Important 4

Modified: trunk/bin/prove
===================================================================
--- trunk/bin/prove	2007-03-18 17:56:41 UTC (rev 156)
+++ trunk/bin/prove	2007-03-18 18:16:22 UTC (rev 157)
@@ -114,8 +114,9 @@
 }
 
 sub all_in {
-    my $parms = shift;
-    my %parms = (
+    my $parms   = shift;
+    my $visited = shift || {};
+    my %parms   = (
         start   => ".",
         recurse => 1,
         %$parms,
@@ -134,8 +135,12 @@
             next if $file eq "CVS";
 
             my $currfile = File::Spec->catfile( $start, $file );
+
             if ( -d $currfile ) {
-                push( @hits, all_in( { %parms, start => $currfile } ) )
+                my ( $dev, $ino ) = lstat $currfile;
+                next if $dev && $visited->{ $dev, $ino }++;
+                push( @hits,
+                    all_in( { %parms, start => $currfile }, $visited ) )
                   if $parms{recurse};
             }
             else {




More information about the tapx-dev mailing list