summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r--lib/ExtUtils/Changes41
-rw-r--r--lib/ExtUtils/Command/MM.pm2
-rw-r--r--lib/ExtUtils/Liblist.pm2
-rw-r--r--lib/ExtUtils/Liblist/Kid.pm4
-rw-r--r--lib/ExtUtils/MM.pm2
-rw-r--r--lib/ExtUtils/MM_AIX.pm2
-rw-r--r--lib/ExtUtils/MM_Any.pm298
-rw-r--r--lib/ExtUtils/MM_BeOS.pm2
-rw-r--r--lib/ExtUtils/MM_Cygwin.pm2
-rw-r--r--lib/ExtUtils/MM_DOS.pm2
-rw-r--r--lib/ExtUtils/MM_MacOS.pm2
-rw-r--r--lib/ExtUtils/MM_NW5.pm2
-rw-r--r--lib/ExtUtils/MM_OS2.pm2
-rw-r--r--lib/ExtUtils/MM_QNX.pm2
-rw-r--r--lib/ExtUtils/MM_UWIN.pm2
-rw-r--r--lib/ExtUtils/MM_Unix.pm2
-rw-r--r--lib/ExtUtils/MM_VMS.pm2
-rw-r--r--lib/ExtUtils/MM_VOS.pm2
-rw-r--r--lib/ExtUtils/MM_Win32.pm23
-rw-r--r--lib/ExtUtils/MM_Win95.pm2
-rw-r--r--lib/ExtUtils/MY.pm2
-rw-r--r--lib/ExtUtils/MakeMaker.pm34
-rw-r--r--lib/ExtUtils/MakeMaker/Config.pm2
-rw-r--r--lib/ExtUtils/MakeMaker/bytes.pm2
-rw-r--r--lib/ExtUtils/MakeMaker/vmsish.pm2
-rw-r--r--lib/ExtUtils/Mkbootstrap.pm2
-rw-r--r--lib/ExtUtils/Mksymlists.pm2
-rw-r--r--lib/ExtUtils/t/MM_Unix.t16
-rw-r--r--lib/ExtUtils/t/MM_Win32.t33
-rw-r--r--lib/ExtUtils/t/basic.t39
-rw-r--r--lib/ExtUtils/t/metafile_data.t135
-rw-r--r--lib/ExtUtils/t/metafile_file.t293
-rw-r--r--lib/ExtUtils/t/writemakefile_args.t38
-rw-r--r--lib/ExtUtils/testlib.pm2
34 files changed, 883 insertions, 117 deletions
diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes
index a96d92866d..71255a370b 100644
--- a/lib/ExtUtils/Changes
+++ b/lib/ExtUtils/Changes
@@ -1,3 +1,44 @@
+6.46 Sat Sep 27 17:34:03 EDT 2008
+ Bug Fixes
+ - Fix META_MERGE for more than one level of hashes. [rt.cpan.org 39348]
+
+
+6.45_02 Sun Sep 7 13:59:14 PDT 2008
+ Bug Fixes
+ - Updated bundled ExtUtils::Command to 1.14, ExtUtils::Install to
+ 1.50 and ExtUtils::Manifest to 1.54
+
+ Test Fixes
+ - t/writemakefile_args.t had the wrong skip amoung causing failures
+ when run without version.pm (mostly 5.6 users)
+
+
+6.45_01 Sat Sep 6 03:19:03 PDT 2008
+ New Features
+ * META_ADD and META_MERGE have been added to manipulate the META.yml.
+ Thanks to Adriano Ferreira. [rt.cpan.org 21282]
+ - META.yml now includes configure_requires ExtUtils::MakeMaker by
+ default. [rt.cpan.org 32337]
+ - META.yml now excludes t/ and inc/ from indexing by default.
+ - META.yml license is now "unknown" instead of undef if a LICENSE is not
+ given.
+ - META.yml now conforms to version 1.4 of the spec.
+
+ Bug Fixes
+ - Make @MM_Sections and @Overridable global again. It's an undocumented
+ but used way to manipulate MakeMaker behavior. [rt.cpan.org 36047]
+
+ Portability
+ * Changed the name/dmake test in MM_Win32.pm to use regexs to that
+ they are able to handle Perl on a Stick absolute paths.
+
+
+6.44 Thu Feb 28 16:06:04 PST 2008
+ Bug Fixes
+ * Updated bundled ExtUtils::Install to 1.45 which should fix some
+ Cygwin issues. [rt.cpan.org 33291]
+
+
6.43_01 Tue Jan 1 16:06:47 PST 2008
Bug Fixes
* Change the "is this really a Perl core library directory" checks to
diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm
index 8c9ed96629..52dab27130 100644
--- a/lib/ExtUtils/Command/MM.pm
+++ b/lib/ExtUtils/Command/MM.pm
@@ -10,7 +10,7 @@ our @ISA = qw(Exporter);
our @EXPORT = qw(test_harness pod2man perllocal_install uninstall
warn_if_old_packlist);
-our $VERSION = '6.44';
+our $VERSION = '6.46';
my $Is_VMS = $^O eq 'VMS';
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm
index 7466b5cd21..e01802e02a 100644
--- a/lib/ExtUtils/Liblist.pm
+++ b/lib/ExtUtils/Liblist.pm
@@ -2,7 +2,7 @@ package ExtUtils::Liblist;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
use File::Spec;
require ExtUtils::Liblist::Kid;
diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm
index dfddad55cc..bddcf76a3b 100644
--- a/lib/ExtUtils/Liblist/Kid.pm
+++ b/lib/ExtUtils/Liblist/Kid.pm
@@ -9,7 +9,7 @@ use 5.006;
# Broken out of MakeMaker from version 4.11
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
use Config;
use Cwd 'cwd';
@@ -127,7 +127,7 @@ sub _unix_os2_ext {
} elsif (-f ($fullname="$thispth/lib$thislib.$so")
&& (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){
} elsif (-f ($fullname="$thispth/lib${thislib}_s$Config_libext")
- && (! $Config{'archname'} =~ /RM\d\d\d-svr4/)
+ && ($Config{'archname'} !~ /RM\d\d\d-svr4/)
&& ($thislib .= "_s") ){ # we must explicitly use _s version
} elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){
} elsif (-f ($fullname="$thispth/$thislib$Config_libext")){
diff --git a/lib/ExtUtils/MM.pm b/lib/ExtUtils/MM.pm
index b11ed6bf50..db791d4a6e 100644
--- a/lib/ExtUtils/MM.pm
+++ b/lib/ExtUtils/MM.pm
@@ -3,7 +3,7 @@ package ExtUtils::MM;
use strict;
use ExtUtils::MakeMaker::Config;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::Liblist;
require ExtUtils::MakeMaker;
diff --git a/lib/ExtUtils/MM_AIX.pm b/lib/ExtUtils/MM_AIX.pm
index 24092da16a..f625d6b190 100644
--- a/lib/ExtUtils/MM_AIX.pm
+++ b/lib/ExtUtils/MM_AIX.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_AIX;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm
index d097a8b50a..449db51fe5 100644
--- a/lib/ExtUtils/MM_Any.pm
+++ b/lib/ExtUtils/MM_Any.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_Any;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
use Carp;
use File::Spec;
@@ -732,55 +732,287 @@ metafile :
$(NOECHO) $(NOOP)
MAKE_FRAG
- my $prereq_pm = '';
- foreach my $mod ( sort { lc $a cmp lc $b } keys %{$self->{PREREQ_PM}} ) {
- my $ver = $self->{PREREQ_PM}{$mod};
- $prereq_pm .= sprintf "\n %-30s %s", "$mod:", $ver;
+ my @metadata = $self->metafile_data(
+ $self->{META_ADD} || {},
+ $self->{META_MERGE} || {},
+ );
+ my $meta = $self->metafile_file(@metadata);
+ my @write_meta = $self->echo($meta, 'META_new.yml');
+
+ return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta);
+metafile : create_distdir
+ $(NOECHO) $(ECHO) Generating META.yml
+ %s
+ -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
+MAKE_FRAG
+
+}
+
+
+=begin private
+
+=head3 _sort_pairs
+
+ my @pairs = _sort_pairs($sort_sub, \%hash);
+
+Sorts the pairs of a hash based on keys ordered according
+to C<$sort_sub>.
+
+=end private
+
+=cut
+
+sub _sort_pairs {
+ my $sort = shift;
+ my $pairs = shift;
+ return map { $_ => $pairs->{$_} }
+ sort $sort
+ keys %$pairs;
+}
+
+
+# Taken from Module::Build::Base
+sub _hash_merge {
+ my ($self, $h, $k, $v) = @_;
+ if (ref $h->{$k} eq 'ARRAY') {
+ push @{$h->{$k}}, ref $v ? @$v : $v;
+ } elsif (ref $h->{$k} eq 'HASH') {
+ $self->_hash_merge($h->{$k}, $_, $v->{$_}) foreach keys %$v;
+ } else {
+ $h->{$k} = $v;
}
+}
- my $author_value = defined $self->{AUTHOR}
- ? "\n - $self->{AUTHOR}"
- : undef;
- # Use a list to preserve order.
- my @meta_to_mm = (
+=head3 metafile_data
+
+ my @metadata_pairs = $mm->metafile_data(\%meta_add, \%meta_merge);
+
+Returns the data which MakeMaker turns into the META.yml file.
+
+Values of %meta_add will overwrite any existing metadata in those
+keys. %meta_merge will be merged with them.
+
+=cut
+
+sub metafile_data {
+ my $self = shift;
+ my($meta_add, $meta_merge) = @_;
+
+ # The order in which standard meta keys should be written.
+ my @meta_order = qw(
+ name
+ version
+ abstract
+ author
+ license
+ distribution_type
+
+ configure_requires
+ build_requires
+ requires
+
+ resources
+
+ provides
+ no_index
+
+ generated_by
+ meta-spec
+ );
+
+ my %meta = (
name => $self->{DISTNAME},
version => $self->{VERSION},
abstract => $self->{ABSTRACT},
- license => $self->{LICENSE},
- author => $author_value,
- generated_by =>
- "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ license => $self->{LICENSE} || 'unknown',
distribution_type => $self->{PM} ? 'module' : 'script',
+
+ configure_requires => {
+ 'ExtUtils::MakeMaker' => 0
+ },
+
+ no_index => {
+ directory => [qw(t inc)]
+ },
+
+ generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ 'meta-spec' => {
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ version => 1.4
+ },
);
+ $meta{author} = defined $self->{AUTHOR} ? [$self->{AUTHOR}] : [];
+ $meta{requires} = $self->{PREREQ_PM} if defined $self->{PREREQ_PM};
- my $meta = "--- #YAML:1.0\n";
+ while( my($key, $val) = each %$meta_add ) {
+ $meta{$key} = $val;
+ }
- while( @meta_to_mm ) {
- my($key, $val) = splice @meta_to_mm, 0, 2;
+ while( my($key, $val) = each %$meta_merge ) {
+ $self->_hash_merge(\%meta, $key, $val);
+ }
- $val = '~' unless defined $val;
+ my @meta_pairs;
+
+ # Put the standard keys first in the proper order.
+ for my $key (@meta_order) {
+ next unless exists $meta{$key};
+
+ push @meta_pairs, $key, delete $meta{$key};
+ }
+
+ # Then tack everything else onto the end, alpha sorted.
+ for my $key (sort {lc $a cmp lc $b} keys %meta) {
+ push @meta_pairs, $key, $meta{$key};
+ }
+
+ return @meta_pairs
+}
- $meta .= sprintf "%-20s %s\n", "$key:", $val;
+=begin private
+
+=head3 _dump_hash
+
+ $yaml = _dump_hash(\%options, %hash);
+
+Implements a fake YAML dumper for a hash given
+as a list of pairs. No quoting/escaping is done. Keys
+are supposed to be strings. Values are undef, strings,
+hash refs or array refs of strings.
+
+Supported options are:
+
+ delta => STR - indentation delta
+ use_header => BOOL - whether to include a YAML header
+ indent => STR - a string of spaces
+ default: ''
+
+ max_key_length => INT - maximum key length used to align
+ keys and values of the same hash
+ default: 20
+ key_sort => CODE - a sort sub
+ It may be undef, which means no sorting by keys
+ default: sub { lc $a cmp lc $b }
+
+ customs => HASH - special options for certain keys
+ (whose values are hashes themselves)
+ may contain: max_key_length, key_sort, customs
+
+=end private
+
+=cut
+
+sub _dump_hash {
+ croak "first argument should be a hash ref" unless ref $_[0] eq 'HASH';
+ my $options = shift;
+ my %hash = @_;
+
+ # Use a list to preserve order.
+ my @pairs;
+
+ my $k_sort
+ = exists $options->{key_sort} ? $options->{key_sort}
+ : sub { lc $a cmp lc $b };
+ if ($k_sort) {
+ croak "'key_sort' should be a coderef" unless ref $k_sort eq 'CODE';
+ @pairs = _sort_pairs($k_sort, \%hash);
+ } else { # list of pairs, no sorting
+ @pairs = @_;
+ }
+
+ my $yaml = $options->{use_header} ? "--- #YAML:1.0\n" : '';
+ my $indent = $options->{indent} || '';
+ my $k_length = min(
+ ($options->{max_key_length} || 20),
+ max(map { length($_) + 1 } grep { !ref $hash{$_} } keys %hash)
+ );
+ my $customs = $options->{customs} || {};
+
+ # printf format for key
+ my $k_format = "%-${k_length}s";
+
+ while( @pairs ) {
+ my($key, $val) = splice @pairs, 0, 2;
+ $val = '~' unless defined $val;
+ if(ref $val eq 'HASH') {
+ if ( keys %$val ) {
+ my %k_options = ( # options for recursive call
+ delta => $options->{delta},
+ use_header => 0,
+ indent => $indent . $options->{delta},
+ );
+ if (exists $customs->{$key}) {
+ my %k_custom = %{$customs->{$key}};
+ foreach my $k qw(key_sort max_key_length customs) {
+ $k_options{$k} = $k_custom{$k} if exists $k_custom{$k};
+ }
+ }
+ $yaml .= $indent . "$key:\n"
+ . _dump_hash(\%k_options, %$val);
+ }
+ else {
+ $yaml .= $indent . "$key: {}\n";
+ }
+ }
+ elsif (ref $val eq 'ARRAY') {
+ if( @$val ) {
+ $yaml .= $indent . "$key:\n";
+
+ for (@$val) {
+ croak "only nested arrays of non-refs are supported" if ref $_;
+ $yaml .= $indent . $options->{delta} . "- $_\n";
+ }
+ }
+ else {
+ $yaml .= $indent . "$key: []\n";
+ }
+ }
+ elsif( ref $val and !blessed($val) ) {
+ croak "only nested hashes, arrays and objects are supported";
+ }
+ else { # if it's an object, just stringify it
+ $yaml .= $indent . sprintf "$k_format %s\n", "$key:", $val;
+ }
};
- $meta .= <<"YAML";
-requires: $prereq_pm
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
-YAML
+ return $yaml;
- $meta .= $self->{EXTRA_META} if $self->{EXTRA_META};
+}
- my @write_meta = $self->echo($meta, 'META_new.yml');
+sub blessed {
+ return eval { $_[0]->isa("UNIVERSAL"); };
+}
- return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta);
-metafile : create_distdir
- $(NOECHO) $(ECHO) Generating META.yml
- %s
- -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
-MAKE_FRAG
+sub max {
+ return (sort { $b <=> $a } @_)[0];
+}
+
+sub min {
+ return (sort { $a <=> $b } @_)[0];
+}
+
+=head3 metafile_file
+
+ my $meta_yml = $mm->metafile_file(@metadata_pairs);
+
+Turns the @metadata_pairs into YAML.
+
+This method does not implement a complete YAML dumper, being limited
+to dump a hash with values which are strings, undef's or nested hashes
+and arrays of strings. No quoting/escaping is done.
+
+=cut
+
+sub metafile_file {
+ my $self = shift;
+
+ my %dump_options = (
+ use_header => 1,
+ delta => ' ' x 4,
+ key_sort => undef,
+ );
+ return _dump_hash(\%dump_options, @_);
}
diff --git a/lib/ExtUtils/MM_BeOS.pm b/lib/ExtUtils/MM_BeOS.pm
index d0749797d9..807658bcb2 100644
--- a/lib/ExtUtils/MM_BeOS.pm
+++ b/lib/ExtUtils/MM_BeOS.pm
@@ -26,7 +26,7 @@ require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.44';
+our $VERSION = '6.46';
=item os_flavor
diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm
index fa1158fc0d..2a110c215d 100644
--- a/lib/ExtUtils/MM_Cygwin.pm
+++ b/lib/ExtUtils/MM_Cygwin.pm
@@ -9,7 +9,7 @@ require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.44';
+our $VERSION = '6.46';
=head1 NAME
diff --git a/lib/ExtUtils/MM_DOS.pm b/lib/ExtUtils/MM_DOS.pm
index f575349974..f9f38291eb 100644
--- a/lib/ExtUtils/MM_DOS.pm
+++ b/lib/ExtUtils/MM_DOS.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_DOS;
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm
index c9fcc0b8fe..3102e19efb 100644
--- a/lib/ExtUtils/MM_MacOS.pm
+++ b/lib/ExtUtils/MM_MacOS.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_MacOS;
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
sub new {
die <<'UNSUPPORTED';
diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm
index 4e96e1d5a3..4e18871a7c 100644
--- a/lib/ExtUtils/MM_NW5.pm
+++ b/lib/ExtUtils/MM_NW5.pm
@@ -22,7 +22,7 @@ use strict;
use ExtUtils::MakeMaker::Config;
use File::Basename;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Win32;
our @ISA = qw(ExtUtils::MM_Win32);
diff --git a/lib/ExtUtils/MM_OS2.pm b/lib/ExtUtils/MM_OS2.pm
index 8e40629fe6..7eafc55759 100644
--- a/lib/ExtUtils/MM_OS2.pm
+++ b/lib/ExtUtils/MM_OS2.pm
@@ -5,7 +5,7 @@ use strict;
use ExtUtils::MakeMaker qw(neatvalue);
use File::Spec;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
diff --git a/lib/ExtUtils/MM_QNX.pm b/lib/ExtUtils/MM_QNX.pm
index 882f91e427..04730c5a1b 100644
--- a/lib/ExtUtils/MM_QNX.pm
+++ b/lib/ExtUtils/MM_QNX.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_QNX;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_UWIN.pm b/lib/ExtUtils/MM_UWIN.pm
index c9bf8775e6..bcd91ee915 100644
--- a/lib/ExtUtils/MM_UWIN.pm
+++ b/lib/ExtUtils/MM_UWIN.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_UWIN;
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 1e5e98b2af..e79d67dddb 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue);
# If we make $VERSION an our variable parse_version() breaks
use vars qw($VERSION);
-$VERSION = '6.44_01';
+$VERSION = '6.46_01';
require ExtUtils::MM_Any;
our @ISA = qw(ExtUtils::MM_Any);
diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm
index 30ddbf02c2..9e8d75653f 100644
--- a/lib/ExtUtils/MM_VMS.pm
+++ b/lib/ExtUtils/MM_VMS.pm
@@ -15,7 +15,7 @@ BEGIN {
use File::Basename;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
diff --git a/lib/ExtUtils/MM_VOS.pm b/lib/ExtUtils/MM_VOS.pm
index 0a56b23bf2..87bb8eafe9 100644
--- a/lib/ExtUtils/MM_VOS.pm
+++ b/lib/ExtUtils/MM_VOS.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_VOS;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm
index 8c14e4ad07..c2160ca7f4 100644
--- a/lib/ExtUtils/MM_Win32.pm
+++ b/lib/ExtUtils/MM_Win32.pm
@@ -27,7 +27,7 @@ use ExtUtils::MakeMaker qw( neatvalue );
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.44';
+our $VERSION = '6.46';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
@@ -129,9 +129,9 @@ sub init_DIRFILESEP {
my $make = $self->make;
# The ^ makes sure its not interpreted as an escape in nmake
- $self->{DIRFILESEP} = $make eq 'nmake' ? '^\\' :
- $make eq 'dmake' ? '\\\\'
- : '\\';
+ $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' :
+ $self->is_make_type('dmake') ? '\\\\'
+ : '\\';
}
=item B<init_others>
@@ -234,7 +234,7 @@ sub special_targets {
my $make_frag = $self->SUPER::special_targets;
- $make_frag .= <<'MAKE_FRAG' if $self->make eq 'dmake';
+ $make_frag .= <<'MAKE_FRAG' if $self->is_make_type('dmake');
.USESHELL :
MAKE_FRAG
@@ -329,7 +329,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
} elsif ($BORLAND) {
push(@m,
q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
- .($self->make eq 'dmake'
+ .($self->is_make_type('dmake')
? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
.q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
: q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
@@ -417,7 +417,7 @@ banner.
sub pasthru {
my($self) = shift;
- return "PASTHRU = " . ($self->make eq 'nmake' ? "-nologo" : "");
+ return "PASTHRU = " . ($self->is_make_type('nmake') ? "-nologo" : "");
}
@@ -456,7 +456,7 @@ sub quote_literal {
# quotes; however it transforms {{ into { either inside and outside double
# quotes. It also translates }} into }. The escaping below is not
# 100% correct.
- if( $self->make eq 'dmake' ) {
+ if( $self->is_make_type('dmake') ) {
$text =~ s/{/{{/g;
$text =~ s/}}/}}}/g;
}
@@ -492,7 +492,7 @@ NOTE: This only works with simple relative directories. Throw it an absolute di
sub cd {
my($self, $dir, @cmds) = @_;
- return $self->SUPER::cd($dir, @cmds) unless $self->make eq 'nmake';
+ return $self->SUPER::cd($dir, @cmds) unless $self->is_make_type('nmake');
my $cmd = join "\n\t", map "$_", @cmds;
@@ -562,6 +562,11 @@ PERLTYPE = $self->{PERLTYPE}
}
+sub is_make_type {
+ my($self, $type) = @_;
+ return !! ($self->make =~ /\b$type(?:\.exe)?$/);
+}
+
1;
__END__
diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm
index ab54f703c4..f97a0c81fd 100644
--- a/lib/ExtUtils/MM_Win95.pm
+++ b/lib/ExtUtils/MM_Win95.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_Win95;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require ExtUtils::MM_Win32;
our @ISA = qw(ExtUtils::MM_Win32);
diff --git a/lib/ExtUtils/MY.pm b/lib/ExtUtils/MY.pm
index 1f7b5c5e28..faf68a62f3 100644
--- a/lib/ExtUtils/MY.pm
+++ b/lib/ExtUtils/MY.pm
@@ -3,7 +3,7 @@ package ExtUtils::MY;
use strict;
require ExtUtils::MM;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
our @ISA = qw(ExtUtils::MM);
{
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index f2bda1ff54..261808cb59 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -1,4 +1,4 @@
-# $Id: /local/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 54639 2008-02-29T00:06:55.056100Z schwern $
+# $Id: /local/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 66493 2008-09-27T21:35:25.560547Z schwern $
package ExtUtils::MakeMaker;
use strict;
@@ -13,13 +13,13 @@ use File::Path;
our $Verbose = 0; # exported
our @Parent; # needs to be localized
our @Get_from_Config; # referenced by MM_Unix
-my @MM_Sections;
-my @Overridable;
+our @MM_Sections;
+our @Overridable;
my @Prepend_parent;
my %Recognized_Att_Keys;
-our $VERSION = '6.44';
-our ($Revision) = q$Revision: 54639 $ =~ /Revision:\s+(\S+)/;
+our $VERSION = '6.46';
+our ($Revision) = q$Revision: 66493 $ =~ /Revision:\s+(\S+)/;
our $Filename = __FILE__; # referenced outside MakeMaker
our @ISA = qw(Exporter);
@@ -39,7 +39,7 @@ require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect
# loading ExtUtils::MakeMaker will give them MY.
- # This will go when Embed is it's own CPAN module.
+ # This will go when Embed is its own CPAN module.
sub WriteMakefile {
@@ -77,6 +77,8 @@ my %Special_Sigs = (
LIBS => ['ARRAY',''],
MAN1PODS => 'HASH',
MAN3PODS => 'HASH',
+ META_ADD => 'HASH',
+ META_MERGE => 'HASH',
PL_FILES => 'HASH',
PM => 'HASH',
PMLIBDIRS => 'ARRAY',
@@ -214,7 +216,7 @@ sub full_setup {
AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS
- EXCLUDE_EXT EXE_FILES EXTRA_META FIRST_MAKEFILE
+ EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
FULLPERL FULLPERLRUN FULLPERLRUNINST
FUNCLIST H IMPORTS
@@ -233,7 +235,8 @@ sub full_setup {
SITELIBEXP SITEARCHEXP
INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
- LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+ LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+ META_ADD META_MERGE
MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE
PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE
PERL_SRC PERM_RW PERM_RWX
@@ -1807,6 +1810,19 @@ C<make> and will be installed during C<make install>.
If it is intended, that a new perl binary be produced, this variable
may hold a name for that binary. Defaults to perl
+=item META_ADD
+
+=item META_MERGE
+
+A hashrefs of items to add to the F<META.yml>.
+
+They differ in how they behave if they have the same key as the
+default metadata. META_ADD will override the default value with it's
+own. META_MERGE will merge its value with the default.
+
+Unless you want to override the defaults, prefer META_MERGE so as to
+get the advantage of any future defaults.
+
=item MYEXTLIB
If the extension links to a library that it builds set this to the
@@ -2186,7 +2202,7 @@ MakeMaker object. The following lines will be parsed o.k.:
$VERSION = '1.00';
*VERSION = \'1.01';
- ($VERSION) = q$Revision: 54639 $ =~ /(\d+)/g;
+ ($VERSION) = q$Revision: 66493 $ =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
diff --git a/lib/ExtUtils/MakeMaker/Config.pm b/lib/ExtUtils/MakeMaker/Config.pm
index 43dec5dbd1..7744210884 100644
--- a/lib/ExtUtils/MakeMaker/Config.pm
+++ b/lib/ExtUtils/MakeMaker/Config.pm
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::Config;
use strict;
-our $VERSION = '6.44';
+our $VERSION = '6.46';
use Config ();
diff --git a/lib/ExtUtils/MakeMaker/bytes.pm b/lib/ExtUtils/MakeMaker/bytes.pm
index 16b7030906..4ac989ce2a 100644
--- a/lib/ExtUtils/MakeMaker/bytes.pm
+++ b/lib/ExtUtils/MakeMaker/bytes.pm
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::bytes;
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
my $Have_Bytes = eval { require bytes; 1; };
diff --git a/lib/ExtUtils/MakeMaker/vmsish.pm b/lib/ExtUtils/MakeMaker/vmsish.pm
index fc5466ba75..1765e8bdd7 100644
--- a/lib/ExtUtils/MakeMaker/vmsish.pm
+++ b/lib/ExtUtils/MakeMaker/vmsish.pm
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::vmsish;
use strict;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
my $IsVMS = $^O eq 'VMS';
diff --git a/lib/ExtUtils/Mkbootstrap.pm b/lib/ExtUtils/Mkbootstrap.pm
index 0a344d1eca..462ae2c179 100644
--- a/lib/ExtUtils/Mkbootstrap.pm
+++ b/lib/ExtUtils/Mkbootstrap.pm
@@ -3,7 +3,7 @@ package ExtUtils::Mkbootstrap;
# There's just too much Dynaloader incest here to turn on strict vars.
use strict 'refs';
-our $VERSION = '6.44';
+our $VERSION = '6.46';
require Exporter;
our @ISA = ('Exporter');
diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm
index c6de8957a2..4114f4bb12 100644
--- a/lib/ExtUtils/Mksymlists.pm
+++ b/lib/ExtUtils/Mksymlists.pm
@@ -10,7 +10,7 @@ use Config;
our @ISA = qw(Exporter);
our @EXPORT = qw(&Mksymlists);
-our $VERSION = '6.44';
+our $VERSION = '6.46';
sub Mksymlists {
my(%spec) = @_;
diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t
index 1f2762ec83..476bf2483d 100644
--- a/lib/ExtUtils/t/MM_Unix.t
+++ b/lib/ExtUtils/t/MM_Unix.t
@@ -35,17 +35,16 @@ my $os = ($ExtUtils::MM_Unix::Is{OS2} || 0)
+ ($ExtUtils::MM_Unix::Is{Win32} || 0)
+ ($ExtUtils::MM_Unix::Is{Dos} || 0)
+ ($ExtUtils::MM_Unix::Is{VMS} || 0);
-ok ( $os <= 1, 'There can be only one (or none)');
+cmp_ok ( $os, '<=', 1, 'There can be only one (or none)');
-cmp_ok ($ExtUtils::MM_Unix::VERSION, '>=', '1.12606', 'Should be at least version 1.12606');
+is($ExtUtils::MM_Unix::VERSION, $ExtUtils::MakeMaker::VERSION, 'MM_Unix has a $VERSION');
# when the following calls like canonpath, catdir etc are replaced by
# File::Spec calls, the test's become a bit pointless
-foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) )
- {
- is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
- }
+foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) ) {
+ is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
+}
is ($class->catdir('xx','xx'), File::Spec->catdir('xx','xx'),
'catdir(xx, xx) => xx/xx');
@@ -198,10 +197,9 @@ is ($t->perm_rwx(),'755', 'perm_rwx() is 755');
###############################################################################
# post_constants, postamble, post_initialize
-foreach (qw/ post_constants postamble post_initialize/)
- {
+foreach (qw/ post_constants postamble post_initialize/) {
is ($t->$_(),'', "$_() is an empty string");
- }
+}
###############################################################################
# replace_manpage_separator
diff --git a/lib/ExtUtils/t/MM_Win32.t b/lib/ExtUtils/t/MM_Win32.t
index 866c135bc5..c779da2c4e 100644
--- a/lib/ExtUtils/t/MM_Win32.t
+++ b/lib/ExtUtils/t/MM_Win32.t
@@ -16,7 +16,7 @@ use Test::More;
BEGIN {
if ($^O =~ /MSWin32/i) {
- plan tests => 41;
+ plan tests => 49;
} else {
plan skip_all => 'This is not Win32';
}
@@ -234,6 +234,37 @@ EOSCRIPT
}
unlink "${script_name}$script_ext" if -f "${script_name}$script_ext";
+# is_make_type()
+{
+ # Check for literal nmake
+ SKIP: {
+ skip("Not using 'nmake'", 2) unless $Config{make} eq 'nmake';
+ ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' );
+ ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' );
+ }
+
+ # Check for literal nmake
+ SKIP: {
+ skip("Not using /nmake/", 2) unless $Config{make} =~ /nmake/;
+ ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' );
+ ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' );
+ }
+
+ # Check for literal dmake
+ SKIP: {
+ skip("Not using 'dmake'", 2) unless $Config{make} eq 'dmake';
+ ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' );
+ ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' );
+ }
+
+ # Check for literal dmake
+ SKIP: {
+ skip("Not using /dmake/", 2) unless $Config{make} =~ /dmake/;
+ ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' );
+ ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' );
+ }
+
+}
# xs_o() should look into that
# top_targets() should look into that
diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t
index 64352d85cb..b26b3e2886 100644
--- a/lib/ExtUtils/t/basic.t
+++ b/lib/ExtUtils/t/basic.t
@@ -17,7 +17,7 @@ use strict;
use Config;
use ExtUtils::MakeMaker;
-use Test::More tests => 83;
+use Test::More tests => 85;
use MakeMaker::Test::Utils;
use MakeMaker::Test::Setup::BFD;
use File::Find;
@@ -250,25 +250,40 @@ ok( !-f 'META.yml', 'META.yml not written to source dir' );
ok( -f $meta_yml, 'META.yml written to dist dir' );
ok( !-e "META_new.yml", 'temp META.yml file not left around' );
+SKIP: {
+ # META.yml spec 1.4 was added in 0.11
+ skip "Test::YAML::Meta >= 0.11 required", 2
+ unless eval { require Test::YAML::Meta } and
+ Test::YAML::Meta->VERSION >= 0.11;
+
+ Test::YAML::Meta::meta_spec_ok($meta_yml);
+}
+
ok open META, $meta_yml or diag $!;
my $meta = join '', <META>;
ok close META;
is $meta, <<"END";
--- #YAML:1.0
-name: Big-Dummy
-version: 0.01
-abstract: Try "our" hot dog's
-license: ~
-author:
+name: Big-Dummy
+version: 0.01
+abstract: Try "our" hot dog's
+author:
- Michael G Schwern <schwern\@pobox.com>
-generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
-distribution_type: module
-requires:
- strict: 0
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ strict: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
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
END
my $manifest = maniread("$distdir/MANIFEST");
diff --git a/lib/ExtUtils/t/metafile_data.t b/lib/ExtUtils/t/metafile_data.t
new file mode 100644
index 0000000000..597e448cf1
--- /dev/null
+++ b/lib/ExtUtils/t/metafile_data.t
@@ -0,0 +1,135 @@
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 3;
+
+use Data::Dumper;
+
+require ExtUtils::MM_Any;
+
+my $new_mm = sub {
+ return bless {@_}, 'ExtUtils::MM_Any';
+};
+
+{
+ my $mm = $new_mm->(
+ DISTNAME => 'Foo-Bar',
+ VERSION => 1.23,
+ PM => {
+ "Foo::Bar" => 'lib/Foo/Bar.pm',
+ },
+ );
+
+ is_deeply [$mm->metafile_data], [
+ name => 'Foo-Bar',
+ version => 1.23,
+ abstract => undef,
+ author => [],
+ license => 'unknown',
+ distribution_type => 'module',
+
+ configure_requires => {
+ 'ExtUtils::MakeMaker' => 0,
+ },
+
+ no_index => {
+ directory => [qw(t inc)],
+ },
+
+ generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ 'meta-spec' => {
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ version => 1.4
+ },
+ ];
+
+
+ is_deeply [$mm->metafile_data({}, { no_index => { directory => [qw(foo)] } })], [
+ name => 'Foo-Bar',
+ version => 1.23,
+ abstract => undef,
+ author => [],
+ license => 'unknown',
+ distribution_type => 'module',
+
+ configure_requires => {
+ 'ExtUtils::MakeMaker' => 0,
+ },
+
+ no_index => {
+ directory => [qw(t inc foo)],
+ },
+
+ generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ 'meta-spec' => {
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ version => 1.4
+ },
+ ], 'rt.cpan.org 39348';
+}
+
+
+{
+ my $mm = $new_mm->(
+ DISTNAME => 'Foo-Bar',
+ VERSION => 1.23,
+ AUTHOR => 'Some Guy',
+ PREREQ_PM => {
+ Foo => 2.34,
+ Bar => 4.56,
+ },
+ );
+
+ is_deeply [$mm->metafile_data(
+ {
+ configure_requires => {
+ Stuff => 2.34
+ },
+ wobble => 42
+ },
+ {
+ no_index => {
+ package => "Thing"
+ },
+ wibble => 23
+ },
+ )],
+ [
+ name => 'Foo-Bar',
+ version => 1.23,
+ abstract => undef,
+ author => ['Some Guy'],
+ license => 'unknown',
+ distribution_type => 'script',
+
+ configure_requires => {
+ Stuff => 2.34,
+ },
+ requires => {
+ Foo => 2.34,
+ Bar => 4.56,
+ },
+
+ no_index => {
+ directory => [qw(t inc)],
+ package => 'Thing',
+ },
+
+ generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ 'meta-spec' => {
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ version => 1.4
+ },
+
+ wibble => 23,
+ wobble => 42,
+ ];
+}
diff --git a/lib/ExtUtils/t/metafile_file.t b/lib/ExtUtils/t/metafile_file.t
new file mode 100644
index 0000000000..6a67882933
--- /dev/null
+++ b/lib/ExtUtils/t/metafile_file.t
@@ -0,0 +1,293 @@
+#!/usr/bin/perl -w
+
+# This is a test of the fake YAML dumper implemented by EUMM:
+# ExtUtils::MM_Any::metafile_file
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 13;
+
+require ExtUtils::MM_Any;
+
+my $mm = bless {}, 'ExtUtils::MM_Any';
+
+{
+ my @meta = ( a => 1, b => 2 );
+ my $expected = <<YAML;
+--- #YAML:1.0
+a: 1
+b: 2
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "dump for flat hashes works ok");
+}
+
+{
+ my @meta = ( k1 => 'some key and value', k2 => undef, k3 => 1 );
+ my $expected = <<YAML;
+--- #YAML:1.0
+k1: some key and value
+k2: ~
+k3: 1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "dumping strings and undefs is ok");
+}
+
+{
+ my @meta = ( a => 1, b => 2, h => { hh => 1 } );
+ my $expected = <<YAML;
+--- #YAML:1.0
+a: 1
+b: 2
+h:
+ hh: 1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "dump for nested hashes works ok");
+}
+
+{
+ my @meta = ( a => 1, b => 2, h => { h1 => 'x', h2 => 'z' } );
+ my $expected = <<YAML;
+--- #YAML:1.0
+a: 1
+b: 2
+h:
+ h1: x
+ h2: z
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "nested hashes sort ascii-betically");
+ # to tell the truth, they sort case-insensitively
+ # that's hard to test for Perl with unstable sort's
+}
+
+{
+ my @meta = ( a => 1, b => 2, h => { hh => { hhh => 1 } } );
+ my $expected = <<YAML;
+--- #YAML:1.0
+a: 1
+b: 2
+h:
+ hh:
+ hhh: 1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "dump for hashes (with more nesting) works ok");
+}
+
+{
+ my @meta = ( a => 1, k => [ qw(w y z) ] );
+ my $expected = <<YAML;
+--- #YAML:1.0
+a: 1
+k:
+ - w
+ - y
+ - z
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "array of strings are handled ok");
+}
+
+is($mm->metafile_file( a => {}, b => [], c => undef ), <<'YAML', 'empty hashes and arrays');
+--- #YAML:1.0
+a: {}
+b: []
+c: ~
+YAML
+
+
+{
+ my @meta = (
+ name => 'My-Module',
+ version => '0.1',
+ version_from => 'lib/My/Module.pm',
+ installdirs => 'site',
+ abstract => 'A does-it-all module',
+ license => 'perl',
+ generated_by => 'myself',
+ author => 'John Doe <doe@doeland.org>',
+ distribution_type => 'module',
+ requires => {
+ 'My::Module::Helper' => 0,
+ 'Your::Module' => '1.5',
+ },
+ 'meta-spec' => {
+ version => '1.1',
+ url => 'http://module-build.sourceforge.net/META-spec-new.html',
+ },
+ );
+ my $expected = <<'YAML';
+--- #YAML:1.0
+name: My-Module
+version: 0.1
+version_from: lib/My/Module.pm
+installdirs: site
+abstract: A does-it-all module
+license: perl
+generated_by: myself
+author: John Doe <doe@doeland.org>
+distribution_type: module
+requires:
+ My::Module::Helper: 0
+ Your::Module: 1.5
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-new.html
+ version: 1.1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "dump for something like META.yml works");
+}
+
+{
+ my @meta = (
+ name => 'My-Module',
+ version => '0.1',
+ version_from => 'lib/My/Module.pm',
+ installdirs => 'site',
+ abstract => 'A does-it-all module',
+ license => 'perl',
+ generated_by => 'myself',
+ author => 'John Doe <doe@doeland.org>',
+ distribution_type => 'module',
+ requires => {
+ 'My::Module::Helper' => 0,
+ 'Your::Module' => '1.5',
+ },
+ recommends => {
+ 'Test::More' => 0,
+ 'Test::Pod' => 1.18,
+ 'Test::Pod::Coverage' => 1
+ },
+ 'meta-spec' => {
+ version => '1.1',
+ url => 'http://module-build.sourceforge.net/META-spec-new.html',
+ },
+ );
+ my $expected = <<'YAML';
+--- #YAML:1.0
+name: My-Module
+version: 0.1
+version_from: lib/My/Module.pm
+installdirs: site
+abstract: A does-it-all module
+license: perl
+generated_by: myself
+author: John Doe <doe@doeland.org>
+distribution_type: module
+requires:
+ My::Module::Helper: 0
+ Your::Module: 1.5
+recommends:
+ Test::More: 0
+ Test::Pod: 1.18
+ Test::Pod::Coverage: 1
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-new.html
+ version: 1.1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "META.yml with extra 'recommends' works");
+}
+
+{
+ my @meta = (
+ name => 'My-Module',
+ version => '0.1',
+ version_from => 'lib/My/Module.pm',
+ installdirs => 'site',
+ abstract => 'A does-it-all module',
+ license => 'perl',
+ generated_by => 'myself',
+ author => 'John Doe <doe@doeland.org>',
+ distribution_type => 'module',
+ requires => {
+ 'My::Module::Helper' => 0,
+ 'Your::Module' => '1.5',
+ },
+ recommends => {
+ 'Test::More' => 0,
+ 'Test::Pod' => 1.18,
+ 'Test::Pod::Coverage' => 1
+ },
+ no_index => {
+ dir => [ qw(inc) ],
+ file => [ qw(TODO NOTES) ],
+ },
+ 'meta-spec' => {
+ version => '1.1',
+ url => 'http://module-build.sourceforge.net/META-spec-new.html',
+ },
+ );
+ my $expected = <<'YAML';
+--- #YAML:1.0
+name: My-Module
+version: 0.1
+version_from: lib/My/Module.pm
+installdirs: site
+abstract: A does-it-all module
+license: perl
+generated_by: myself
+author: John Doe <doe@doeland.org>
+distribution_type: module
+requires:
+ My::Module::Helper: 0
+ Your::Module: 1.5
+recommends:
+ Test::More: 0
+ Test::Pod: 1.18
+ Test::Pod::Coverage: 1
+no_index:
+ dir:
+ - inc
+ file:
+ - TODO
+ - NOTES
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-new.html
+ version: 1.1
+YAML
+
+ is($mm->metafile_file(@meta), $expected, "META.yml with extra 'no_index' works");
+}
+
+{
+ my @meta = ( k => 'a : b', 'x : y' => 1 );
+ my $expected = <<YAML;
+--- #YAML:1.0
+k: a : b
+x : y: 1
+YAML
+ # NOTE: the output is not YAML-equivalent to the input
+
+ is($mm->metafile_file(@meta), $expected, "no quoting is done");
+}
+
+{
+ my @meta = ( k => \*STDOUT );
+ eval { $mm->metafile_file(@meta) };
+
+ like($@, qr/^only nested hashes, arrays and objects are supported/,
+ "we don't like but hash/array refs");
+}
+
+{
+ my @meta = ( k => [ [] ] );
+ eval { $mm->metafile_file(@meta) };
+
+ like($@, qr/^only nested arrays of non-refs are supported/,
+ "we also don't like but array of strings");
+}
+
+# recursive data structures: don't even think about it - endless recursion
diff --git a/lib/ExtUtils/t/writemakefile_args.t b/lib/ExtUtils/t/writemakefile_args.t
index da274d6cc7..efe104d0cd 100644
--- a/lib/ExtUtils/t/writemakefile_args.t
+++ b/lib/ExtUtils/t/writemakefile_args.t
@@ -14,7 +14,7 @@ BEGIN {
}
use strict;
-use Test::More tests => 28;
+use Test::More tests => 30;
use TieOut;
use MakeMaker::Test::Utils;
@@ -126,8 +126,8 @@ VERIFY
$warnings = '';
eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => [1,2,3],
+ NAME => 'Big::Dummy',
+ VERSION => [1,2,3],
);
};
like( $warnings, qr{^WARNING: VERSION takes a version object or string/number} );
@@ -135,8 +135,8 @@ VERIFY
$warnings = '';
eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => 1.002_003,
+ NAME => 'Big::Dummy',
+ VERSION => 1.002_003,
);
};
is( $warnings, '' );
@@ -145,8 +145,8 @@ VERIFY
$warnings = '';
eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => '1.002_003',
+ NAME => 'Big::Dummy',
+ VERSION => '1.002_003',
);
};
is( $warnings, '' );
@@ -156,39 +156,39 @@ VERIFY
$warnings = '';
eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => bless {}, "Some::Class",
+ NAME => 'Big::Dummy',
+ VERSION => bless {}, "Some::Class",
);
};
like( $warnings, '/^WARNING: VERSION takes a version object or string/number not a Some::Class object/' );
SKIP: {
- skip("Can't test version objects",6) unless eval { require version };
+ skip("Can't test version objects", 8) unless eval { require version };
version->import;
my $version = version->new("1.2.3");
$warnings = '';
- eval {
+ ok eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => $version,
+ NAME => 'Big::Dummy',
+ VERSION => $version,
);
- };
+ } || diag $@;
is( $warnings, '' );
isa_ok( $mm->{VERSION}, 'version' );
is( $mm->{VERSION}, $version );
$warnings = '';
$version = qv('1.2.3');
- eval {
+ ok eval {
$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => $version,
+ NAME => 'Big::Dummy',
+ VERSION => $version,
);
- };
+ } || diag $@;
is( $warnings, '' );
isa_ok( $mm->{VERSION}, 'version' );
is( $mm->{VERSION}, $version );
}
-} \ No newline at end of file
+}
diff --git a/lib/ExtUtils/testlib.pm b/lib/ExtUtils/testlib.pm
index bb89a65f59..0325570f00 100644
--- a/lib/ExtUtils/testlib.pm
+++ b/lib/ExtUtils/testlib.pm
@@ -3,7 +3,7 @@ package ExtUtils::testlib;
use strict;
use warnings;
-our $VERSION = 6.44;
+our $VERSION = 6.46;
use Cwd;
use File::Spec;