Changeset 5749 for inc

Show
Ignore:
Timestamp:
07/22/05 16:11:20 (3 years ago)
Author:
Aankhen
svk:copy_cache_prev:
7758
Message:

* PugsBuild::Config: temporary workaround for config.yml error.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • inc/PugsBuild/Config.pm

    r5748 r5749  
    3636    my($class, $filename) = @_; 
    3737    my $stream; 
    38     open my $fh, ($filename ||= "config.yml") or die "open: $filename: $!"; 
     38    my $fh; 
     39     
     40    unless (open $fh, ($filename ||= "config.yml")) { 
     41        if (-e $filename) { die "open: $!"; } # real error 
     42         
     43        # Makefile.PL uses PugsBuild::Config, which needs to read config.yml. 
     44        # However, config.yml is generated by a Makefile target. 
     45        # This whole block is a temporary workaround for the problem. 
     46        require File::Copy; 
     47         
     48        File::Copy::copy ('util/config-template.yml', 'config.yml') or die "Copy failed"; 
     49        warn "Default build config file created. Edit your settings in config.yml."; 
     50         
     51        open $fh, "config.yml" or die "open: $!"; 
     52    }; 
     53     
    3954    { local $/; $stream = <$fh> } 
    4055    my $conf = $YAML->load($stream);