Author: stas Date: Tue May 10 19:07:52 2005 New Revision: 169552 URL: http://svn.apache.org/viewcvs?rev=169552&view=rev Log: prevent undef warnings in catfile() calls in Apache2::Build when called from the ModPerl-Registry tree
Modified: perl/modperl/trunk/Changes perl/modperl/trunk/lib/Apache2/Build.pm Modified: perl/modperl/trunk/Changes URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?rev=169552&r1=169551&r2=169552&view=diff ============================================================================== --- perl/modperl/trunk/Changes (original) +++ perl/modperl/trunk/Changes Tue May 10 19:07:52 2005 @@ -12,6 +12,9 @@ =item 1.999_24-dev +prevent undef warnings in catfile() calls in Apache2::Build when +called from the ModPerl-Registry tree [Stas] + fix modperl_brigade_dump to use apr_file_printf() instead of fprintf(), which doesn't work everywhere [Stas] Modified: perl/modperl/trunk/lib/Apache2/Build.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/Apache2/Build.pm?rev=169552&r1=169551&r2=169552&view=diff ============================================================================== --- perl/modperl/trunk/lib/Apache2/Build.pm (original) +++ perl/modperl/trunk/lib/Apache2/Build.pm Tue May 10 19:07:52 2005 @@ -109,11 +109,12 @@ my $self = shift; $apxs = ''; # not found - my @trys = ($Apache2::Build::APXS, $self->{MP_APXS}, - $ENV{MP_APXS}, - catfile $self->{MP_AP_PREFIX}, 'bin', 'apxs'); + $ENV{MP_APXS}); + + push @trys, catfile $self->{MP_AP_PREFIX}, 'bin', 'apxs' + if exists $self->{MP_AP_PREFIX}; if (WIN32) { my $ext = '.bat'; @@ -234,12 +235,12 @@ return ($arg and ref($arg) eq __PACKAGE__) ? $arg : __PACKAGE__; } -my %threaded_mpms = map { $_ => 1} +my %threaded_mpms = map { $_ => 1 } qw(worker winnt beos mpmt_os2 netware leader perchild threadpool); sub mpm_is_threaded { my $self = shift; my $mpm_name = $self->mpm_name(); - return $threaded_mpms{$mpm_name}; + return $threaded_mpms{$mpm_name} || 0; } sub mpm_name { @@ -253,16 +254,19 @@ my $mpm_name = $self->apxs('-q' => 'MPM_NAME'); # building against the httpd source dir - unless ($mpm_name and $self->httpd_is_source_tree) { - my $config_vars_file = catfile $self->dir, "build", "config_vars.mk"; - if (open my $fh, $config_vars_file) { - while (<$fh>) { - if (/MPM_NAME = (\w+)/) { - $mpm_name = $1; - last; + unless (($mpm_name and $self->httpd_is_source_tree)) { + if ($self->dir) { + my $config_vars_file = catfile $self->dir, + "build", "config_vars.mk"; + if (open my $fh, $config_vars_file) { + while (<$fh>) { + if (/MPM_NAME = (\w+)/) { + $mpm_name = $1; + last; + } } + close $fh; } - close $fh; } }