Update of /cvsroot/module-build/Module-Build/lib/Module/Build
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25972/lib/Module/Build
Modified Files:
Base.pm
Log Message:
Merge arguments after commandline arguments so that we can support an option ('skip_rcfile') to skip reading the '~/.modulebuildrc' file.
Index: Base.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v
retrieving revision 1.404
retrieving revision 1.405
diff -u -d -r1.404 -r1.405
--- Base.pm 31 Mar 2005 08:14:04 -0000 1.404
+++ Base.pm 31 Mar 2005 09:01:38 -0000 1.405
@@ -473,6 +473,7 @@
ignore_prereq_conflicts
ignore_prereq_requires
ignore_prereqs
+ skip_rcfile
);
INIT {
@@ -1220,13 +1221,23 @@
return defined( $args ) ? $args : {};
}
+sub merge_modulebuildrc {
+ my( $self, $action, %args ) = @_;
+
+ my $rc_args = $self->read_modulebuildrc( $action || 'build' );
+
+ my %app_args;
+ while (my ($key, $val) = each %$rc_args) {
+ $app_args{$key} = $val unless exists( $args{$key} );
+ }
+
+ $self->merge_args( $action, %app_args );
+}
+
sub merge_args {
- my ($self, $action, %cmd_args) = @_;
+ my ($self, $action, %args) = @_;
$self->{action} = $action if defined $action;
- my $rc_args = $self->read_modulebuildrc( $self->{action} || 'build' );
- my %args = ( %$rc_args, %cmd_args );
-
my %additive = map { $_ => 1 } $self->hash_properties;
# Extract our 'properties' from $cmd_args, the rest are put in 'args'.
@@ -1250,6 +1261,7 @@
my $self = shift;
my ($args, $action) = $self->read_args(@_);
$self->merge_args($action, %$args);
+ $self->merge_modulebuildrc( $action, %$args ) unless $self->skip_rcfile;
}
sub super_classes {
|