Show
Ignore:
Timestamp:
10/17/08 12:57:05 (6 years ago)
Author:
yappo
Message:

Module::Setup::Distribute のテスト追加と dist_path にマクロが複数あったらマクロ展開しないバグを直した

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Module-Setup/trunk/lib/Module/Setup/Distribute.pm

    r21435 r21474  
    3333sub dist_path     { shift->{dist_path} }; 
    3434sub template_vars { shift->{template_vars} }; 
     35sub install_files { shift->{install_files} }; 
    3536 
    3637sub set_template_vars { 
     
    4344 
    4445    my $src      = $context->base_dir->flavor->template->path_to($path); 
     46    my $template = $src->is_dir ? undef : $src->slurp; 
    4547    my $options = +{ 
    4648        dist_path => ($src->is_dir ? $self->dist_path->subdir($path) : $self->dist_path->file($path)), 
    47         template  => ($src->is_dir ? undef : $src->slurp || undef), 
     49        template  => $template, 
    4850        chmod     => sprintf('%03o', S_IMODE(( stat $src )[2])), 
    4951        vars      => $self->template_vars, 
     
    6163        $options->{template} = delete $options->{content} unless $options->{template}; 
    6264    } 
    63     $options->{dist_path} =~ s/____var-(.+)-var____/$options->{vars}->{$1} || $options->{vars}->{config}->{$1}/eg; 
     65    $options->{dist_path} =~ s/____var-(.+?)-var____/$options->{vars}->{$1} || $options->{vars}->{config}->{$1}/eg; 
    6466    $context->call_trigger( replace_distribute_path => $options ); 
    6567