httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: apxs calls on Win32
Date Sun, 05 Dec 2004 05:32:39 GMT
Randy Kobes wrote:
> If apxs is installed on Win32, it is usually specified as a
> .bat file. In querying apxs in apxs() of Apache::TestConfig,
> however, Win32 needs both the path to cmd.exe (for running a
> .bat command) and to Perl (in order to run apxs.bat) in
> order to get something from
>    $val = qx($apxs -q $q 2>$devnull);
> This diff:

If it's only win32 case then +1 but if other platforms may have the same 
problem, may be it's better to blindly launder $ENV{PATH} like we do in a 
few other places (in which case there will be no need for this change, as 
the right paths will be there already, correct?)

> ==========================================================
> Index: lib/Apache/TestConfig.pm
> ===================================================================
> --- lib/Apache/TestConfig.pm	(revision 109825)
> +++ lib/Apache/TestConfig.pm	(working copy)
> @@ -1658,6 +1658,12 @@
>      my $val;
>      unless (exists $self->{_apxs}{$q}) {
>          local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) };
> +        # need path to Perl and to cmd.exe on Win32
> +        if (WIN32) {
> +            $ENV{PATH} = sprintf("%s;%s",
> +                                 dirname($ENV{COMSPEC}),
> +                                 dirname($self->{vars}->{perl}));
> +        }
>          my $devnull = devnull();
>          my $apxs = shell_ready($self->{APXS});
>          $val = qx($apxs -q $q 2>$devnull);
> 
> =================================================================
> populates $ENV{PATH} with the needed paths so that these
> calls succeeed.
> 


-- 
__________________________________________________________________
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