perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject Re: [patch] automatic build's args re-use
Date Tue, 20 Nov 2001 18:25:09 GMT
On Tue, 20 Nov 2001, Stas Bekman wrote:

> This patch allows to re-run the build using the same args as the one
> that's already built
> 
> Should be used as:
> 
>   % perl -MApache::BuildConfig -erebuild

Apache::BuildConfig is only supposed to be used by Apache::Build.
 
> +    print $fh <<'EOF';

rebuild should live in Apache::Build, instead of calling new() it would
call build_config() to get the values from Apache::BuildConfig.

> +sub rebuild {
> +    my $self = __PACKAGE__->new;
> +    my $valid_opts = ModPerl::BuildOptions->table();
> +    my @opts = map { "$_=" .
> +                    ($self->{$_} =~ /^\d+$/
> +                         ? $self->{$_}
> +                         : qq{'$self->{$_}'}
> +                    ) } sort grep { exists $valid_opts->{$_} }  keys %$self;

no need for $valid_opts, /^MP_/ will do, since all build options are
prefixed with MP_ and if they weren't valid, they wouldn't have made it
into Apache::BuildConfig.  can also just quote every value, no need for
conditional on /^\d+$/

> +    my $command = "perl Makefile.PL @opts";
> +    print "Running: $command\n";
> +    system $command;
> +}
> +# % perl -MApache::BuildConfig -erebuild
> +*main::rebuild=\&rebuild;

and this should be:

*main::rebuild = \&rebuild if $0 eq '-e';

so the alias is only created for 'perl -MApache::Build -e rebuild'



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


Mime
View raw message