Skip to content

Commit

Permalink
Revert change to split_like_shell() method, and have read_modulebuild…
Browse files Browse the repository at this point in the history
…rc() returns a empty hash if the file isn't found or there are no matching actions.

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@5299 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information
Randy Sims committed Mar 31, 2005
1 parent f94fd7e commit a5f525f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions lib/Module/Build/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1178,10 +1178,10 @@ sub read_args {
sub read_modulebuildrc {
my( $self, $action ) = @_;

return unless exists( $ENV{HOME} ) && -e $ENV{HOME};
return {} unless exists( $ENV{HOME} ) && -e $ENV{HOME};

my $modulebuildrc = File::Spec->catfile( $ENV{HOME}, '.modulebuildrc' );
return unless -e $modulebuildrc;
return {} unless -e $modulebuildrc;

my $fh = IO::File->new( $modulebuildrc )
or die "Can't open $modulebuildrc: $!";
Expand Down Expand Up @@ -1209,10 +1209,10 @@ sub read_modulebuildrc {
$options{$action} .= $options . ' ';
}

my @args = $self->split_like_shell( $options{'*'}, $options{$action} );
my @args = $self->split_like_shell( "$options{'*'} $options{$action}" );
my( $args ) = $self->read_args( @args );

return $args;
return defined( $args ) ? $args : {};
}

sub merge_args {
Expand Down Expand Up @@ -2626,9 +2626,7 @@ sub compile_xs {
}

sub split_like_shell {
my ($self, @strings) = @_;

my $string = join( ' ', map {s/\s+$//; $_} @strings );
my ($self, $string) = @_;

return () unless defined($string);
return @$string if UNIVERSAL::isa($string, 'ARRAY');
Expand Down
3 changes: 1 addition & 2 deletions lib/Module/Build/Platform/Windows.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ sub split_like_shell {
# (mostly Randy), and there are a lot of regression tests, so we
# should feel free to adjust if desired.

my ($self, @strings) = @_;
local $_ = join( ' ', map {s/\s+$//; $_} @strings );
(my $self, local $_) = @_;

return @$_ if defined() && UNIVERSAL::isa($_, 'ARRAY');

Expand Down

0 comments on commit a5f525f

Please sign in to comment.