httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [Fwd: Re: Modperl 2.0 Not finding correct *.conf]
Date Wed, 14 Jan 2004 23:24:23 GMT
any objections for this patch?

-------- Original Message --------
Subject: Re: Modperl 2.0 Not finding correct *.conf
Date: Sun, 11 Jan 2004 14:13:42 -0800
From: Stas Bekman <stas@stason.org>
Organization: Hope, Humanized
CC: steve larson <expedite_now@yahoo.com>,	mod_perl Mailing List 
<modperl@perl.apache.org>
References: <20040110205654.85724.qmail@web40706.mail.yahoo.com> 
<4001B820.20300@stason.org>

Stas Bekman wrote:
> steve larson wrote:
> 
>> Hello,
>> ulimit -c unlimited; t/TEST -conf
>> *** file /etc/httpd/conf.d/*.conf does not exist
>>  make test produced error, looking for
>> /etc/httpd/*.conf 
> 
> it's a warning, not an error. It'd have died if it was an error. I can 
> see where the problem is, I'll fix that soonish. It's unrelated to the 
> problem preventing you from running the test suite.

Please try this patch:

Index: lib/Apache/TestConfigParse.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigParse.pm,v
retrieving revision 1.41
diff -u -r1.41 TestConfigParse.pm
--- lib/Apache/TestConfigParse.pm       9 Dec 2003 14:53:58 -0000       1.41
+++ lib/Apache/TestConfigParse.pm       11 Jan 2004 21:59:59 -0000
@@ -9,7 +9,7 @@
  use Apache::TestTrace;

  use File::Spec::Functions qw(rel2abs splitdir file_name_is_absolute);
-use File::Basename qw(basename);
+use File::Basename qw(dirname basename);

  sub strip_quotes {
      local $_ = shift || $_;
@@ -43,7 +43,8 @@
      $self->$where($directive => $val);
  }

-#resolve relative files like Apache->server_root_relative
+# resolve relative files like Apache->server_root_relative
+# this function doesn't test whether the resolved file exists
  sub server_file_rel2abs {
      my($self, $file, $base) = @_;

@@ -87,14 +88,20 @@
              # return early, skipping file test below
              return $file;
          }
-
      }

-    if (-e $result) {
-        debug "$file successfully resolved to existing file $result";
+    my $dir = dirname $result;
+    # $file might not exist (e.g. if it's a glob pattern like
+    # "conf/*.conf" but what we care about here is to check whether
+    # the base dir was successfully resolved. we don't check whether
+    # the file exists at all. it's the responsibility of the caller to
+    # do this check
+    if (defined $dir && -e $dir && -d _) {
+        debug "$file successfully resolved to $result";
      }
      else {
-        warning "file $result does not exist";
+        $dir ||= '';
+        warning "dir '$dir' does not exist (while resolving '$file')";

          # old behavior was to return the resolved but non-existent
          # file.  preserve that behavior and return $result anyway.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message