perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: svn commit: r280495 - /perl/modperl/trunk/lib/ModPerl/Config.pm
Date Tue, 13 Sep 2005 17:36:24 GMT
pgollucci@apache.org wrote:
> Author: pgollucci
> Date: Mon Sep 12 21:42:31 2005
> New Revision: 280495
> 
> URL: http://svn.apache.org/viewcvs?rev=280495&view=rev
> Log:
> Add a DARWIN constant and add ldd/otool -L output to mp2bug reports
> 
> 
> Modified:
>     perl/modperl/trunk/lib/ModPerl/Config.pm
> 
> Modified: perl/modperl/trunk/lib/ModPerl/Config.pm
> URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/ModPerl/Config.pm?rev=280495&r1=280494&r2=280495&view=diff
> ==============================================================================
> --- perl/modperl/trunk/lib/ModPerl/Config.pm (original)
> +++ perl/modperl/trunk/lib/ModPerl/Config.pm Mon Sep 12 21:42:31 2005
> @@ -21,6 +21,7 @@
>  use File::Spec ();
>  
>  use constant WIN32 => Apache2::Build::WIN32;
> +use constant DARWIN => Apache2::Build::DARWIN;
>  
>  sub as_string {
>      my $build = Apache2::Build->build_config;
> @@ -53,6 +54,22 @@
>          $command = "$httpd -V";
>          $cfg .= "\n\n*** $command\n";
>          $cfg .= qx{$command};
> +
> +        my $command;
> +
> +        if (DARWIN) {
> +            my $otool = Apache::TestConfig::which('otool');
> +            $command = " -L $otool" if $otool;
> +        }
> +        elsif (!WIN32) {
> +            my $ldd = Apache::TestConfig::which('ldd');
> +            $command = "$ldd $httpd" if $ldd;
> +        }
> +
> +        if ($command) {
> +            $cfg .= "\n*** $command\n";
> +            $cfg .= qx{$command};
> +        }

code duplication detected :) whenever you find yourself duplicating code 
you should immediately consider refactoring. Otherwise the future won't be 
too good... :)

This code should live in Apache::TestConfig and used here as a function call.

-- 
__________________________________________________________________
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://mailchannels.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message