Ignore:
Timestamp:
May 2, 2007, 11:46:55 AM (14 years ago)
Author:
kake
Message:

Bump Module::Build prereq to 0.26 as per Daniel's patch. Fix "munging custom lib path" bug that popped up along the way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Build.pm

    r785 r1028  
    6060    my $custom_template_path = $config->custom_template_path;
    6161    my $custom_lib_path      = $config->custom_lib_path;
    62     my @extra_scripts        = @{ $self->{config}{__extra_scripts} };
    63     my @templates            = @{ $self->{config}{__templates} };
     62    my @extra_scripts        = @{ $self->config_data( "__extra_scripts" ) };
     63    my @templates            = @{ $self->config_data( "__templates" ) };
    6464
    6565    print "Installing scripts to $install_directory:\n";
     
    162162    close $fh or die $!;
    163163    $content =~ s|use strict;|use strict\;\nuse lib qw( $lib_path )\;|s;
     164
     165    # Make sure we can write to the file before we try to (see perldoc -f stat)
     166    my @file_info = stat( $copy );
     167    my $orig_mode = $file_info[2] & 07777;
     168    chmod( $orig_mode | 0222, $copy )
     169        or warn "Couldn't make $copy writeable: $!";
    164170    open $fh, ">$copy" or die $!;
    165171    print $fh $content;
    166172    close $fh or die $!;
     173    chmod( $orig_mode, $copy )
     174        or warn "Couldn't restore permissions on $copy: $!";
     175
    167176    return 1;
    168177}
Note: See TracChangeset for help on using the changeset viewer.