hi all...

this small patch gives us an ownership tally in t/REPORT.  the result looks
like this if I run the tests as root.

2. Used Components and their Configuration:

*** this report run as geoff (uid 500)

*** file ownership tally:
      geoff: 5692 files
      nobody: 2897 files
      root: 12 files

*** mod_perl version 1.999021

under normal circumstances I get

*** file ownership tally:
      geoff: 8600 files
      root: 1 files

anyway, I'm not sure if it will actually help diagnose things, but it might
be useful someday...

thoughts?

--Geoff
Index: lib/ModPerl/Config.pm
===================================================================
--- lib/ModPerl/Config.pm	(revision 125949)
+++ lib/ModPerl/Config.pm	(working copy)
@@ -19,6 +19,8 @@
 use Apache::Build ();
 use Apache::TestConfig ();
 use File::Spec ();
+use File::Find ();
+use Cwd qw(getcwd);
 
 use constant WIN32 => Apache::Build::WIN32;
 
@@ -27,6 +29,22 @@
 
     my $cfg = '';
 
+    $cfg .= "*** this report run as " . (getpwuid $<)[0] . " (uid $<)\n\n";
+
+    my %files = ();
+    File::Find::find(sub {
+        my $owner = (getpwuid((stat)[4]))[0];
+        $files{$owner}++;
+    }, getcwd);
+
+    if (keys %files > 1) {
+        $cfg .= "*** file ownership tally:\n";
+        foreach my $key (sort keys %files) {
+            $cfg .= "      $key: $files{$key} files\n";
+        }
+        $cfg .= "\n";
+    }
+
     $cfg .= "*** mod_perl version $mod_perl::VERSION\n\n";;
 
     my $file = File::Spec->rel2abs($INC{'Apache/BuildConfig.pm'});

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to