From: Tels Date: Sat, 16 Apr 2011 13:49:20 +0000 (+0100) Subject: 0.70 as released to CPAN. (only metadata and Module::Install changes) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Size.git;a=commitdiff_plain;h=f44772adb99685bc3f6d86d94c7a98ddb612f26a 0.70 as released to CPAN. (only metadata and Module::Install changes) Module::Install upgraded to 0.77 from 0.71 --- diff --git a/CHANGES b/CHANGES index 9a2eb5e..7d63b99 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,11 @@ Revision history for Perl extension Devel::Size. -0.70 2008-03-30 Tels 69 tests +0.70 2008-08-23 Tels 69 tests + * fix SEGFAULTS under v5.10 (Thanx Reini Urban!) * fix compilation under blead (Thanx Reini Urban!) * require Perl 5.006 (to stop CPANTESTERS sending bogus reports about failed compiling on ancient Perls) + * update the bundles Module::Install to v0.77 0.69 2007-08-11 Tels 69 tests * fix compilation under Perl v5.9.5 and v5.10 (Thanx Steve Peters!) diff --git a/META.yml b/META.yml index 71bd212..4b00d6e 100644 --- a/META.yml +++ b/META.yml @@ -1,15 +1,15 @@ --- -abstract: Perl extension for finding the memory usage of Perl variables +abstract: 'Perl extension for finding the memory usage of Perl variables' author: - 'Tels ' build_requires: Test::More: 0.42 distribution_type: module -generated_by: Module::Install version 0.68 +generated_by: 'Module::Install version 0.77' license: perl meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.3.html - version: 1.3 + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 name: Devel-Size no_index: directory: @@ -20,4 +20,7 @@ recommends: Devel::Size::Report: 0.11 requires: DynaLoader: 0 + perl: 5.006 +resources: + license: http://dev.perl.org/licenses/ version: 0.70 diff --git a/SIGNATURE b/SIGNATURE index c1678db..cbd85a4 100644 --- a/SIGNATURE +++ b/SIGNATURE @@ -14,21 +14,21 @@ not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 72c048477b518b904272a671e1788782c9ef595a CHANGES +SHA1 b23dfc6cbcbc3169764e89224857923e58991a32 CHANGES SHA1 e4296437ed0ab5559b250f6016d52c3b547d672e MANIFEST SHA1 6883c1a98abd5b1c049e389f831e939b79c13ba5 MANIFEST.SKIP -SHA1 0da014103e9b00b59688688e60cfc79a533fc75a META.yml +SHA1 0d8ddd17f26d90db4dc9f1ef004a7ce8a4df4a06 META.yml SHA1 6c9a869815fa984597e1e2e2d8404bda9cac8c56 Makefile.PL SHA1 e73e2ea830b69aefd7525f73b1fc06df4bf607f5 README SHA1 c8500a5602417e1714f1f4e388fa24e83e9d357d Size.xs -SHA1 d8f6d2df4e75cb9e6e77a8377457f0ececd00e31 inc/Module/Install.pm -SHA1 03590cde5c3de0d0d8a84d2b96917ed1a2cf9a30 inc/Module/Install/Base.pm -SHA1 8ef3c70e905be7d1007b446f21d4eb3ff6ae24cb inc/Module/Install/Can.pm -SHA1 79054604a1cd4e99443b05cbb62832568a204a33 inc/Module/Install/Fetch.pm -SHA1 dfa433f2f41d990946f1b3d68a29299539f2dea6 inc/Module/Install/Makefile.pm -SHA1 72cab336b6be5716aae0a1cb6d9add6c98a7a1f5 inc/Module/Install/Metadata.pm -SHA1 35a62725a7eade0fa617ef2ba4cf2f4d4a69a3fe inc/Module/Install/Win32.pm -SHA1 19dcc6d1e9f02c56d3f6d184642f4cd68aa371e6 inc/Module/Install/WriteAll.pm +SHA1 5c9e093b0facca46d50e3c69d5569aa7a98db0b8 inc/Module/Install.pm +SHA1 465acb50b9006ce61f58a7bd02d0bb029ddceaa6 inc/Module/Install/Base.pm +SHA1 8356d82167fc00550b4a3ceea8bd852a374d7509 inc/Module/Install/Can.pm +SHA1 b47ce07fa6d6e38e3daa6cfc752b23f59a64754c inc/Module/Install/Fetch.pm +SHA1 37ed4ccd7aba10119e6f2993b8082674ce2e5961 inc/Module/Install/Makefile.pm +SHA1 4aa1c578faad51f31e62bed7b28d3d42b88219c3 inc/Module/Install/Metadata.pm +SHA1 d7529d795a1304c88253b26a9089913edf31ae5e inc/Module/Install/Win32.pm +SHA1 2a74aba5a78e7ab2776382e42106ebe941c2ac28 inc/Module/Install/WriteAll.pm SHA1 44bade83bb938b5ec9adeb68dcf343482ea5ccde lib/Devel/Size.pm SHA1 362d6cb703b599a483563c84062e23b786c25d65 t/basic.t SHA1 dc638392e64661dd07deeba11f67e35650a6384a t/pod.t @@ -37,11 +37,11 @@ SHA1 214b335fb4c2f01f164cae6a49ad738ba3b5dfbd t/recurse.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iQEVAwUBR+9H8HcLPEOTuEwVAQKfqgf/Vc3uKJIPtZlBbAKH3lSF5ciaV7W+TWYD -dWOxME+nWAGZWXviZ74oHyIw1t5v8kh7Hjb+/afg5zyOHATzPS0GEY3cCMUmS5bD -AKnijm3p9Ti8f/hDESlfRxDq9FVDMdx3Bq2LtYqwW9P2PMEX82XWvrtB6FuWu9iW -cDTvs059YdxX8WJRpNGaPUZZTEMaXflzP61RR8fhu5Hsa900EOflCQvZMXEj3SVy -zmG5QY/pZ5lG8Bpx8m3zt72/6CB35DnsJBUSfo2sCmlu7c2q/biF4IdCxozw6PKI -Jf4myGKngIxSADpMAAZXN89nrq3AAteh10dJfLLP3hIzYqFaEr2t+A== -=YqJj +iQEVAwUBSK+5XXcLPEOTuEwVAQKRiQf+K3kgIRCgzfqJ34f2i2x8+S2jcvrlfGVH +0GfRNHGo1+7ZOPcrlTp/aS8lNp2ct+A4++oOf5xSKcOPdZ23nzosQXZzWoqXsZox +JMsG46EKnDtA53mNT8pdaDTBRAH4UWeMl1biZ+59XcjItENMujbVvWC/mnrLsZnD +/E+16wsaeJo0nCviPq8fsjzA17CiNXLy6Lzi+Ei9/V9nXMzg75J9ogaUVqT44oli +aqO05T5B7FJRCMjoB3k9l3s9Wk10YBxuc0XxBLrYqomgogf4sLRR5yx7S2otJfnF +TWO6WYiMuH820TdkGMeMXypzFlWuobt1LIMlkd1s8/QqbLAU/cJtzQ== +=gpOu -----END PGP SIGNATURE----- diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm index 760da11..eb449ca 100644 --- a/inc/Module/Install.pm +++ b/inc/Module/Install.pm @@ -30,7 +30,11 @@ BEGIN { # 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 # Module::Install extensions. - $VERSION = '0.71'; + $VERSION = '0.77'; + + *inc::Module::Install::VERSION = *VERSION; + @inc::Module::Install::ISA = __PACKAGE__; + } @@ -81,7 +85,7 @@ END_DIE # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. -if ( $0 =~ /Build.PL$/i or -f 'Build.PL' ) { die <<"END_DIE" } +if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. @@ -95,14 +99,20 @@ 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)); + + + + + use Cwd (); use File::Find (); use File::Path (); use FindBin; -*inc::Module::Install::VERSION = *VERSION; -@inc::Module::Install::ISA = __PACKAGE__; - sub autoload { my $self = shift; my $who = $self->_caller; @@ -115,8 +125,10 @@ sub autoload { goto &$code unless $cwd eq $pwd; } $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym"; - unshift @_, ( $self, $1 ); - goto &{$self->can('call')} unless uc($1) eq $1; + unless ( uc($1) eq $1 ) { + unshift @_, ( $self, $1 ); + goto &{$self->can('call')}; + } }; } @@ -329,7 +341,10 @@ sub _write { close FH or die "close($_[0]): $!"; } -sub _version { +# _version is for processing module versions (eg, 1.03_05) not +# Perl versions (eg, 5.8.1). + +sub _version ($) { my $s = shift || 0; $s =~ s/^(\d+)\.?//; my $l = $1 || 0; @@ -338,6 +353,17 @@ sub _version { return $l + 0; } +# Cloned from Params::Util::_CLASS +sub _CLASS ($) { + ( + defined $_[0] + and + ! ref $_[0] + and + $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s + ) ? $_[0] : undef; +} + 1; # Copyright 2008 Adam Kennedy. diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm index f07878d..433ebed 100644 --- a/inc/Module/Install/Base.pm +++ b/inc/Module/Install/Base.pm @@ -1,7 +1,7 @@ #line 1 package Module::Install::Base; -$VERSION = '0.71'; +$VERSION = '0.77'; # Suspend handler for "redefined" warnings BEGIN { @@ -45,6 +45,8 @@ sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } +#line 101 + sub is_admin { $_[0]->admin->VERSION; } @@ -67,4 +69,4 @@ BEGIN { 1; -#line 138 +#line 146 diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm index 410a0fc..9025607 100644 --- a/inc/Module/Install/Can.pm +++ b/inc/Module/Install/Can.pm @@ -11,7 +11,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } @@ -39,6 +39,7 @@ sub can_run { return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { + next if $dir eq ''; my $abs = File::Spec->catfile($dir, $_[1]); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } @@ -79,4 +80,4 @@ if ( $^O eq 'cygwin' ) { __END__ -#line 157 +#line 158 diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm index f7cd58e..d66aba5 100644 --- a/inc/Module/Install/Fetch.pm +++ b/inc/Module/Install/Fetch.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm index 3bfaf4c..92cd1ef 100644 --- a/inc/Module/Install/Makefile.pm +++ b/inc/Module/Install/Makefile.pm @@ -7,7 +7,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } @@ -36,9 +36,9 @@ sub prompt { sub makemaker_args { my $self = shift; - my $args = ($self->{makemaker_args} ||= {}); - %$args = ( %$args, @_ ) if @_; - $args; + my $args = ( $self->{makemaker_args} ||= {} ); + %$args = ( %$args, @_ ); + return $args; } # For mm args that take multiple space-seperated args, @@ -116,7 +116,13 @@ sub write { # Make sure we have a new enough require ExtUtils::MakeMaker; - $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION ); + + # MakeMaker can complain about module versions that include + # an underscore, even though its own version may contain one! + # Hence the funny regexp to get rid of it. See RT #35800 + # for details. + + $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ ); # Generate the my $args = $self->makemaker_args; @@ -175,7 +181,9 @@ sub write { my $user_preop = delete $args{dist}->{PREOP}; if (my $preop = $self->admin->preop($user_preop)) { - $args{dist} = $preop; + foreach my $key ( keys %$preop ) { + $args{dist}->{$key} = $preop->{$key}; + } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); @@ -242,4 +250,4 @@ sub postamble { __END__ -#line 371 +#line 379 diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm index 3552f86..397fb97 100644 --- a/inc/Module/Install/Metadata.pm +++ b/inc/Module/Install/Metadata.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } @@ -17,9 +17,7 @@ my @scalar_keys = qw{ abstract author version - license distribution_type - perl_version tests installdirs }; @@ -30,13 +28,21 @@ my @tuple_keys = qw{ requires recommends bundles + resources +}; + +my @resource_keys = qw{ + homepage + bugtracker + repository }; -sub Meta { shift } -sub Meta_ScalarKeys { @scalar_keys } -sub Meta_TupleKeys { @tuple_keys } +sub Meta { shift } +sub Meta_ScalarKeys { @scalar_keys } +sub Meta_TupleKeys { @tuple_keys } +sub Meta_ResourceKeys { @resource_keys } -foreach my $key (@scalar_keys) { +foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}{$key} if defined wantarray and !@_; @@ -45,12 +51,30 @@ foreach my $key (@scalar_keys) { }; } +foreach my $key ( @resource_keys ) { + *$key = sub { + my $self = shift; + unless ( @_ ) { + return () unless $self->{values}{resources}; + return map { $_->[1] } + grep { $_->[0] eq $key } + @{ $self->{values}{resources} }; + } + return $self->{values}{resources}{$key} unless @_; + my $uri = shift or die( + "Did not provide a value to $key()" + ); + $self->resources( $key => $uri ); + return 1; + }; +} + sub requires { my $self = shift; while ( @_ ) { my $module = shift or last; my $version = shift || 0; - push @{ $self->{values}->{requires} }, [ $module, $version ]; + push @{ $self->{values}{requires} }, [ $module, $version ]; } $self->{values}{requires}; } @@ -60,7 +84,7 @@ sub build_requires { while ( @_ ) { my $module = shift or last; my $version = shift || 0; - push @{ $self->{values}->{build_requires} }, [ $module, $version ]; + push @{ $self->{values}{build_requires} }, [ $module, $version ]; } $self->{values}{build_requires}; } @@ -70,7 +94,7 @@ sub configure_requires { while ( @_ ) { my $module = shift or last; my $version = shift || 0; - push @{ $self->{values}->{configure_requires} }, [ $module, $version ]; + push @{ $self->{values}{configure_requires} }, [ $module, $version ]; } $self->{values}{configure_requires}; } @@ -80,7 +104,7 @@ sub recommends { while ( @_ ) { my $module = shift or last; my $version = shift || 0; - push @{ $self->{values}->{recommends} }, [ $module, $version ]; + push @{ $self->{values}{recommends} }, [ $module, $version ]; } $self->{values}{recommends}; } @@ -90,11 +114,33 @@ sub bundles { while ( @_ ) { my $module = shift or last; my $version = shift || 0; - push @{ $self->{values}->{bundles} }, [ $module, $version ]; + push @{ $self->{values}{bundles} }, [ $module, $version ]; } $self->{values}{bundles}; } +# Resource handling +my %lc_resource = map { $_ => 1 } qw{ + homepage + license + bugtracker + repository +}; + +sub resources { + my $self = shift; + while ( @_ ) { + my $name = shift or last; + my $value = shift or next; + if ( $name eq lc $name and ! $lc_resource{$name} ) { + die("Unsupported reserved lowercase resource '$name'"); + } + $self->{values}{resources} ||= []; + push @{ $self->{values}{resources} }, [ $name, $value ]; + } + $self->{values}{resources}; +} + # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } @@ -108,30 +154,73 @@ sub install_as_vendor { $_[0]->installdirs('vendor') } sub sign { my $self = shift; - return $self->{'values'}{'sign'} if defined wantarray and ! @_; - $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 ); + return $self->{values}{sign} if defined wantarray and ! @_; + $self->{values}{sign} = ( @_ ? $_[0] : 1 ); return $self; } sub dynamic_config { my $self = shift; unless ( @_ ) { - warn "You MUST provide an explicit true/false value to dynamic_config, skipping\n"; + warn "You MUST provide an explicit true/false value to dynamic_config\n"; return $self; } $self->{values}{dynamic_config} = $_[0] ? 1 : 0; - return $self; + return 1; +} + +sub perl_version { + my $self = shift; + return $self->{values}{perl_version} unless @_; + my $version = shift or die( + "Did not provide a value to perl_version()" + ); + + # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to + # numbers (eg, 5.006001 or 5.008009). + + $version =~ s/^(\d+)\.(\d+)\.(\d+)$/sprintf("%d.%03d%03d",$1,$2,$3)/e; + + $version =~ s/_.+$//; + $version = $version + 0; # Numify + unless ( $version >= 5.005 ) { + die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; + } + $self->{values}{perl_version} = $version; + return 1; +} + +sub license { + my $self = shift; + return $self->{values}{license} unless @_; + my $license = shift or die( + 'Did not provide a value to license()' + ); + $self->{values}{license} = $license; + + # Automatically fill in license URLs + if ( $license eq 'perl' ) { + $self->resources( license => 'http://dev.perl.org/licenses/' ); + } + + return 1; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { - my $name = $self->name - or die "all_from called with no args without setting name() first"; + my $name = $self->name or die( + "all_from called with no args without setting name() first" + ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; - die "all_from: cannot find $file from $name" unless -e $file; + unless ( -e $file ) { + die("all_from cannot find $file from $name"); + } + } + unless ( -f $file ) { + die("The path '$file' does not exist, or is not a file"); } # Some methods pull from POD instead of code. @@ -210,8 +299,8 @@ sub features { while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } - return $self->{values}->{features} - ? @{ $self->{values}->{features} } + return $self->{values}{features} + ? @{ $self->{values}{features} } : (); } @@ -267,22 +356,25 @@ sub abstract_from { ); } +# Add both distribution and module name sub name_from { - my $self = shift; + my ($self, $file) = @_; if ( - Module::Install::_read($_[0]) =~ m/ - ^ \s + Module::Install::_read($file) =~ m/ + ^ \s* package \s* ([\w:]+) \s* ; /ixms ) { - my $name = $1; + my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); + unless ( $self->module_name ) { + $self->module_name($module_name); + } } else { - die "Cannot determine name from $_[0]\n"; - return; + die("Cannot determine name from $file\n"); } } @@ -291,7 +383,7 @@ sub perl_version_from { if ( Module::Install::_read($_[0]) =~ m/ ^ - use \s* + (?:use|require) \s* v? ([\d_\.]+) \s* ; @@ -341,8 +433,12 @@ sub license_from { my $license_text = $1; my @phrases = ( 'under the same (?:terms|license) as perl itself' => 'perl', 1, + 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, + 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, + 'GNU library general public license' => 'lgpl', 1, + 'GNU library public license' => 'lgpl', 1, 'BSD license' => 'bsd', 1, 'Artistic license' => 'artistic', 1, 'GPL' => 'gpl', 1, @@ -356,7 +452,7 @@ sub license_from { $pattern =~ s{\s+}{\\s+}g; if ( $license_text =~ /\b$pattern\b/i ) { if ( $osi and $license_text =~ /All rights reserved/i ) { - warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it."; + print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n"; } $self->license($license); return 1; @@ -368,4 +464,37 @@ sub license_from { return 'unknown'; } +sub bugtracker_from { + my $self = shift; + my $content = Module::Install::_read($_[0]); + my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g; + unless ( @links ) { + warn "Cannot determine bugtracker info from $_[0]\n"; + return 0; + } + if ( @links > 1 ) { + warn "Found more than on rt.cpan.org link in $_[0]\n"; + return 0; + } + + # Set the bugtracker + bugtracker( $links[0] ); + return 1; +} + +sub install_script { + my $self = shift; + my $args = $self->makemaker_args; + my $exe = $args->{EXE_FILES} ||= []; + foreach ( @_ ) { + if ( -f $_ ) { + push @$exe, $_; + } elsif ( -d 'script' and -f "script/$_" ) { + push @$exe, "script/$_"; + } else { + die("Cannot find script '$_'"); + } + } +} + 1; diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm index dcc6f57..cff76a2 100644 --- a/inc/Module/Install/Win32.pm +++ b/inc/Module/Install/Win32.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm index 13437e6..f35620f 100644 --- a/inc/Module/Install/WriteAll.pm +++ b/inc/Module/Install/WriteAll.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.71'; + $VERSION = '0.77'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; }