Changeset 1028


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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r1027 r1028  
    266266    sign => 1,
    267267    dist_name => "OpenGuides",
     268    module_name => "OpenGuides",
    268269    dist_version_from => "wiki.cgi",
    269270    license => "perl",
     
    300301        },
    301302    build_requires => {
    302         'Module::Build' => '0.18', # earlier doesn't install script files
     303        'Module::Build' => '0.26', # API change for accessing config data
    303304        },
    304305    recommends => {
     
    319320
    320321# Tell OpenGuides::Build which additional scripts and templates to install.
    321 $build->{config}{__extra_scripts}     =
     322$build->config_data( __extra_scripts =>
    322323                      [ "wiki.conf", "preferences.cgi", "search.cgi",
    323                         "newpage.cgi" ];
    324 $build->{config}{__templates}         = [
     324                        "newpage.cgi" ] );
     325$build->config_data( __templates     => [
    325326                      "admin_home.tt",
    326327                      "admin_revert_user.tt",
     
    369370                      "userstats.tt",
    370371                      "wanted_pages.tt"
    371     ];
     372    ] );
    372373
    373374# Finally write the build script.
  • trunk/Changes

    r1027 r1028  
    55
    660.60
     7        Upgraded Module::Build requirement to cope with API change.
    78        Added new parameters to action=random - you can now supply category
    89          and/or locale to get a random page chosen from that category/locale.
  • trunk/PREREQUISITES

    r1016 r1028  
    3636HTML::Entities
    3737LWP::Simple
    38 Module::Build (version 0.18 or later)
     38Module::Build (version 0.26 or later)
    3939Parse::RecDescent
    4040Plucene
  • 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.