Commit 2d5fff07 authored by Kevin Falcone's avatar Kevin Falcone
Browse files

Bump version and turn the dev release into a real release

parent 561dc719
--- ---
abstract: 'Change metadata of ticket via email' abstract: 'Change metadata of ticket via email'
author: author:
- 'Jesse Vincent <jesse@bestpractical.com>' - 'Jesse Vincent C<< <jesse@bestpractical.com> >>'
build_requires: build_requires:
ExtUtils::MakeMaker: 6.42 ExtUtils::MakeMaker: 6.42
IPC::Open2: 0 IPC::Open2: 0
...@@ -9,7 +9,7 @@ build_requires: ...@@ -9,7 +9,7 @@ build_requires:
configure_requires: configure_requires:
ExtUtils::MakeMaker: 6.42 ExtUtils::MakeMaker: 6.42
distribution_type: module distribution_type: module
generated_by: 'Module::Install version 0.91' generated_by: 'Module::Install version 1.00'
license: perl license: perl
meta-spec: meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html url: http://module-build.sourceforge.net/META-spec-v1.4.html
...@@ -24,4 +24,4 @@ requires: ...@@ -24,4 +24,4 @@ requires:
UNIVERSAL::require: 0 UNIVERSAL::require: 0
resources: resources:
license: http://dev.perl.org/licenses/ license: http://dev.perl.org/licenses/
version: 0.08_01 version: 0.08
...@@ -253,6 +253,8 @@ sub import { ...@@ -253,6 +253,8 @@ sub import {
# import to main:: # import to main::
no strict 'refs'; no strict 'refs';
*{'main::WriteMakefile'} = \&Write if caller(0) eq 'main'; *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
return (@Existing, @Missing);
} }
sub _running_under { sub _running_under {
...@@ -672,7 +674,20 @@ sub _load { ...@@ -672,7 +674,20 @@ sub _load {
sub _load_cpan { sub _load_cpan {
return if $CPAN::VERSION and $CPAN::Config and not @_; return if $CPAN::VERSION and $CPAN::Config and not @_;
require CPAN; require CPAN;
if ( $CPAN::HandleConfig::VERSION ) {
# CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
# CPAN::HandleConfig->load. CPAN reports that the redirection
# is deprecated in a warning printed at the user.
# CPAN-1.81 expects CPAN::HandleConfig->load, does not have
# $CPAN::HandleConfig::VERSION but cannot handle
# CPAN::Config->load
# Which "versions expect CPAN::Config->load?
if ( $CPAN::HandleConfig::VERSION
|| CPAN::HandleConfig->can('load')
) {
# Newer versions of CPAN have a HandleConfig module # Newer versions of CPAN have a HandleConfig module
CPAN::HandleConfig->load; CPAN::HandleConfig->load;
} else { } else {
...@@ -802,4 +817,4 @@ END_MAKE ...@@ -802,4 +817,4 @@ END_MAKE
__END__ __END__
#line 1056 #line 1071
...@@ -19,6 +19,9 @@ package Module::Install; ...@@ -19,6 +19,9 @@ package Module::Install;
use 5.005; use 5.005;
use strict 'vars'; use strict 'vars';
use Cwd ();
use File::Find ();
use File::Path ();
use vars qw{$VERSION $MAIN}; use vars qw{$VERSION $MAIN};
BEGIN { BEGIN {
...@@ -28,7 +31,7 @@ BEGIN { ...@@ -28,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few # This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom # releases once we can make sure it won't clash with custom
# Module::Install extensions. # Module::Install extensions.
$VERSION = '0.91'; $VERSION = '1.00';
# Storage for the pseudo-singleton # Storage for the pseudo-singleton
$MAIN = undef; $MAIN = undef;
...@@ -38,18 +41,25 @@ BEGIN { ...@@ -38,18 +41,25 @@ BEGIN {
} }
sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;
#-------------------------------------------------------------
# all of the following checks should be included in import(),
# to allow "eval 'require Module::Install; 1' to test
# Whether or not inc::Module::Install is actually loaded, the # installation of Module::Install. (RT #51267)
# $INC{inc/Module/Install.pm} is what will still get set as long as #-------------------------------------------------------------
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus # Whether or not inc::Module::Install is actually loaded, the
# they may not have a MI version that works with the Makefile.PL. This would # $INC{inc/Module/Install.pm} is what will still get set as long as
# result in false errors or unexpected behaviour. And we don't want that. # the caller loaded module this in the documented manner.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; # If not set, the caller may NOT have loaded the bundled version, and thus
unless ( $INC{$file} ) { die <<"END_DIE" } # they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
Please invoke ${\__PACKAGE__} with: Please invoke ${\__PACKAGE__} with:
...@@ -61,26 +71,28 @@ not: ...@@ -61,26 +71,28 @@ not:
END_DIE END_DIE
# This reportedly fixes a rare Win32 UTC file time issue, but
# as this is a non-cross-platform XS module not in the core,
# we shouldn't really depend on it. See RT #24194 for detail.
# (Also, this module only supports Perl 5.6 and above).
# If the script that is loading Module::Install is from the future, eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which # If the script that is loading Module::Install is from the future,
# is unreliable on some platforms and requires write permissions) # then make will detect this and cause it to re-run over and over
# for now we should catch this and refuse to run. # again. This is bad. Rather than taking action to touch it (which
if ( -f $0 ) { # is unreliable on some platforms and requires write permissions)
my $s = (stat($0))[9]; # for now we should catch this and refuse to run.
if ( -f $0 ) {
# If the modification time is only slightly in the future, my $s = (stat($0))[9];
# sleep briefly to remove the problem.
my $a = $s - time; # If the modification time is only slightly in the future,
if ( $a > 0 and $a < 5 ) { sleep 5 } # sleep briefly to remove the problem.
my $a = $s - time;
# Too far in the future, throw an error. if ( $a > 0 and $a < 5 ) { sleep 5 }
my $t = time;
if ( $s > $t ) { die <<"END_DIE" } # Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t). Your installer $0 has a modification time in the future ($s > $t).
...@@ -89,15 +101,12 @@ This is known to create infinite loops in make. ...@@ -89,15 +101,12 @@ This is known to create infinite loops in make.
Please correct this, then run $0 again. Please correct this, then run $0 again.
END_DIE END_DIE
} }
# Build.PL was formerly supported, but no longer is due to excessive # Build.PL was formerly supported, but no longer is due to excessive
# difficulty in implementing every single feature twice. # difficulty in implementing every single feature twice.
if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
Module::Install no longer supports Build.PL. Module::Install no longer supports Build.PL.
...@@ -107,23 +116,42 @@ Please remove all Build.PL files and only use the Makefile.PL installer. ...@@ -107,23 +116,42 @@ Please remove all Build.PL files and only use the Makefile.PL installer.
END_DIE END_DIE
#-------------------------------------------------------------
# To save some more typing in Module::Install installers, every...
# use inc::Module::Install
# ...also acts as an implicit use strict.
$^H |= strict::bits(qw(refs subs vars));
#-------------------------------------------------------------
unless ( -f $self->{file} ) {
foreach my $key (keys %INC) {
delete $INC{$key} if $key =~ /Module\/Install/;
}
# To save some more typing in Module::Install installers, every... local $^W;
# use inc::Module::Install require "$self->{path}/$self->{dispatch}.pm";
# ...also acts as an implicit use strict. File::Path::mkpath("$self->{prefix}/$self->{author}");
$^H |= strict::bits(qw(refs subs vars)); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
local $^W;
*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
delete $INC{'inc/Module/Install.pm'};
delete $INC{'Module/Install.pm'};
# Save to the singleton
$MAIN = $self;
use Cwd (); return 1;
use File::Find (); }
use File::Path ();
use FindBin;
sub autoload { sub autoload {
my $self = shift; my $self = shift;
...@@ -136,7 +164,21 @@ sub autoload { ...@@ -136,7 +164,21 @@ sub autoload {
# Delegate back to parent dirs # Delegate back to parent dirs
goto &$code unless $cwd eq $pwd; goto &$code unless $cwd eq $pwd;
} }
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym"; unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
Unknown function is found at $file line $line.
Execution of $file aborted due to runtime errors.
If you're a contributor to a project, you may need to install
some Module::Install extensions from CPAN (or other repository).
If you're a user of a module, please contact the author.
EOT
}
my $method = $1; my $method = $1;
if ( uc($method) eq $method ) { if ( uc($method) eq $method ) {
# Do nothing # Do nothing
...@@ -152,33 +194,6 @@ sub autoload { ...@@ -152,33 +194,6 @@ sub autoload {
}; };
} }
sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;
unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
# Save to the singleton
$MAIN = $self;
return 1;
}
sub preload { sub preload {
my $self = shift; my $self = shift;
unless ( $self->{extensions} ) { unless ( $self->{extensions} ) {
...@@ -204,6 +219,7 @@ sub preload { ...@@ -204,6 +219,7 @@ sub preload {
my $who = $self->_caller; my $who = $self->_caller;
foreach my $name ( sort keys %seen ) { foreach my $name ( sort keys %seen ) {
local $^W;
*{"${who}::$name"} = sub { *{"${who}::$name"} = sub {
${"${who}::AUTOLOAD"} = "${who}::$name"; ${"${who}::AUTOLOAD"} = "${who}::$name";
goto &{"${who}::AUTOLOAD"}; goto &{"${who}::AUTOLOAD"};
...@@ -214,12 +230,18 @@ sub preload { ...@@ -214,12 +230,18 @@ sub preload {
sub new { sub new {
my ($class, %args) = @_; my ($class, %args) = @_;
delete $INC{'FindBin.pm'};
{
# to suppress the redefine warning
local $SIG{__WARN__} = sub {};
require FindBin;
}
# ignore the prefix on extension modules built from top level. # ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin); my $base_path = Cwd::abs_path($FindBin::Bin);
unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
delete $args{prefix}; delete $args{prefix};
} }
return $args{_self} if $args{_self}; return $args{_self} if $args{_self};
$args{dispatch} ||= 'Admin'; $args{dispatch} ||= 'Admin';
...@@ -272,8 +294,10 @@ END_DIE ...@@ -272,8 +294,10 @@ END_DIE
sub load_extensions { sub load_extensions {
my ($self, $path, $top) = @_; my ($self, $path, $top) = @_;
my $should_reload = 0;
unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix}; unshift @INC, $self->{prefix};
$should_reload = 1;
} }
foreach my $rv ( $self->find_extensions($path) ) { foreach my $rv ( $self->find_extensions($path) ) {
...@@ -281,12 +305,13 @@ sub load_extensions { ...@@ -281,12 +305,13 @@ sub load_extensions {
next if $self->{pathnames}{$pkg}; next if $self->{pathnames}{$pkg};
local $@; local $@;
my $new = eval { require $file; $pkg->can('new') }; my $new = eval { local $^W; require $file; $pkg->can('new') };
unless ( $new ) { unless ( $new ) {
warn $@ if $@; warn $@ if $@;
next; next;
} }
$self->{pathnames}{$pkg} = delete $INC{$file}; $self->{pathnames}{$pkg} =
$should_reload ? delete $INC{$file} : $INC{$file};
push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
} }
...@@ -348,17 +373,24 @@ sub _caller { ...@@ -348,17 +373,24 @@ sub _caller {
return $call; return $call;
} }
# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read { sub _read {
local *FH; local *FH;
if ( $] >= 5.006 ) { open( FH, '<', $_[0] ) or die "open($_[0]): $!";
open( FH, '<', $_[0] ) or die "open($_[0]): $!"; my $string = do { local $/; <FH> };
} else { close FH or die "close($_[0]): $!";
open( FH, "< $_[0]" ) or die "open($_[0]): $!"; return $string;
} }
END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
my $string = do { local $/; <FH> }; my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!"; close FH or die "close($_[0]): $!";
return $string; return $string;
} }
END_OLD
sub _readperl { sub _readperl {
my $string = Module::Install::_read($_[0]); my $string = Module::Install::_read($_[0]);
...@@ -379,18 +411,26 @@ sub _readpod { ...@@ -379,18 +411,26 @@ sub _readpod {
return $string; return $string;
} }
# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write { sub _write {
local *FH; local *FH;
if ( $] >= 5.006 ) { open( FH, '>', $_[0] ) or die "open($_[0]): $!";
open( FH, '>', $_[0] ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) {
} else { print FH $_[$_] or die "print($_[0]): $!";
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
} }
close FH or die "close($_[0]): $!";
}
END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
foreach ( 1 .. $#_ ) { foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!"; print FH $_[$_] or die "print($_[0]): $!";
} }
close FH or die "close($_[0]): $!"; close FH or die "close($_[0]): $!";
} }
END_OLD
# _version is for processing module versions (eg, 1.03_05) not # _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1). # Perl versions (eg, 5.8.1).
...@@ -427,4 +467,4 @@ sub _CLASS ($) { ...@@ -427,4 +467,4 @@ sub _CLASS ($) {
1; 1;
# Copyright 2008 - 2009 Adam Kennedy. # Copyright 2008 - 2010 Adam Kennedy.
...@@ -6,7 +6,7 @@ use Module::Install::Base (); ...@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE}; use vars qw{$VERSION @ISA $ISCORE};
BEGIN { BEGIN {
$VERSION = '0.91'; $VERSION = '1.00';
@ISA = 'Module::Install::Base'; @ISA = 'Module::Install::Base';
$ISCORE = 1; $ISCORE = 1;
} }
...@@ -37,12 +37,33 @@ sub auto_install { ...@@ -37,12 +37,33 @@ sub auto_install {
$self->include('Module::AutoInstall'); $self->include('Module::AutoInstall');
require Module::AutoInstall; require Module::AutoInstall;
Module::AutoInstall->import( my @features_require = Module::AutoInstall->import(
(@config ? (-config => \@config) : ()), (@config ? (-config => \@config) : ()),
(@core ? (-core => \@core) : ()), (@core ? (-core => \@core) : ()),
$self->features, $self->features,
); );
my %seen;
my @requires = map @$_, map @$_, grep ref, $self->requires;
while (my ($mod, $ver) = splice(@requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @deduped;
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
}
$self->requires(@deduped);
$self->makemaker_args( Module::AutoInstall::_make_args() ); $self->makemaker_args( Module::AutoInstall::_make_args() );
my $class = ref($self); my $class = ref($self);
......
...@@ -4,7 +4,7 @@ package Module::Install::Base; ...@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars'; use strict 'vars';
use vars qw{$VERSION}; use vars qw{$VERSION};
BEGIN { BEGIN {
$VERSION = '0.91'; $VERSION = '1.00';
} }
# Suspend handler for "redefined" warnings # Suspend handler for "redefined" warnings
...@@ -51,13 +51,18 @@ sub admin { ...@@ -51,13 +51,18 @@ sub admin {
#line 106 #line 106
sub is_admin { sub is_admin {
$_[0]->admin->VERSION; ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin');
} }
sub DESTROY {} sub DESTROY {}
package Module::Install::Base::FakeAdmin; package Module::Install::Base::FakeAdmin;
use vars qw{$VERSION};
BEGIN {
$VERSION = $Module::Install::Base::VERSION;
}
my $fake; my $fake;
sub new { sub new {
...@@ -75,4 +80,4 @@ BEGIN { ...@@ -75,4 +80,4 @@ BEGIN {
1;