Changeset 7367 for inc

Show
Ignore:
Timestamp:
10/07/05 02:58:11 (3 years ago)
Author:
geoffb
Message:

PugsBuild::Config: some cleanup in sub read, and warn if config.yml is older than template

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • inc/PugsBuild/Config.pm

    r7342 r7367  
    3737sub read { 
    3838    my($class, $filename) = @_; 
     39    my $config_default    = 'config.yml'; 
     40    my $config_template   = 'util/config-template.yml'; 
     41    $filename           ||= $ENV{PUGS_BUILD_CONFIG} || $config_default; 
    3942    my $stream; 
    4043     
    41     if (!-e ($filename ||= ($ENV{PUGS_BUILD_CONFIG} || "config.yml"))) { 
     44    if (!-e $filename) { 
    4245        require File::Copy; 
    43         File::Copy::copy ('util/config-template.yml', $filename) or 
     46        File::Copy::copy ($config_template, $filename) or 
    4447            die "copy: $!"; 
    4548        warn <<"."; 
     49*** 
    4650Default build config file created. Edit your settings in $filename. 
    4751. 
    4852    }        
     53 
     54    if (-M $filename > -M $config_template) { 
     55        warn <<"."; 
     56*** 
     57Build config file '$filename' is older than template 
     58'$config_template'. 
     59 
     60You may wish to check for new settings. 
     61. 
     62    } 
    4963 
    5064    open my $fh, $filename or die "open: $filename: $!";