summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Module-Build
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Build')
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/Changes375
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/bin/config_data249
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build.pm141
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod223
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod9
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm804
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm23
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm6
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm3
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm23
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm8
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm50
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Version.pm681
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/YAML.pm603
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest/private.pm2
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/actions/installdeps.t4
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/actions/manifest_skip.t54
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/basic.t4
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/bundled/Software/License.pm56
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/compat.t72
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm23
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm24
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm11
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm17
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/metadata2.t5
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/mymeta.t80
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/properties/dist_suffix.t33
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/properties/license.t66
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/properties/release_status.t204
-rw-r--r--gnu/usr.bin/perl/cpan/Module-Build/t/properties/requires.t54
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/properties/share_dir.t16
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/runthrough.t9
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/script_dist.t19
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Build/t/tilde.t20
51 files changed, 2270 insertions, 1735 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/Changes b/gnu/usr.bin/perl/cpan/Module-Build/Changes
index ad9195c5456..02f73b079fd 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/Changes
+++ b/gnu/usr.bin/perl/cpan/Module-Build/Changes
@@ -1,5 +1,380 @@
Revision history for Perl extension Module::Build.
+0.39_01 - Thu Jul 21 16:48:48 EDT 2011
+
+ [BUG FIXES]
+
+ - Fixed bug with a nested directory named 'share' inside a ShareDir
+ (RT#68585) [David Golden]
+
+ - Fixed failing tilde.t when run under UID without passwd entry
+ (RT#67893) [Dominic Hargreaves]
+
+ [DOCUMENTATION]
+
+ - Fixed typo in Module::Build (RT#67008) [David Golden]
+
+ [OTHER]
+
+ - Pod to HTML internals changed to support new Pod::Html work
+ in the Perl core
+
+0.3800 - Sat Mar 5 15:11:41 EST 2011
+
+ Summary of major changes since 0.3624:
+
+ [ENHANCEMENTS]
+
+ - Generates META.json and MYMETA.json consistent with version 2 of the
+ CPAN Meta Spec. [David Golden]
+
+ Also in this release:
+
+ [BUG FIXES]
+
+ - Autogenerated documentation no longer includes private actions from
+ Module::Build's own release subclass. [Report by Timothy Appnel,
+ fix by David Golden]
+
+0.37_06 - Mon Feb 28 21:43:31 EST 2011
+
+ [BUG FIXES]
+
+ - prerequisites with the empty string instead of a version are
+ normalized to "0". (RT#65909)
+
+ [OTHER]
+
+ - More Pod typo/link fixes [Hongwen Qiu]
+
+0.37_05 - Sat Feb 19 20:43:23 EST 2011
+
+ [BUG FIXES]
+
+ - fixes failing ppm.t in perl core
+
+ [OTHER]
+
+ - Pod typo fixes [Hongwen Qiu]
+
+0.37_04 - Wed Feb 16 15:27:21 EST 2011
+
+ [OTHER]
+
+ - moved scripts/ to bin/ for less confusing porting to bleadperl
+
+0.37_03 - Wed Feb 16 09:54:05 EST 2011
+
+ [BUG FIXES]
+
+ - removed an irrelevant test in t/actions/installdeps.t that was causing
+ failures on some Cygwin platforms
+
+ [OTHER]
+
+ - dropped configure_requires as some CPAN clients apparently get
+ confused by having things in both configure_requires and requires
+
+ - bumped Parse::CPAN::Meta build prereq to 1.4401
+
+ - bumped CPAN::Meta prereq to 2.110420
+
+ - Pod typo fixes [Hongwen Qiu]
+
+0.37_02 - Mon Feb 7 21:05:30 EST 2011
+
+ [BUG FIXES]
+
+ - bumped CPAN::Meta prereq to 2.110390 to avoid a regression in 2.110360
+
+0.37_01 - Thu Feb 3 03:44:38 EST 2011
+
+ [ENHANCEMENTS]
+
+ - Generates META.json and MYMETA.json consistent with version 2 of the
+ CPAN Meta Spec. [David Golden]
+
+ [BUG FIXES]
+
+ - t/signature.t now uses a mocked Module::Signature; this should be
+ more robust across platforms as it only needs to confirm that
+ Module::Build is calling Module::Signature when expected
+
+ [OTHER]
+
+ - Added CPAN::Meta and Parse::CPAN::Meta to prerequisites and dropped
+ CPAN::Meta::YAML
+
+0.3624 - Thu Jan 27 11:38:39 EST 2011
+
+ - Fixed pod2html directory bugs and fixed creation of spurious blib
+ directory in core perl directory when running install.t (RT#63003)
+ [Chris Williams]
+
+0.3623 - Wed Jan 26 17:45:30 EST 2011
+
+ - Fixed bugs involving bootstrapping configure_requires prerequisites
+ on older CPANPLUS clients or for either CPAN/CPANPLUS when using
+ the compatibility Makefile.PL
+
+ - Added diagnostic output when configure_requires are missing for
+ the benefit of users doing manual installation
+
+0.3622 - Mon Jan 24 21:06:50 EST 2011
+
+ - No changes from 0.36_21
+
+0.36_21 - Fri Jan 21 11:01:28 EST 2011
+
+ - Changed YAML::Tiny references to the new CPAN::Meta::YAML module
+ instead, which is the YAML-variant that is going into the Perl core
+
+0.36_20 - Fri Dec 10 15:36:03 EST 2010
+
+ *** DEPRECATIONS ***
+
+ - Module::Build::Version has been deprecated. Module::Build now depends
+ directly upon version.pm. A pure-perl version has been bundled in inc/
+ solely for bootstrapping in case configure_requires is not supported.
+ M::B::Version remains as a wrapper around version.pm.
+
+ - Module::Build::ModuleInfo has been deprecated. Module::Build now
+ depends directly upon Module::Metadata (which is an extraction of
+ M::B::ModuleInfo intended for general reuse). A pure-perl version has
+ been bundled in inc/ solely for bootstrapping in case
+ configure_requires is not supported. M::B::ModuleInfo remains as a
+ wrapper around Module::Metadata.
+
+ - Module::Build::YAML has been deprecated. Module::Build now depends
+ directly upon YAML::Tiny. M::B::YAML remains as a subclass wrapper.
+ The YAML_support feature has been removed, as YAML is now an ordinary
+ dependency.
+
+0.36_19 - Tue Dec 7 13:43:42 EST 2010
+
+ Bug fixes:
+
+ - Perl::OSType is declared as a 'configure_requires' dependency, but is
+ also bundled in inc (and loaded if needed) [David Golden]
+
+0.36_18 - Mon Dec 6 16:46:49 EST 2010
+
+ Changes:
+
+ - Added dependency on Perl::OSType to refactor and centralize
+ management of OS type mapping [David Golden]
+
+ - When parsing a version number out of a file, any trailing alphabetical
+ characters will be dropped to avoid fatal errors when comparing version
+ numbers. These would have been dropped (with a warning) anyway during
+ an ordinary numeric comparison. (RT#56071) [David Golden]
+
+ Bug fixes:
+
+ - A Perl interpreter mismatch between running Build.PL and running Build
+ is now a fatal error, not a warning (RT#55183) [David Golden]
+
+ - Bundled Module::Build::Version updated to bring into sync with CPAN
+ version.pm 0.86 [David Golden]
+
+ - No longer uses fake user 'foo' in t/tilde (RT#61793) [David Golden]
+
+ - Won't fail tests if an ancient Tie::IxHash is installed
+ [Christopher J. Madsen]
+
+ - Correctly report missing metafile field names [David Golden]
+
+ - Suppress uninitialized value errors during Pod creation
+ on ActiveState Perl [David Golden]
+
+ - Return to starting directory after install action; this is
+ an attempt to fix an install.t heisenbug (RT#63003) [David Golden]
+
+ - A broken version.pm load won't cause Module::Build::Version to
+ die trying to install itself as a mock version (RT#59499)
+ [Eric Wilhelm and David Golden]
+
+ - PERL_DL_NONLAZY is now always set when tests are run
+ (RT#56055) [Dmitry Karasik]
+
+ - 'fakeinstall' will use .modulebuildrc actions for 'install' if
+ no specific 'fakeinstall' options are provided (RT#57279)
+ [David Golden]
+
+ - Add install*script to search path for installdeps client
+ and search site, then vendor, then core paths
+
+ - Skip noexec tmpdir check on Windows (RT#55667) [Jan Dubois]
+
+ - Arguments with key value pairs may now have keys with "-" in them
+ (RT#53050) [David Golden]
+
+ - Add quotemeta to t/tilde.t test to fix Cygwin fails
+ [Chris Williams and David Golden]
+
+ - Build script now checks that M::B is at least the same version
+ of M::B as provided in 'configure_requires' in META
+ (RT#54954) [David Golden]
+
+0.36_17 - Wed Oct 27 18:08:36 EDT 2010
+
+ Enhancements:
+
+ - Added 'distinstall' action to run 'Build install' inside the
+ generated distribution directory [Jeff Thalhammer]
+
+0.36_16 - Thu Aug 26 12:44:07 EDT 2010
+
+ Bug fixes:
+
+ - Better error message in case package declaration is not found
+ when searching for version. [Alexandr Ciornii]
+
+ - Skips 'release_status' tests on perl < 5.8.1 due to buggy
+ treatment of dotted-decimal version numbers [David Golden]
+
+0.36_15 - Wed Aug 25 10:41:28 EDT 2010
+
+ Bug fixes:
+
+ - Added a mock Software::License to prevent t/properties/license.t
+ from failing.
+
+0.36_14 - Sun Aug 22 22:56:50 EDT 2010
+
+ Enhancements:
+
+ - Adds 'release_status' and 'dist_suffix' properties in preparation
+ for adding CPAN Meta Spec 2 support. 'dist_suffix' will be set
+ to 'TRIAL' automatically when necessary. [David Golden]
+
+ - Makes 'license' more liberal. You can now specify either a license
+ key from the approved list (c.f. Module::Build::API) or just a
+ Software::License subclass name (e.g. 'Perl_5'). This should
+ provide better support for custom or proprietary licenses.
+ [David Golden]
+
+0.36_13 - Wed Jul 28 22:40:25 EDT 2010
+
+ Bug-fixes:
+
+ - Bundled Module::Build::Version updated to bring into sync with CPAN
+ version.pm 0.82 [David Golden]
+
+0.36_12 - Tue Jul 27 00:08:51 EDT 2010
+
+ Enhancements:
+
+ - Module::Build::Compat will now convert dotted-decimal prereqs into
+ decimal rather than dying (and will warn about this). [Apocalypse]
+
+ Bug fixes:
+
+ - Caches case-sensitivity checks to boost performance, fixes
+ RT#55162 and RT#56513 [Reini Urban]
+
+ - Won't try to use ActivePerl doc generation tools without confirming
+ that they are indeed installed. [David Golden]
+
+ - Sets temporary $ENV{HOME} in testing to an absolute path, which fixes
+ some issues when tested as part of the Perl core [Nicholas Clark]
+
+ - Module::Build::ModuleInfo now warns instead of dying when a module
+ has an invalid version. ->version now just returns undef
+ (RT#59593) [David Golden]
+
+ Changes:
+
+ - When authors do not specify Module::Build in configure_requires and
+ Module::Build is automatically added, a warning will be issued
+ showing the added prerequisite [David Golden]
+
+ - Moved automatic configure_requires generation into get_metadata()
+ and added an 'auto' argument to toggle it (on for META and off
+ for MYMETA) [David Golden]
+
+0.36_11 - Thu May 27 09:41:23 EDT 2010
+
+ Bug fixes:
+
+ - Handle META/MYMETA reading and writing within Module::Build to ensure
+ utf8 mode on filehandles. Now passes/gets only strings to YAML::Tiny
+ or Module::Build::YAML
+
+0.36_10 - Wed May 19 18:36:06 EDT 2010
+
+ Bug fixes:
+
+ - Fix failing t/manifypods.t on Windows from 0.36_09 changes [Klaus
+ Eichner]
+
+0.36_09 - Tue May 11 09:19:12 EDT 2010
+
+ Bug fixes:
+
+ - Improve HTML documentation generation on ActivePerl (RT#53478)
+ [Scott Renner and Klaus Eichner]
+
+0.36_08 - Mon Apr 26 08:00:15 EDT 2010
+
+ Enhancements:
+
+ - Give a list of valid licenses when given one we don't recognize
+ (RT#55951) [Yanick Champoux]
+
+ - Added 'Build manifest_skip' action to generate a default MANIFEST.SKIP
+ [David Golden]
+
+ Changes:
+
+ - When temporarily generating a MANIFEST.SKIP when none exists, it will
+ be removed on exit instead of hanging around until 'Build clean'. This
+ is less surprising/confusing and the 'Build manifest_skip' action
+ is now available instead to bootstrap the file [David Golden]
+
+ Bug fixes:
+
+ - Fixed runtime error on cygwin when searching for an executable command
+ during installdeps testing [David Golden]
+
+0.3607 - Thu Apr 1 11:27:16 EDT 2010
+
+ Bug fixes:
+
+ - The 'dist' action now always ensures a clean dist directory before
+ creating the tarball [David Golden]
+
+0.36_06 - Thu Apr 1 01:23:58 EDT 2010
+
+ Other:
+
+ - Migrated repository to git and updated META.yml to match
+
+ - Removed bugtracker URL (let search.cpan.org use default)
+
+ - Disabled SIGNATURE generation
+
+0.3605 - Wed Mar 31 12:05:11 EDT 2010
+
+ - No changes from 0.36_04
+
+0.36_04 - Tue Mar 16 21:41:41 EDT 2010
+
+ Bug fixes:
+
+ - Added missing newline to "Changing sharpbang" messages under verbose
+ output (RT#54474) [David Golden]
+
+ - Added 'beos' to list of Unix-like os types (RT#53876) [Nigel Horne]
+
+ - Sets $ENV{HOME} to a temporary directory during testing [David Golden]
+
+ - For VMS: fixed prefix handling plus other test fixes [Craig Berry]
+
+ - Support anonymous array of directories for c_source [Alberto Simões]
+
+ - Small POD formatting fix [James Keenan]
+
0.3603 - Mon Jan 18 22:28:59 EST 2010
(Oops, I released the last one before I realized this should have been
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/bin/config_data b/gnu/usr.bin/perl/cpan/Module-Build/bin/config_data
new file mode 100644
index 00000000000..40c8ea48f60
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/bin/config_data
@@ -0,0 +1,249 @@
+#!/usr/bin/perl
+
+use strict;
+use Module::Build 0.25;
+use Getopt::Long;
+
+my %opt_defs = (
+ module => {type => '=s',
+ desc => 'The name of the module to configure (required)'},
+ feature => {type => ':s',
+ desc => 'Print the value of a feature or all features'},
+ config => {type => ':s',
+ desc => 'Print the value of a config option'},
+ set_feature => {type => '=s%',
+ desc => "Set a feature to 'true' or 'false'"},
+ set_config => {type => '=s%',
+ desc => 'Set a config option to the given value'},
+ eval => {type => '',
+ desc => 'eval() config values before setting'},
+ help => {type => '',
+ desc => 'Print a help message and exit'},
+ );
+
+my %opts;
+GetOptions( \%opts, map "$_$opt_defs{$_}{type}", keys %opt_defs ) or die usage(%opt_defs);
+print usage(%opt_defs) and exit(0)
+ if $opts{help};
+
+my @exclusive = qw(feature config set_feature set_config);
+die "Exactly one of the options '" . join("', '", @exclusive) . "' must be specified\n" . usage(%opt_defs)
+ unless grep(exists $opts{$_}, @exclusive) == 1;
+
+die "Option --module is required\n" . usage(%opt_defs)
+ unless $opts{module};
+
+my $cf = load_config($opts{module});
+
+if (exists $opts{feature}) {
+
+ if (length $opts{feature}) {
+ print $cf->feature($opts{feature});
+ } else {
+ my %auto;
+ # note: need to support older ConfigData.pm's
+ @auto{$cf->auto_feature_names} = () if $cf->can("auto_feature_names");
+
+ print " Features defined in $cf:\n";
+ foreach my $name (sort $cf->feature_names) {
+ print " $name => ", $cf->feature($name), (exists $auto{$name} ? " (dynamic)" : ""), "\n";
+ }
+ }
+
+} elsif (exists $opts{config}) {
+
+ require Data::Dumper;
+ local $Data::Dumper::Terse = 1;
+
+ if (length $opts{config}) {
+ print Data::Dumper::Dumper($cf->config($opts{config})), "\n";
+ } else {
+ print " Configuration defined in $cf:\n";
+ foreach my $name (sort $cf->config_names) {
+ print " $name => ", Data::Dumper::Dumper($cf->config($name)), "\n";
+ }
+ }
+
+} elsif (exists $opts{set_feature}) {
+ my %to_set = %{$opts{set_feature}};
+ while (my ($k, $v) = each %to_set) {
+ die "Feature value must be 0 or 1\n" unless $v =~ /^[01]$/;
+ $cf->set_feature($k, 0+$v); # Cast to a number, not a string
+ }
+ $cf->write;
+ print "Feature" . 's'x(keys(%to_set)>1) . " saved\n";
+
+} elsif (exists $opts{set_config}) {
+
+ my %to_set = %{$opts{set_config}};
+ while (my ($k, $v) = each %to_set) {
+ if ($opts{eval}) {
+ $v = eval($v);
+ die $@ if $@;
+ }
+ $cf->set_config($k, $v);
+ }
+ $cf->write;
+ print "Config value" . 's'x(keys(%to_set)>1) . " saved\n";
+}
+
+sub load_config {
+ my $mod = shift;
+
+ $mod =~ /^([\w:]+)$/
+ or die "Invalid module name '$mod'";
+
+ my $cf = $mod . "::ConfigData";
+ eval "require $cf";
+ die $@ if $@;
+
+ return $cf;
+}
+
+sub usage {
+ my %defs = @_;
+
+ my $out = "\nUsage: $0 [options]\n\n Options include:\n";
+
+ foreach my $name (sort keys %defs) {
+ $out .= " --$name";
+
+ for ($defs{$name}{type}) {
+ /^=s$/ and $out .= " <string>";
+ /^=s%$/ and $out .= " <string>=<value>";
+ }
+
+ pad_line($out, 35);
+ $out .= "$defs{$name}{desc}\n";
+ }
+
+ $out .= <<EOF;
+
+ Examples:
+ $0 --module Foo::Bar --feature bazzable
+ $0 --module Foo::Bar --config magic_number
+ $0 --module Foo::Bar --set_feature bazzable=1
+ $0 --module Foo::Bar --set_config magic_number=42
+
+EOF
+
+ return $out;
+}
+
+sub pad_line { $_[0] .= ' ' x ($_[1] - length($_[0]) + rindex($_[0], "\n")) }
+
+
+__END__
+
+=head1 NAME
+
+config_data - Query or change configuration of Perl modules
+
+=head1 SYNOPSIS
+
+ # Get config/feature values
+ config_data --module Foo::Bar --feature bazzable
+ config_data --module Foo::Bar --config magic_number
+
+ # Set config/feature values
+ config_data --module Foo::Bar --set_feature bazzable=1
+ config_data --module Foo::Bar --set_config magic_number=42
+
+ # Print a usage message
+ config_data --help
+
+=head1 DESCRIPTION
+
+The C<config_data> tool provides a command-line interface to the
+configuration of Perl modules. By "configuration", we mean something
+akin to "user preferences" or "local settings". This is a
+formalization and abstraction of the systems that people like Andreas
+Koenig (C<CPAN::Config>), Jon Swartz (C<HTML::Mason::Config>), Andy
+Wardley (C<Template::Config>), and Larry Wall (perl's own Config.pm)
+have developed independently.
+
+The configuration system emplyed here was developed in the context of
+C<Module::Build>. Under this system, configuration information for a
+module C<Foo>, for example, is stored in a module called
+C<Foo::ConfigData>) (I would have called it C<Foo::Config>, but that
+was taken by all those other systems mentioned in the previous
+paragraph...). These C<...::ConfigData> modules contain the
+configuration data, as well as publically accessible methods for
+querying and setting (yes, actually re-writing) the configuration
+data. The C<config_data> script (whose docs you are currently
+reading) is merely a front-end for those methods. If you wish, you
+may create alternate front-ends.
+
+The two types of data that may be stored are called C<config> values
+and C<feature> values. A C<config> value may be any perl scalar,
+including references to complex data structures. It must, however, be
+serializable using C<Data::Dumper>. A C<feature> is a boolean (1 or
+0) value.
+
+=head1 USAGE
+
+This script functions as a basic getter/setter wrapper around the
+configuration of a single module. On the command line, specify which
+module's configuration you're interested in, and pass options to get
+or set C<config> or C<feature> values. The following options are
+supported:
+
+=over 4
+
+=item module
+
+Specifies the name of the module to configure (required).
+
+=item feature
+
+When passed the name of a C<feature>, shows its value. The value will
+be 1 if the feature is enabled, 0 if the feature is not enabled, or
+empty if the feature is unknown. When no feature name is supplied,
+the names and values of all known features will be shown.
+
+=item config
+
+When passed the name of a C<config> entry, shows its value. The value
+will be displayed using C<Data::Dumper> (or similar) as perl code.
+When no config name is supplied, the names and values of all known
+config entries will be shown.
+
+=item set_feature
+
+Sets the given C<feature> to the given boolean value. Specify the value
+as either 1 or 0.
+
+=item set_config
+
+Sets the given C<config> entry to the given value.
+
+=item eval
+
+If the C<--eval> option is used, the values in C<set_config> will be
+evaluated as perl code before being stored. This allows moderately
+complicated data structures to be stored. For really complicated
+structures, you probably shouldn't use this command-line interface,
+just use the Perl API instead.
+
+=item help
+
+Prints a help message, including a few examples, and exits.
+
+=back
+
+=head1 AUTHOR
+
+Ken Williams, kwilliams@cpan.org
+
+=head1 COPYRIGHT
+
+Copyright (c) 1999, Ken Williams. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+Module::Build(3), perl(1).
+
+=cut
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build.pm
index 356fd42a14a..e1fc6cabb6f 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build.pm
@@ -10,67 +10,15 @@ use strict;
use File::Spec ();
use File::Path ();
use File::Basename ();
+use Perl::OSType ();
use Module::Build::Base;
use vars qw($VERSION @ISA);
@ISA = qw(Module::Build::Base);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
-# Okay, this is the brute-force method of finding out what kind of
-# platform we're on. I don't know of a systematic way. These values
-# came from the latest (bleadperl) perlport.pod.
-
-my %OSTYPES = qw(
- aix Unix
- bsdos Unix
- dgux Unix
- dragonfly Unix
- dynixptx Unix
- freebsd Unix
- linux Unix
- haiku Unix
- hpux Unix
- irix Unix
- darwin Unix
- machten Unix
- midnightbsd Unix
- mirbsd Unix
- next Unix
- openbsd Unix
- netbsd Unix
- dec_osf Unix
- nto Unix
- svr4 Unix
- svr5 Unix
- sco_sv Unix
- unicos Unix
- unicosmk Unix
- solaris Unix
- sunos Unix
- cygwin Unix
- os2 Unix
- interix Unix
- gnu Unix
- gnukfreebsd Unix
- nto Unix
-
- dos Windows
- MSWin32 Windows
-
- os390 EBCDIC
- os400 EBCDIC
- posix-bc EBCDIC
- vmesa EBCDIC
-
- MacOS MacOS
- VMS VMS
- VOS VOS
- riscos RiscOS
- amigaos Amiga
- mpeix MPEiX
- );
# Inserts the given module into the @ISA hierarchy between
# Module::Build and its immediate parent
@@ -93,18 +41,18 @@ sub _interpose_module {
if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @INC) {
__PACKAGE__->_interpose_module("Module::Build::Platform::$^O");
-} elsif (exists $OSTYPES{$^O}) {
- __PACKAGE__->_interpose_module("Module::Build::Platform::$OSTYPES{$^O}");
+} elsif ( my $ostype = os_type() ) {
+ __PACKAGE__->_interpose_module("Module::Build::Platform::$ostype");
} else {
warn "Unknown OS type '$^O' - using default settings\n";
}
-sub os_type { $OSTYPES{$^O} }
+sub os_type { return Perl::OSType::os_type() }
-sub is_vmsish { return ((os_type() || '') eq 'VMS') }
-sub is_windowsish { return ((os_type() || '') eq 'Windows') }
-sub is_unixish { return ((os_type() || '') eq 'Unix') }
+sub is_vmsish { return Perl::OSType::is_os_type('VMS') }
+sub is_windowsish { return Perl::OSType::is_os_type('Windows') }
+sub is_unixish { return Perl::OSType::is_os_type('Unix') }
1;
@@ -120,7 +68,6 @@ testall testcover testdb testpod testpodcoverage versioninstall
Module::Build - Build and install Perl modules
-
=head1 SYNOPSIS
Standard process for building & installing modules:
@@ -167,14 +114,32 @@ This illustrates initial configuration and the running of three
'actions'. In this case the actions run are 'build' (the default
action), 'test', and 'install'. Other actions defined so far include:
-<action_list>
+ build manifest
+ clean manifest_skip
+ code manpages
+ config_data pardist
+ diff ppd
+ dist ppmdist
+ distcheck prereq_data
+ distclean prereq_report
+ distdir pure_install
+ distinstall realclean
+ distmeta retest
+ distsign skipcheck
+ disttest test
+ docs testall
+ fakeinstall testcover
+ help testdb
+ html testpod
+ install testpodcoverage
+ installdeps versioninstall
You can run the 'help' action for a complete list of actions.
=head1 GUIDE TO DOCUMENTATION
-The documentation for C<Module::Build> is broken up into three sections:
+The documentation for C<Module::Build> is broken up into sections:
=over
@@ -327,6 +292,15 @@ Creates a "distribution directory" named C<$dist_name-$dist_version>
copies all the files listed in the F<MANIFEST> file to that directory.
This directory is what the distribution tarball is created from.
+=item distinstall
+
+[version 0.37]
+
+Performs the 'distdir' action, then switches into that directory and runs a
+C<perl Build.PL>, followed by the 'build' and 'install' actions in that
+directory. Use PERL_MB_OPT or F<.modulebuildrc> to set options that should be
+applied during subprocesses
+
=item distmeta
[version 0.21]
@@ -336,17 +310,13 @@ Creates the F<META.yml> file that describes the distribution.
F<META.yml> is a file containing various bits of I<metadata> about the
distribution. The metadata includes the distribution name, version,
abstract, prerequisites, license, and various other data about the
-distribution. This file is created as F<META.yml> in YAML format.
-It is recommended that the C<YAML::Tiny> module be installed to create it.
-If the C<YAML::Tiny> module is not installed, an internal module supplied
-with Module::Build will be used to write the META.yml file, and this
-will most likely be fine.
+distribution. This file is created as F<META.yml> in a simplified YAML format.
F<META.yml> file must also be listed in F<MANIFEST> - if it's not, a
warning will be issued.
-The current version of the F<META.yml> specification can be found at
-L<http://module-build.sourceforge.net/META-spec-current.html>
+The current version of the F<META.yml> specification can be found
+on CPAN as L<CPAN::Meta::Spec>.
=item distsign
@@ -360,9 +330,11 @@ MANIFEST.
[version 0.05]
-Performs the 'distdir' action, then switches into that directory and
-runs a C<perl Build.PL>, followed by the 'build' and 'test' actions in
-that directory.
+Performs the 'distdir' action, then switches into that directory and runs a
+C<perl Build.PL>, followed by the 'build' and 'test' actions in that directory.
+Use PERL_MB_OPT or F<.modulebuildrc> to set options that should be applied
+during subprocesses
+
=item docs
@@ -472,6 +444,14 @@ add your own stuff to it:
See the L<distcheck> and L<skipcheck> actions if you want to find out
what the C<manifest> action would do, without actually doing anything.
+=item manifest_skip
+
+[version 0.3608]
+
+This is an action intended for use by module authors, not people
+installing modules. It will generate a boilerplate MANIFEST.SKIP file
+if one does not already exist.
+
=item manpages
[version 0.28]
@@ -699,7 +679,7 @@ specify the C<versionlib> parameter when you run the C<Build.PL> script:
perl Build.PL --versionlib /my/version/place/
To override which version the module is installed as, specify the
-C<versionlib> parameter when you run the C<Build.PL> script:
+C<version> parameter when you run the C<Build.PL> script:
perl Build.PL --version 0.50
@@ -733,7 +713,8 @@ Suppress informative messages on output.
=item verbose
-Display extra information about the Build on output.
+Display extra information about the Build on output. C<verbose> will
+turn off C<quiet>
=item cpan_client
@@ -874,7 +855,7 @@ This is the same as C<bindoc> above, but applies to HTML documents.
=item libhtml
-This is the same as C<bindoc> above, but applies to HTML documents.
+This is the same as C<libdoc> above, but applies to HTML documents.
=back
@@ -1101,8 +1082,8 @@ Module-Build mailing list at <module-build@perl.org>.
Bug reports are also welcome at
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>.
-The latest development version is available from the Subversion
-repository at <https://svn.perl.org/modules/Module-Build/trunk/>
+The latest development version is available from the Git
+repository at <https://github.com/dagolden/module-build/>
=head1 COPYRIGHT
@@ -1116,10 +1097,10 @@ modify it under the same terms as Perl itself.
=head1 SEE ALSO
perl(1), L<Module::Build::Cookbook>, L<Module::Build::Authoring>,
-L<Module::Build::API>, L<ExtUtils::MakeMaker>, L<YAML::Tiny>
+L<Module::Build::API>, L<ExtUtils::MakeMaker>
F<META.yml> Specification:
-L<http://module-build.sourceforge.net/META-spec-current.html>
+L<CPAN::Meta::Spec>
L<http://www.dsmit.com/cons/>
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
index 146d28ec2b9..29d2f359c8e 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/API.pod
@@ -181,6 +181,11 @@ files in the directory will be compiled to object files. The
directory will be added to the search path during the compilation and
linking phases of any C or XS files.
+[version 0.3604]
+
+A list of directories can be supplied using an anonymous array
+reference of strings.
+
=item conflicts
[version 0.07]
@@ -261,6 +266,25 @@ a reasonable default. However, some agglomerative distributions like
C<libwww-perl> or C<bioperl> have names that don't correspond directly
to a module name, so C<dist_name> can be set independently.
+=item dist_suffix
+
+[version 0.37]
+
+Specifies an optional suffix to include after the version number
+in the distribution directory (and tarball) name. The only suffix
+currently recognized by PAUSE is 'TRIAL', which indicates that the
+distribution should not be indexed. For example:
+
+ Foo-Bar-1.23-TRIAL.tar.gz
+
+This will automatically do the "right thing" depending on C<dist_version> and
+C<release_status>. When C<dist_version> does not have an underscore and
+C<release_status> is not 'stable', then C<dist_suffix> will default to 'TRIAL'.
+Otherwise it will default to the empty string, disabling the suffix.
+
+In general, authors should only set this if they B<must> override the default
+behavior for some particular purpose.
+
=item dist_version
[version 0.11]
@@ -447,8 +471,12 @@ L<Module::Build/"INSTALL PATHS">
[version 0.07]
-Specifies the licensing terms of your distribution. Valid options include:
+Specifies the licensing terms of your distribution.
+
+As of Module::Build version 0.36_14, you may use a L<Software::License>
+subclass name (e.g. 'Apache_2_0') instead of one of the keys below.
+The legacy list of valid license values include:
=over 4
@@ -525,9 +553,9 @@ restrictions.
=back
-
Note that you must still include the terms of your license in your
-documentation - this field only lets automated tools figure out your
+code and documentation - this field only sets the information that is included
+in distribution metadata to let automated tools figure out your
licensing restrictions. Humans still need something to read. If you
choose to provide this field, you should make sure that you keep it in
sync with your written documentation if you ever change your licensing
@@ -536,13 +564,7 @@ terms.
You may also use a license type of C<unknown> if you don't wish to
specify your terms in the metadata.
-It is a fatal error to use a license other than the ones mentioned
-above. This is not because I wish to impose licensing terms on you -
-please let me know if you would like another license option to be
-added to the list. I just started out with a small set of licenses to
-keep things simple, figuring I'd let people with actual working
-knowledge in this area tell me what to do. So if that's you, drop me
-a line.
+Also see the C<create_license> parameter.
=item meta_add
@@ -711,6 +733,22 @@ Normally, C<Module::Build> does not search subdirectories when looking
for tests to run. When this options is set it will search recursively
in all subdirectories of the standard 't' test directory.
+=item release_status
+
+[version 0.37]
+
+The CPAN Meta Spec version 2 adds C<release_status> to allow authors
+to specify how a distribution should be indexed. Consistent with the
+spec, this parameter can only have one three values: 'stable',
+'testing' or 'unstable'.
+
+Unless explicitly set by the author, C<release_status> will default
+to 'stable' unless C<dist_version> contains an underscore, in which
+case it will default to 'testing'.
+
+It is an error to specify a C<release_status> of 'stable' when
+C<dist_version> contains an underscore character.
+
=item requires
[version 0.07]
@@ -1588,11 +1626,24 @@ of F<META.yml>. E.g.
return $data;
}
-The only valid argument is C<fatal>, which indicates whether missing required
+Valid arguments include:
+
+=over
+
+=item *
+
+C<fatal> -- indicates whether missing required
metadata fields should be a fatal error or not. For META creation, it
generally should, but for MYMETA creation for end-users, it should not be
fatal.
+=item *
+
+C<auto> -- indicates whether any necessary configure_requires should be
+automatically added. This is used in META creation.
+
+=back
+
This method is a wrapper around the old prepare_metadata API now that we
no longer use YAML::Node to hold metadata.
@@ -1667,8 +1718,8 @@ Examples:
[version 0.32]
Returns a reference to a hash describing all prerequisites. The keys of the
-hash will the various prerequisite types ('requires', 'build_requires',
-'configure_requires', 'recommends', or 'conflicts') and the values will
+hash will be the various prerequisite types ('requires', 'build_requires',
+'configure_requires', 'recommends', or 'conflicts') and the values will be
references to hashes of module names and version numbers. Only prerequisites
types that are defined will be included. The C<prereq_data> action is just a
thin wrapper around the C<prereq_data()> method and dumps the hash as a string
@@ -1827,18 +1878,144 @@ accessor methods for the following properties:
=over 4
-<autogenerated_accessors>
+=item PL_files()
-=back
+=item allow_mb_mismatch()
+
+=item auto_configure_requires()
+
+=item autosplit()
+
+=item base_dir()
+
+=item bindoc_dirs()
+
+=item blib()
+
+=item build_bat()
+
+=item build_class()
+
+=item build_elements()
+
+=item build_requires()
+
+=item build_script()
+
+=item bundle_inc()
+
+=item bundle_inc_preload()
+
+=item c_source()
+
+=item config_dir()
+
+=item configure_requires()
+
+=item conflicts()
+
+=item cpan_client()
+
+=item create_license()
+
+=item create_makefile_pl()
+
+=item create_packlist()
+
+=item create_readme()
+=item debug()
+
+=item debugger()
+
+=item destdir()
+
+=item dynamic_config()
+
+=item get_options()
+
+=item html_css()
+
+=item include_dirs()
+
+=item install_base()
+
+=item installdirs()
+
+=item libdoc_dirs()
+
+=item license()
+
+=item magic_number()
+
+=item mb_version()
+
+=item meta_add()
+
+=item meta_merge()
+
+=item metafile()
+
+=item metafile2()
+
+=item module_name()
+
+=item mymetafile()
+
+=item mymetafile2()
+
+=item needs_compiler()
+
+=item orig_dir()
+
+=item perl()
+
+=item pm_files()
+
+=item pod_files()
+
+=item pollute()
+
+=item prefix()
+
+=item prereq_action_types()
+
+=item program_name()
+
+=item quiet()
+
+=item recommends()
+
+=item recurse_into()
+
+=item recursive_test_files()
+
+=item requires()
+
+=item scripts()
+
+=item sign()
+
+=item tap_harness_args()
+
+=item test_file_exts()
+
+=item use_rcfile()
+
+=item use_tap_harness()
+
+=item verbose()
+
+=item xs_files()
+
+=back
=head1 MODULE METADATA
If you would like to add other useful metadata, C<Module::Build>
supports this with the C<meta_add> and C<meta_merge> arguments to
-L</new>. The authoritative list of supported metadata can be found at
-L<http://module-build.sourceforge.net/META-spec-current.html>, but for
-convenience - here are a few of the more useful ones:
+L</new()>. The authoritative list of supported metadata can be found at
+L<CPAN::META::Spec> but for convenience - here are a few of the more useful ones:
=over 4
@@ -1847,17 +2024,13 @@ convenience - here are a few of the more useful ones:
For describing the distribution using keyword (or "tags") in order to
make CPAN.org indexing and search more efficient and useful.
-See L<http://module-build.sourceforge.net/META-spec-current.html#keywords>.
-
=item resources
A list of additional resources available for users of the
distribution. This can include links to a homepage on the web, a
-bug tracker, the repository location, a even subscription page for the
+bug tracker, the repository location, and even a subscription page for the
distribution mailing list.
-See L<http://module-build.sourceforge.net/META-spec-current.html#resources>.
-
=back
@@ -1877,9 +2050,9 @@ modify it under the same terms as Perl itself.
=head1 SEE ALSO
perl(1), L<Module::Build>(3), L<Module::Build::Authoring>(3),
-L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3), L<YAML::Tiny>(3)
+L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3)
F<META.yml> Specification:
-L<http://module-build.sourceforge.net/META-spec-current.html>
+L<CPAN::META::Spec>
=cut
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
index 38fb3f089a6..92164df9211 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Authoring.pod
@@ -2,7 +2,6 @@
Module::Build::Authoring - Authoring Module::Build modules
-
=head1 DESCRIPTION
When creating a C<Build.PL> script for a module, something like the
@@ -104,7 +103,7 @@ C<@INC> (including the C</nonstandard/library/path>) is propagated to
the Build script, so that My::Builder can be found when running build
actions. If you find that you need to C<chdir> into a different directories
in your subclass methods or actions, be sure to always return to the original
-directory (available via the C<base_dir()> method before returning control
+directory (available via the C<base_dir()> method) before returning control
to the parent class. This is important to avoid data serialization problems.
For very small additions, Module::Build provides a C<subclass()>
@@ -304,8 +303,8 @@ Module-Build mailing list at <module-build@perl.org>.
Bug reports are also welcome at
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>.
-The latest development version is available from the Subversion
-repository at <https://svn.perl.org/modules/Module-Build/trunk/>
+The latest development version is available from the Git
+repository at <https://github.com/dagolden/module-build/>
=head1 SEE ALSO
@@ -314,7 +313,7 @@ perl(1), L<Module::Build>(3), L<Module::Build::API>(3),
L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3), L<YAML>(3)
F<META.yml> Specification:
-L<http://module-build.sourceforge.net/META-spec-current.html>
+L<CPAN::META::Spec>
L<http://www.dsmit.com/cons/>
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
index 5bd8ec72a55..a29f500062c 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Base.pm
@@ -4,7 +4,7 @@ package Module::Build::Base;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
BEGIN { require 5.00503 }
@@ -62,6 +62,7 @@ EOF
$self->dist_name;
$self->dist_version;
+ $self->release_status;
$self->_guess_module_name unless $self->module_name;
$self->_find_nested_builds;
@@ -95,8 +96,12 @@ sub resume {
unless ($self->_perl_is_same($self->{properties}{perl})) {
my $perl = $self->find_perl_interpreter;
- $self->log_warn(" * WARNING: Configuration was initially created with '$self->{properties}{perl}',\n".
- " but we are now using '$perl'.\n");
+ die(<<"DIEFATAL");
+* FATAL ERROR: Perl interpreter mismatch. Configuration was initially
+ created with '$self->{properties}{perl}'
+ but we are now using '$perl'. You must
+ run 'Build realclean' or 'make realclean' and re-configure.
+DIEFATAL
}
$self->cull_args(@ARGV);
@@ -105,7 +110,7 @@ sub resume {
my $mb_version = $Module::Build::VERSION;
if ( $mb_version ne $self->{properties}{mb_version} ) {
$self->log_warn(<<"MISMATCH");
-* WARNING: Configuration was initially created with Module::Build
+* WARNING: Configuration was initially created with Module::Build
version '$self->{properties}{mb_version}' but we are now using version '$mb_version'.
If errors occur, you must re-run the Build.PL or Makefile.PL script.
MISMATCH
@@ -201,15 +206,15 @@ sub _construct {
sub log_info {
my $self = shift;
- print @_ unless(ref($self) and $self->quiet);
+ print @_ if ref($self) && ( $self->verbose || ! $self->quiet );
}
sub log_verbose {
my $self = shift;
- $self->log_info(@_) if(ref($self) and $self->verbose);
+ print @_ if ref($self) && $self->verbose;
}
sub log_debug {
my $self = shift;
- print @_ if ref $self && $self->debug;
+ print @_ if ref($self) && $self->debug;
}
sub log_warn {
@@ -897,10 +902,13 @@ __PACKAGE__->add_property(build_bat => 0);
__PACKAGE__->add_property(bundle_inc => []);
__PACKAGE__->add_property(bundle_inc_preload => []);
__PACKAGE__->add_property(config_dir => '_build');
+__PACKAGE__->add_property(dynamic_config => 1);
__PACKAGE__->add_property(include_dirs => []);
__PACKAGE__->add_property(license => 'unknown');
__PACKAGE__->add_property(metafile => 'META.yml');
__PACKAGE__->add_property(mymetafile => 'MYMETA.yml');
+__PACKAGE__->add_property(metafile2 => 'META.json');
+__PACKAGE__->add_property(mymetafile2 => 'MYMETA.json');
__PACKAGE__->add_property(recurse_into => []);
__PACKAGE__->add_property(use_rcfile => 1);
__PACKAGE__->add_property(create_packlist => 1);
@@ -926,8 +934,7 @@ __PACKAGE__->add_property(
);
{
- my $Is_ActivePerl = eval {require ActivePerl::DocTools};
- __PACKAGE__->add_property(html_css => $Is_ActivePerl ? 'Active.css' : '');
+ __PACKAGE__->add_property(html_css => '');
}
{
@@ -964,6 +971,7 @@ __PACKAGE__->add_property($_) for qw(
dist_abstract
dist_author
dist_name
+ dist_suffix
dist_version
dist_version_from
extra_compiler_flags
@@ -984,6 +992,7 @@ __PACKAGE__->add_property($_) for qw(
program_name
quiet
recursive_test_files
+ release_status
script_files
scripts
share_dir
@@ -1124,6 +1133,41 @@ sub dist_name {
return $p->{dist_name};
}
+sub release_status {
+ my ($self) = @_;
+ my $p = $self->{properties};
+
+ if ( ! defined $p->{release_status} ) {
+ $p->{release_status} = $self->_is_dev_version ? 'testing' : 'stable';
+ }
+
+ unless ( $p->{release_status} =~ qr/\A(?:stable|testing|unstable)\z/ ) {
+ die "Illegal value '$p->{release_status}' for release_status\n";
+ }
+
+ if ( $p->{release_status} eq 'stable' && $self->_is_dev_version ) {
+ my $version = $self->dist_version;
+ die "Illegal value '$p->{release_status}' with version '$version'\n";
+ }
+ return $p->{release_status};
+}
+
+sub dist_suffix {
+ my ($self) = @_;
+ my $p = $self->{properties};
+ return $p->{dist_suffix} if defined $p->{dist_suffix};
+
+ if ( $self->release_status eq 'stable' ) {
+ $p->{dist_suffix} = "";
+ }
+ else {
+ # non-stable release but non-dev version number needs '-TRIAL' appended
+ $p->{dist_suffix} = $self->_is_dev_version ? "" : "TRIAL" ;
+ }
+
+ return $p->{dist_suffix};
+}
+
sub dist_version_from {
my ($self) = @_;
my $p = $self->{properties};
@@ -1144,7 +1188,11 @@ sub dist_version {
my $version_from = File::Spec->catfile( split( qr{/}, $dist_version_from ) );
my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from )
or die "Can't find file $version_from to determine version";
+ #$p->{dist_version} is undef here
$p->{dist_version} = $self->normalize_version( $pm_info->version() );
+ unless (defined $p->{dist_version}) {
+ die "Can't determine distribution version from $version_from";
+ }
}
die ("Can't determine distribution version, must supply either 'dist_version',\n".
@@ -1154,6 +1202,16 @@ sub dist_version {
return $p->{dist_version};
}
+sub _is_dev_version {
+ my ($self) = @_;
+ my $dist_version = $self->dist_version;
+ my $version_obj = eval { Module::Build::Version->new( $dist_version ) };
+ # assume it's normal if the version string is fatal -- in this case
+ # the author might be doing something weird so should play along and
+ # assume they'll specify all necessary behavior
+ return $@ ? 0 : $version_obj->is_alpha;
+}
+
sub dist_author { shift->_pod_parse('author') }
sub dist_abstract { shift->_pod_parse('abstract') }
@@ -1182,6 +1240,26 @@ sub find_module_by_name { # Method provided for backwards compatibility
return Module::Build::ModuleInfo->find_module_by_name(@_[1,2]);
}
+{
+ # $unlink_list_for_pid{$$} = [ ... ]
+ my %unlink_list_for_pid;
+
+ sub _unlink_on_exit {
+ my $self = shift;
+ for my $f ( @_ ) {
+ push @{$unlink_list_for_pid{$$}}, $f if -f $f;
+ }
+ return 1;
+ }
+
+ END {
+ for my $f ( map glob($_), @{ $unlink_list_for_pid{$$} || [] } ) {
+ next unless -e $f;
+ File::Path::rmtree($f, 0, 0);
+ }
+ }
+}
+
sub add_to_cleanup {
my $self = shift;
my %files = map {$self->localize_file_path($_), 1} @_;
@@ -1389,8 +1467,8 @@ sub _feature_deps_msg {
return $log_text;
}
-# Automatically detect and add prerequisites based on configuration
-sub auto_require {
+# Automatically detect configure_requires prereqs
+sub auto_config_requires {
my ($self) = @_;
my $p = $self->{properties};
@@ -1401,6 +1479,10 @@ sub auto_require {
&& ! exists $p->{configure_requires}{'Module::Build'}
) {
(my $ver = $VERSION) =~ s/^(\d+\.\d\d).*$/$1/; # last major release only
+ $self->log_warn(<<EOM);
+Module::Build was not found in configure_requires! Adding it now
+automatically as: configure_requires => { 'Module::Build' => $ver }
+EOM
$self->_add_prereq('configure_requires', 'Module::Build', $ver);
}
@@ -1415,6 +1497,14 @@ sub auto_require {
}
}
+ return;
+}
+
+# Automatically detect and add prerequisites based on configuration
+sub auto_require {
+ my ($self) = @_;
+ my $p = $self->{properties};
+
# If needs_compiler is not explictly set, automatically set it
# If set, we need ExtUtils::CBuilder (and a compiler)
my $xs_files = $self->find_xs_files;
@@ -1555,6 +1645,24 @@ sub _parse_conditions {
}
}
+sub try_require {
+ my ($self, $modname, $spec) = @_;
+ my $status = $self->check_installed_status($modname, defined($spec) ? $spec : 0);
+ return unless $status->{ok};
+ my $path = $modname;
+ $path =~ s{::}{/}g;
+ $path .= ".pm";
+ if ( defined $INC{$path} ) {
+ return 1;
+ }
+ elsif ( exists $INC{$path} ) { # failed before, don't try again
+ return;
+ }
+ else {
+ return eval "require $modname";
+ }
+}
+
sub check_installed_status {
my ($self, $modname, $spec) = @_;
my %status = (need => $spec);
@@ -1572,7 +1680,7 @@ sub check_installed_status {
return \%status;
}
- $status{have} = $pm_info->version();
+ $status{have} = eval { $pm_info->version() };
if ($spec and !defined($status{have})) {
@status{ qw(have message) } = (undef, "Couldn't find a \$VERSION in prerequisite $modname");
return \%status;
@@ -1684,11 +1792,15 @@ sub print_build_script {
my $closedata="";
+ my $config_requires;
+ if ( -f $self->metafile ) {
+ my $meta = eval { $self->read_metafile( $self->metafile ) };
+ $config_requires = $meta && $meta->{configure_requires}{'Module::Build'};
+ }
+ $config_requires ||= 0;
+
my %q = map {$_, $self->$_()} qw(config_dir base_dir);
- my $case_tolerant = 0+(File::Spec->can('case_tolerant')
- && File::Spec->case_tolerant);
- $q{base_dir} = uc $q{base_dir} if $case_tolerant;
$q{base_dir} = Win32::GetShortPathName($q{base_dir}) if $self->is_windowsish;
$q{magic_numfile} = $self->config_file('magicnum');
@@ -1744,6 +1856,7 @@ $quoted_INC
close(*DATA) unless eof(*DATA); # ensure no open handles to this script
use $build_package;
+Module::Build->VERSION(q{$config_requires});
# Some platforms have problems setting \$^X in shebang contexts, fix it up here
\$^X = Module::Build->find_perl_interpreter;
@@ -1766,38 +1879,72 @@ EOF
sub create_mymeta {
my ($self) = @_;
- my $mymetafile = $self->mymetafile;
- my $metafile = $self->metafile;
- # cleanup
- if ( $self->delete_filetree($mymetafile) ) {
- $self->log_verbose("Removed previous '$mymetafile'\n");
+ my ($meta_obj, $mymeta);
+ my @metafiles = ( $self->metafile, $self->metafile2 );
+ my @mymetafiles = ( $self->mymetafile, $self->mymetafile2 );
+
+ # cleanup old MYMETA
+ for my $f ( @mymetafiles ) {
+ if ( $self->delete_filetree($f) ) {
+ $self->log_verbose("Removed previous '$f'\n");
+ }
}
- $self->log_info("Creating new '$mymetafile' with configuration results\n");
- # use old meta and update prereqs, if possible
- my $mymeta;
- if ( -f $metafile ) {
- $mymeta = eval { $self->read_metafile( $self->metafile ) };
+ # Try loading META.json or META.yml
+ if ( $self->try_require("CPAN::Meta", "2.110420") ) {
+ for my $file ( @metafiles ) {
+ next unless -f $file;
+ $meta_obj = eval { CPAN::Meta->load_file($file) };
+ last if $meta_obj;
+ }
}
- # if we read META OK, just update it
+
+ # maybe get a copy in spec v2 format (regardless of original source)
+ $mymeta = $meta_obj->as_struct
+ if $meta_obj;
+
+ # if we have metadata, just update it
if ( defined $mymeta ) {
my $prereqs = $self->_normalize_prereqs;
- for my $t ( keys %$prereqs ) {
- $mymeta->{$t} = $prereqs->{$t};
+ # XXX refactor this mapping somewhere
+ $mymeta->{prereqs}{runtime}{requires} = $prereqs->{requires};
+ $mymeta->{prereqs}{build}{requires} = $prereqs->{build_requires};
+ $mymeta->{prereqs}{runtime}{recommends} = $prereqs->{recommends};
+ $mymeta->{prereqs}{runtime}{conflicts} = $prereqs->{conflicts};
+ # delete empty entries
+ for my $phase ( keys %{$mymeta->{prereqs}} ) {
+ if ( ref $mymeta->{prereqs}{$phase} eq 'HASH' ) {
+ for my $type ( keys %{$mymeta->{prereqs}{$phase}} ) {
+ if ( ! defined $mymeta->{prereqs}{$phase}{$type}
+ || ! keys %{$mymeta->{prereqs}{$phase}{$type}}
+ ) {
+ delete $mymeta->{prereqs}{$phase}{$type};
+ }
+ }
+ }
+ if ( ! defined $mymeta->{prereqs}{$phase}
+ || ! keys %{$mymeta->{prereqs}{$phase}}
+ ) {
+ delete $mymeta->{prereqs}{$phase};
+ }
}
+ $mymeta->{dynamic_config} = 0;
+ $mymeta->{generated_by} = "Module::Build version $Module::Build::VERSION";
+ eval { $meta_obj = CPAN::Meta->new( $mymeta, { lazy_validation => 1 } ) }
}
- # but generate from scratch, ignoring errors if META doesn't exist
+ # or generate from scratch, ignoring errors if META doesn't exist
else {
- $mymeta = $self->get_metadata( fatal => 0 );
+ $meta_obj = $self->_get_meta_object(
+ quiet => 0, dynamic => 0, fatal => 0, auto => 0
+ );
}
- # MYMETA is always static
- $mymeta->{dynamic_config} = 0;
- # Note which M::B created it
- $mymeta->{generated_by} = "Module::Build version $Module::Build::VERSION";
+ my @created = $self->_write_meta_files( $meta_obj, 'MYMETA' );
+
+ $self->log_warn("Could not create MYMETA files\n")
+ unless @created;
- $self->write_metafile( $mymetafile, $mymeta );
return 1;
}
@@ -1958,7 +2105,6 @@ sub _translate_option {
create_readme
extra_compiler_flags
extra_linker_flags
- html_css
install_base
install_path
meta_add
@@ -2068,7 +2214,7 @@ sub read_args {
$args{$_} ||= [];
$args{$_} = [ $args{$_} ] unless ref $args{$_};
foreach my $arg ( @{$args{$_}} ) {
- $arg =~ /(\w+)=(.*)/
+ $arg =~ /($opt_re)=(.*)/
or die "Malformed '$_' argument: '$arg' should be something like 'foo=bar'";
$hash{$1} = $2;
}
@@ -2208,6 +2354,11 @@ sub read_modulebuildrc {
my ($global_opts) =
$self->read_args( $self->split_like_shell( $options{'*'} || '' ) );
+
+ # let fakeinstall act like install if not provided
+ if ( $action eq 'fakeinstall' && ! exists $options{fakeinstall} ) {
+ $action = 'install';
+ }
my ($action_opts) =
$self->read_args( $self->split_like_shell( $options{$action} || '' ) );
@@ -2552,6 +2703,8 @@ sub do_tests {
my $tests = $self->find_test_files;
+ local $ENV{PERL_DL_NONLAZY} = 1;
+
if(@$tests) {
my $args = $self->tap_harness_args;
if($self->use_tap_harness or ($args and %$args)) {
@@ -2667,7 +2820,7 @@ sub ACTION_testcover {
# testcover was run. If so, start over.
if (-e 'cover_db') {
my $pm_files = $self->rscan_dir
- (File::Spec->catdir($self->blib, 'lib'), file_qr('\.pm$') );
+ (File::Spec->catdir($self->blib, 'lib'), $self->file_qr('\.pm$') );
my $cover_files = $self->rscan_dir('cover_db', sub {-f $_ and not /\.html$/});
$self->do_system(qw(cover -delete))
@@ -2728,11 +2881,19 @@ sub process_support_files {
my $p = $self->{properties};
return unless $p->{c_source};
- push @{$p->{include_dirs}}, $p->{c_source};
+ my $files;
+ if (ref($p->{c_source}) eq "ARRAY") {
+ push @{$p->{include_dirs}}, @{$p->{c_source}};
+ for my $path (@{$p->{c_source}}) {
+ push @$files, @{ $self->rscan_dir($path, $self->file_qr('\.c(c|p|pp|xx|\+\+)?$')) };
+ }
+ } else {
+ push @{$p->{include_dirs}}, $p->{c_source};
+ $files = $self->rscan_dir($p->{c_source}, $self->file_qr('\.c(c|p|pp|xx|\+\+)?$'));
+ }
- my $files = $self->rscan_dir($p->{c_source}, file_qr('\.c(c|p|pp|xx|\+\+)?$'));
foreach my $file (@$files) {
- push @{$p->{objects}}, $self->compile_c($file);
+ push @{$p->{objects}}, $self->compile_c($file);
}
}
@@ -2779,7 +2940,7 @@ sub _share_dir_map {
my %files;
for my $dir ( @$list ) {
for my $f ( @{ $self->rscan_dir( $dir, sub {-f} )} ) {
- $f =~ s{\A.*\Q$dir\E/}{};
+ $f =~ s{\A.*?\Q$dir\E/}{};
$files{"$dir/$f"} = "$prefix/$f";
}
}
@@ -2852,8 +3013,10 @@ sub find_PL_files {
}
return unless -d 'lib';
- return { map {$_, [/^(.*)\.PL$/i ]} @{ $self->rscan_dir('lib',
- file_qr('\.PL$')) } };
+ return {
+ map {$_, [/^(.*)\.PL$/i ]}
+ @{ $self->rscan_dir('lib', $self->file_qr('\.PL$')) }
+ };
}
sub find_pm_files { shift->_find_file_by_type('pm', 'lib') }
@@ -2906,7 +3069,7 @@ sub _find_file_by_type {
return { map {$_, $_}
map $self->localize_file_path($_),
grep !/\.\#/,
- @{ $self->rscan_dir($dir, file_qr("\\.$type\$")) } };
+ @{ $self->rscan_dir($dir, $self->file_qr("\\.$type\$")) } };
}
sub localize_file_path {
@@ -2934,7 +3097,7 @@ sub fix_shebang_line { # Adapted from fixin() in ExtUtils::MM_Unix 1.35
next unless $cmd =~ /perl/i;
my $interpreter = $self->{properties}{perl};
- $self->log_verbose("Changing sharpbang in $file to $interpreter");
+ $self->log_verbose("Changing sharpbang in $file to $interpreter\n");
my $shb = '';
$shb .= $c->get('sharpbang')."$interpreter $arg\n" if $does_shbang;
@@ -2979,7 +3142,7 @@ sub ACTION_testpod {
my @files = sort keys %{$self->_find_pods($self->libdoc_dirs)},
keys %{$self->_find_pods
($self->bindoc_dirs,
- exclude => [ file_qr('\.bat$') ])}
+ exclude => [ $self->file_qr('\.bat$') ])}
or die "Couldn't find any POD files to test\n";
{ package # hide from PAUSE
@@ -3033,6 +3196,24 @@ sub _is_default_installable {
) ? 1 : 0;
}
+sub _is_ActivePerl {
+# return 0;
+ my $self = shift;
+ unless (exists($self->{_is_ActivePerl})) {
+ $self->{_is_ActivePerl} = (eval { require ActivePerl::DocTools; } || 0);
+ }
+ return $self->{_is_ActivePerl};
+}
+
+sub _is_ActivePPM {
+# return 0;
+ my $self = shift;
+ unless (exists($self->{_is_ActivePPM})) {
+ $self->{_is_ActivePPM} = (eval { require ActivePerl::PPM; } || 0);
+ }
+ return $self->{_is_ActivePPM};
+}
+
sub ACTION_manpages {
my $self = shift;
@@ -3041,27 +3222,21 @@ sub ACTION_manpages {
$self->depends_on('code');
foreach my $type ( qw(bin lib) ) {
+ next unless ( $self->invoked_action eq 'manpages' || $self->_is_default_installable("${type}doc"));
my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"},
- exclude => [ file_qr('\.bat$') ] );
+ exclude => [ $self->file_qr('\.bat$') ] );
next unless %$files;
my $sub = $self->can("manify_${type}_pods");
- next unless defined( $sub );
-
- if ( $self->invoked_action eq 'manpages' ) {
- $self->$sub();
- } elsif ( $self->_is_default_installable("${type}doc") ) {
- $self->$sub();
- }
+ $self->$sub() if defined( $sub );
}
-
}
sub manify_bin_pods {
my $self = shift;
my $files = $self->_find_pods( $self->{properties}{bindoc_dirs},
- exclude => [ file_qr('\.bat$') ] );
+ exclude => [ $self->file_qr('\.bat$') ] );
return unless keys %$files;
my $mandir = File::Spec->catdir( $self->blib, 'bindoc' );
@@ -3145,21 +3320,11 @@ sub ACTION_html {
$self->depends_on('code');
foreach my $type ( qw(bin lib) ) {
- my $files = $self->_find_pods( $self->{properties}{"${type}doc_dirs"},
- exclude =>
- [ file_qr('\.(?:bat|com|html)$') ] );
- next unless %$files;
-
- if ( $self->invoked_action eq 'html' ) {
- $self->htmlify_pods( $type );
- } elsif ( $self->_is_default_installable("${type}html") ) {
- $self->htmlify_pods( $type );
- }
+ next unless ( $self->invoked_action eq 'html' || $self->_is_default_installable("${type}html"));
+ $self->htmlify_pods( $type );
}
-
}
-
# 1) If it's an ActiveState perl install, we need to run
# ActivePerl::DocTools->UpdateTOC;
# 2) Links to other modules are not being generated
@@ -3168,13 +3333,10 @@ sub htmlify_pods {
my $type = shift;
my $htmldir = shift || File::Spec->catdir($self->blib, "${type}html");
- require Module::Build::PodParser;
- require Pod::Html;
-
$self->add_to_cleanup('pod2htm*');
my $pods = $self->_find_pods( $self->{properties}{"${type}doc_dirs"},
- exclude => [ file_qr('\.(?:bat|com|html)$') ] );
+ exclude => [ $self->file_qr('\.(?:bat|com|html)$') ] );
return unless %$pods; # nothing to do
unless ( -d $htmldir ) {
@@ -3184,21 +3346,54 @@ sub htmlify_pods {
my @rootdirs = ($type eq 'bin') ? qw(bin) :
$self->installdirs eq 'core' ? qw(lib) : qw(site lib);
+ my $podroot = $ENV{PERL_CORE}
+ ? File::Basename::dirname($ENV{PERL_CORE})
+ : $self->original_prefix('core');
+
+ my $htmlroot = $self->install_sets('core')->{libhtml};
+ my @podpath = (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d }
+ ( $self->install_sets('core', 'lib'), # lib
+ $self->install_sets('core', 'bin'), # bin
+ $self->install_sets('site', 'lib'), # site/lib
+ ) ), File::Spec->rel2abs($self->blib);
+
+ my $podpath = $ENV{PERL_CORE}
+ ? File::Spec->catdir($podroot, 'lib')
+ : join(":", map { tr,:\\,|/,; $_ } @podpath);
+
+ my $blibdir = join('/', File::Spec->splitdir(
+ (File::Spec->splitpath(File::Spec->rel2abs($htmldir),1))[1]),''
+ );
- my $podpath = join ':',
- map $_->[1],
- grep -e $_->[0],
- map [File::Spec->catdir($self->blib, $_), $_],
- qw( script lib );
+ my ($with_ActiveState, $htmltool);
+ if ( $with_ActiveState = $self->_is_ActivePerl
+ && eval { require ActivePerl::DocTools::Pod; 1 }
+ ) {
+ my $tool_v = ActiveState::DocTools::Pod->VERSION;
+ $htmltool = "ActiveState::DocTools::Pod";
+ $htmltool .= " $tool_v" if $tool_v && length $tool_v;
+ }
+ else {
+ require Module::Build::PodParser;
+ require Pod::Html;
+ $htmltool = "Pod::Html " . Pod::Html->VERSION;
+ }
+ $self->log_verbose("Converting Pod to HTML with $htmltool\n");
+
+ my $errors = 0;
+
+ POD:
foreach my $pod ( keys %$pods ) {
my ($name, $path) = File::Basename::fileparse($pods->{$pod},
- file_qr('\.(?:pm|plx?|pod)$'));
+ $self->file_qr('\.(?:pm|plx?|pod)$')
+ );
my @dirs = File::Spec->splitdir( File::Spec->canonpath( $path ) );
pop( @dirs ) if scalar(@dirs) && $dirs[-1] eq File::Spec->curdir;
- my $fulldir = File::Spec->catfile($htmldir, @rootdirs, @dirs);
+ my $fulldir = File::Spec->catdir($htmldir, @rootdirs, @dirs);
+ my $tmpfile = File::Spec->catfile($fulldir, "${name}.tmp");
my $outfile = File::Spec->catfile($fulldir, "${name}.html");
my $infile = File::Spec->abs2rel($pod);
@@ -3209,38 +3404,87 @@ sub htmlify_pods {
or die "Couldn't mkdir $fulldir: $!";
}
- my $path2root = join( '/', ('..') x (@rootdirs+@dirs) );
- my $htmlroot = join( '/',
- ($path2root,
- $self->installdirs eq 'core' ? () : qw(site) ) );
-
- my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
- my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract();
-
- my $title = join( '::', (@dirs, $name) );
- $title .= " - $abstract" if $abstract;
-
- my @opts = (
- '--flush',
- "--title=$title",
- "--podpath=$podpath",
- "--infile=$infile",
- "--outfile=$outfile",
- '--podroot=' . $self->blib,
- "--htmlroot=$htmlroot",
- );
-
- if ( eval{Pod::Html->VERSION(1.03)} ) {
- push( @opts, ('--header', '--backlink=Back to Top') );
- push( @opts, "--css=$path2root/" . $self->html_css) if $self->html_css;
+ $self->log_verbose("HTMLifying $infile -> $outfile\n");
+ if ( $with_ActiveState ) {
+ my $depth = @rootdirs + @dirs;
+ my %opts = ( infile => $infile,
+ outfile => $tmpfile,
+ podpath => $podpath,
+ podroot => $podroot,
+ index => 1,
+ depth => $depth,
+ );
+ eval {
+ ActivePerl::DocTools::Pod::pod2html(%opts);
+ 1;
+ } or $self->log_warn("[$htmltool] pod2html (" .
+ join(", ", map { "q{$_} => q{$opts{$_}}" } (keys %opts)) . ") failed: $@");
+ } else {
+ my $path2root = join( '/', ('..') x (@rootdirs+@dirs) );
+ my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
+ my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract();
+
+ my $title = join( '::', (@dirs, $name) );
+ $title .= " - $abstract" if $abstract;
+
+ my @opts = (
+ "--title=$title",
+ "--podpath=$podpath",
+ "--infile=$infile",
+ "--outfile=$tmpfile",
+ "--podroot=$podroot",
+ "--htmlroot=$path2root",
+ );
+
+ unless ( eval{Pod::Html->VERSION(1.12)} ) {
+ push( @opts, ('--flush') ); # caching removed in 1.12
+ }
+
+ if ( eval{Pod::Html->VERSION(1.12)} ) {
+ push( @opts, ('--header', '--backlink') );
+ } elsif ( eval{Pod::Html->VERSION(1.03)} ) {
+ push( @opts, ('--header', '--backlink=Back to Top') );
+ }
+
+ $self->log_verbose("P::H::pod2html @opts\n");
+ {
+ my $orig = Cwd::getcwd();
+ eval { Pod::Html::pod2html(@opts); 1 }
+ or $self->log_warn("[$htmltool] pod2html( " .
+ join(", ", map { "q{$_}" } @opts) . ") failed: $@");
+ chdir($orig);
+ }
}
+ # We now have to cleanup the resulting html file
+ if ( ! -r $tmpfile ) {
+ $errors++;
+ next POD;
+ }
+ my $fh = IO::File->new($tmpfile) or die "Can't read $tmpfile: $!";
+ my $html = join('',<$fh>);
+ $fh->close;
+ if (!$self->_is_ActivePerl) {
+ # These fixups are already done by AP::DT:P:pod2html
+ # The output from pod2html is NOT XHTML!
+ # IE6+ will display content that is not valid for DOCTYPE
+ $html =~ s#^<!DOCTYPE .*?>#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">#im;
+ $html =~ s#<html xmlns="http://www.w3.org/1999/xhtml">#<html>#i;
+
+ # IE6+ will not display local HTML files with strict
+ # security without this comment
+ $html =~ s#<head>#<head>\n<!-- saved from url=(0017)http://localhost/ -->#i;
+ }
+ # Fixup links that point to our temp blib
+ $html =~ s/\Q$blibdir\E//g;
- $self->log_verbose("HTMLifying $infile -> $outfile\n");
- $self->log_verbose("pod2html @opts\n");
- eval { Pod::Html::pod2html(@opts); 1 }
- or $self->log_warn("pod2html @opts failed: $@");
+ $fh = IO::File->new(">$outfile") or die "Can't write $outfile: $!";
+ print $fh $html;
+ $fh->close;
+ unlink($tmpfile);
}
+ return ! $errors;
+
}
# Adapted from ExtUtils::MM_Unix
@@ -3285,7 +3529,7 @@ sub ACTION_diff {
delete $installmap->{read};
delete $installmap->{write};
- my $text_suffix = file_qr('\.(pm|pod)$');
+ my $text_suffix = $self->file_qr('\.(pm|pod)$');
while (my $localdir = each %$installmap) {
my @localparts = File::Spec->splitdir($localdir);
@@ -3323,7 +3567,35 @@ sub ACTION_install {
my ($self) = @_;
require ExtUtils::Install;
$self->depends_on('build');
- ExtUtils::Install::install($self->install_map, $self->verbose, 0, $self->{args}{uninst}||0);
+ # RT#63003 suggest that odd cirmstances that we might wind up
+ # in a different directory than we started, so wrap with _do_in_dir to
+ # ensure we get back to where we started; hope this fixes it!
+ $self->_do_in_dir( ".", sub {
+ ExtUtils::Install::install(
+ $self->install_map, $self->verbose, 0, $self->{args}{uninst}||0
+ );
+ });
+ if ($self->_is_ActivePerl && $self->{_completed_actions}{html}) {
+ $self->log_info("Building ActivePerl Table of Contents\n");
+ eval { ActivePerl::DocTools::WriteTOC(verbose => $self->verbose ? 1 : 0); 1; }
+ or $self->log_warn("AP::DT:: WriteTOC() failed: $@");
+ }
+ if ($self->_is_ActivePPM) {
+ # We touch 'lib/perllocal.pod'. There is an existing logic in subroutine _init_db()
+ # of 'ActivePerl/PPM/InstallArea.pm' that says that if 'lib/perllocal.pod' has a 'date-last-touched'
+ # greater than that of the PPM SQLite databases ('etc/ppm-perl-area.db' and/or
+ # 'site/etc/ppm-site-area.db') then the PPM SQLite databases are rebuilt from scratch.
+
+ # in the following line, 'perllocal.pod' this is *always* 'lib/perllocal.pod', never 'site/lib/perllocal.pod'
+ my $F_perllocal = File::Spec->catfile($self->install_sets('core', 'lib'), 'perllocal.pod');
+ my $dt_stamp = time;
+
+ $self->log_info("For ActivePerl's PPM: touch '$F_perllocal'\n");
+
+ open my $perllocal, ">>", $F_perllocal;
+ close $perllocal;
+ utime($dt_stamp, $dt_stamp, $F_perllocal);
+ }
}
sub ACTION_fakeinstall {
@@ -3390,8 +3662,13 @@ sub ACTION_installdeps {
# relative command should be relative to our active Perl
# so we need to locate that command
if ( ! File::Spec->file_name_is_absolute( $command ) ) {
+ # prefer site to vendor to core
+ my @loc = ( 'site', 'vendor', '' );
my @bindirs = File::Basename::dirname($self->perl);
- push @bindirs, map {$self->config->{"install${_}bin"}} '','site','vendor';
+ push @bindirs,
+ map {
+ ($self->config->{"install${_}bin"}, $self->config->{"install${_}script"})
+ } @loc;
for my $d ( @bindirs ) {
my $abs_cmd = $self->find_command(File::Spec->catfile( $d, $command ));
if ( defined $abs_cmd ) {
@@ -3421,7 +3698,7 @@ sub ACTION_realclean {
$self->depends_on('clean');
$self->log_info("Cleaning up configuration files\n");
$self->delete_filetree(
- $self->config_dir, $self->mymetafile, $self->build_script
+ $self->config_dir, $self->mymetafile, $self->mymetafile2, $self->build_script
);
}
@@ -3476,7 +3753,6 @@ sub ACTION_ppmdist {
}
foreach my $type ( qw(bin lib) ) {
- local $self->{properties}{html_css} = 'Active.css';
$self->htmlify_pods( $type, File::Spec->catdir($ppm, 'blib', 'html') );
}
@@ -3513,7 +3789,8 @@ sub ACTION_pardist {
sub ACTION_dist {
my ($self) = @_;
- $self->depends_on('distdir');
+ # MUST dispatch() and not depends_ok() so we generate a clean distdir
+ $self->dispatch('distdir');
my $dist_dir = $self->dist_dir;
@@ -3553,9 +3830,12 @@ sub _check_mymeta_skip {
my $mymetafile = $self->mymetafile;
# we can't check it, just add it anyway to be safe
- unless ( $skip_factory && $skip_factory->($maniskip)->($mymetafile) ) {
- $self->log_warn("File '$maniskip' does not include '$mymetafile'. Adding it now.\n");
- $self->_append_maniskip("^$mymetafile\$", $maniskip);
+ for my $file ( $self->mymetafile, $self->mymetafile2 ) {
+ unless ( $skip_factory && $skip_factory->($maniskip)->($file) ) {
+ $self->log_warn("File '$maniskip' does not include '$file'. Adding it now.\n");
+ my $safe = quotemeta($file);
+ $self->_append_maniskip("^$safe\$", $maniskip);
+ }
}
}
@@ -3609,7 +3889,7 @@ sub _sign_dir {
sub _do_in_dir {
my ($self, $dir, $do) = @_;
- my $start_dir = $self->cwd;
+ my $start_dir = File::Spec->rel2abs($self->cwd);
chdir $dir or die "Can't chdir() to $dir: $!";
eval {$do->()};
my @err = $@ ? ($@) : ();
@@ -3645,7 +3925,11 @@ sub do_create_makefile_pl {
my $self = shift;
require Module::Build::Compat;
$self->log_info("Creating Makefile.PL\n");
- Module::Build::Compat->create_makefile_pl($self->create_makefile_pl, $self, @_);
+ eval { Module::Build::Compat->create_makefile_pl($self->create_makefile_pl, $self, @_) };
+ if ( $@ ) {
+ 1 while unlink 'Makefile.PL';
+ die "$@\n";
+ }
$self->_add_to_manifest('MANIFEST', 'Makefile.PL');
}
@@ -3659,19 +3943,16 @@ sub do_create_license {
}
my $l = $self->license
- or die "No license specified";
-
- my $key = $self->valid_licenses->{$l}
- or die "'$l' isn't a license key we know about";
- my $class = "Software::License::$key";
+ or die "Can't create LICENSE file: No license specified\n";
- eval "use $class; 1"
- or die "Can't load Software::License::$key to create LICENSE file: $@";
+ my $license = $self->_software_license_object
+ or die << "HERE";
+Can't create LICENSE file: '$l' is not a valid license key
+or Software::License subclass;
+HERE
$self->delete_filetree('LICENSE');
- my $author = join " & ", @{ $self->dist_author };
- my $license = $class->new({holder => $author});
my $fh = IO::File->new('> LICENSE')
or die "Can't write LICENSE file: $!";
print $fh $license->fulltext;
@@ -3770,9 +4051,6 @@ sub ACTION_distdir {
$self->depends_on('distmeta');
- # Must not include MYMETA
- $self->_check_mymeta_skip('MANIFEST.SKIP');
-
my $dist_files = $self->_read_manifest('MANIFEST')
or die "Can't create distdir without a MANIFEST file - run 'manifest' action first.\n";
delete $dist_files->{SIGNATURE}; # Don't copy, create a fresh one
@@ -3788,6 +4066,7 @@ sub ACTION_distdir {
$self->add_to_cleanup($dist_dir);
foreach my $file (keys %$dist_files) {
+ next if $file =~ m{^MYMETA\.}; # Double check that we skip MYMETA.*
my $new = $self->copy_if_modified(from => $file, to_dir => $dist_dir, verbose => 0);
}
@@ -3815,6 +4094,22 @@ sub ACTION_disttest {
});
}
+sub ACTION_distinstall {
+ my ($self, @args) = @_;
+
+ $self->depends_on('distdir');
+
+ $self->_do_in_dir ( $self->dist_dir,
+ sub {
+ $self->run_perl_script('Build.PL')
+ or die "Error executing 'Build.PL' in dist directory: $!";
+ $self->run_perl_script('Build')
+ or die "Error executing 'Build' in dist directory: $!";
+ $self->run_perl_script('Build', [], ['install'])
+ or die "Error executing 'Build install' in dist directory";
+ }
+ );
+}
=begin private
@@ -3873,12 +4168,33 @@ Reads $file and returns the $content.
sub _slurp {
my $self = shift;
my $file = shift;
- open my $fh, "<", $file or croak "Can't open $file: $!";
+ my $mode = shift || "";
+ open my $fh, "<$mode", $file or croak "Can't open $file for reading: $!";
local $/;
return <$fh>;
}
+sub _spew {
+ my $self = shift;
+ my $file = shift;
+ my $content = shift || "";
+ my $mode = shift || "";
+ open my $fh, ">$mode", $file or croak "Can't open $file for writing: $!";
+ print {$fh} $content;
+ close $fh;
+}
+sub _case_tolerant {
+ my $self = shift;
+ if ( ref $self ) {
+ $self->{_case_tolerant} = File::Spec->case_tolerant
+ unless defined($self->{_case_tolerant});
+ return $self->{_case_tolerant};
+ }
+ else {
+ return File::Spec->case_tolerant;
+ }
+}
sub _append_maniskip {
my $self = shift;
@@ -3933,7 +4249,7 @@ sub _check_manifest_skip {
if ( ! -e $maniskip ) {
$self->log_warn("File '$maniskip' does not exist: Creating a temporary '$maniskip'\n");
$self->_write_default_maniskip($maniskip);
- $self->add_to_cleanup($maniskip);
+ $self->_unlink_on_exit($maniskip);
}
else {
# MYMETA must not be added to MANIFEST, so always confirm the skip
@@ -3953,14 +4269,28 @@ sub ACTION_manifest {
ExtUtils::Manifest::mkmanifest();
}
+sub ACTION_manifest_skip {
+ my ($self) = @_;
+
+ if ( -e 'MANIFEST.SKIP' ) {
+ $self->log_warn("MANIFEST.SKIP already exists.\n");
+ return 0;
+ }
+ $self->log_info("Creating a new MANIFEST.SKIP file\n");
+ return $self->_write_default_maniskip;
+ return -e 'MANIFEST.SKIP'
+}
+
# Case insensitive regex for files
sub file_qr {
- return File::Spec->case_tolerant ? qr($_[0])i : qr($_[0]);
+ return shift->{_case_tolerant} ? qr($_[0])i : qr($_[0]);
}
sub dist_dir {
my ($self) = @_;
- return join "-", $self->dist_name, $self->dist_version;
+ my $dir = join "-", $self->dist_name, $self->dist_version;
+ $dir .= "-" . $self->dist_suffix if $self->dist_suffix;
+ return $dir;
}
sub ppm_name {
@@ -4058,13 +4388,13 @@ sub script_files {
}
my %pl_files = map {
- File::Spec->canonpath( File::Spec->case_tolerant ? uc $_ : $_ ) => 1
+ File::Spec->canonpath( $_ ) => 1
} keys %{ $self->PL_files || {} };
my @bin_files = $self->_files_in('bin');
my %bin_map = map {
- $_ => File::Spec->canonpath( File::Spec->case_tolerant ? uc $_ : $_ )
+ $_ => File::Spec->canonpath( $_ )
} @bin_files;
return $_ = { map {$_ => 1} grep !$pl_files{$bin_map{$_}}, @bin_files };
@@ -4123,6 +4453,32 @@ BEGIN { *scripts = \&script_files; }
}
}
+# use mapping or license name directly
+sub _software_license_object {
+ my ($self) = @_;
+ return unless defined( my $license = $self->license );
+
+ my $class;
+ LICENSE: for my $l ( $self->valid_licenses->{ $license }, $license ) {
+ next unless defined $l;
+ my $trial = "Software::License::" . $l;
+ if ( eval "require Software::License; Software::License->VERSION(0.014); require $trial; 1" ) {
+ $class = $trial;
+ last LICENSE;
+ }
+ }
+ return unless defined $class;
+
+ # Software::License requires a 'holder' argument
+ my $author = join( " & ", @{ $self->dist_author }) || 'unknown';
+ my $sl = eval { $class->new({holder=>$author}) };
+ if ( $@ ) {
+ $self->log_warn( "Error getting '$class' object: $@" );
+ }
+
+ return $sl;
+}
+
sub _hash_merge {
my ($self, $h, $k, $v) = @_;
if (ref $h->{$k} eq 'ARRAY') {
@@ -4136,7 +4492,6 @@ sub _hash_merge {
sub ACTION_distmeta {
my ($self) = @_;
-
$self->do_create_makefile_pl if $self->create_makefile_pl;
$self->do_create_readme if $self->create_readme;
$self->do_create_license if $self->create_license;
@@ -4148,19 +4503,15 @@ sub do_create_metafile {
return if $self->{wrote_metadata};
my $p = $self->{properties};
- my $metafile = $self->metafile;
unless ($p->{license}) {
$self->log_warn("No license specified, setting license = 'unknown'\n");
$p->{license} = 'unknown';
}
- unless (exists $self->valid_licenses->{ $p->{license} }) {
- die "Unknown license type '$p->{license}'";
- }
+ my @metafiles = ( $self->metafile, $self->metafile2 );
# If we're in the distdir, the metafile may exist and be non-writable.
- $self->delete_filetree($metafile);
- $self->log_info("Creating $metafile\n");
+ $self->delete_filetree($_) for @metafiles;
# Since we're building ourself, we have to do some special stuff
# here: the ConfigData module is found in blib/lib.
@@ -4170,49 +4521,85 @@ sub do_create_metafile {
push @INC, File::Spec->catdir($self->blib, 'lib');
}
- if ($self->write_metafile($self->metafile,$self->get_metadata(fatal=>1))){
+ my $meta_obj = $self->_get_meta_object(
+ quiet => 1, fatal => 1, auto => 1
+ );
+ my @created = $self->_write_meta_files( $meta_obj, 'META' );
+ if ( @created ) {
$self->{wrote_metadata} = 1;
- $self->_add_to_manifest('MANIFEST', $metafile);
+ $self->_add_to_manifest('MANIFEST', $_) for @created;
}
-
return 1;
}
-sub read_metafile {
+sub _write_meta_files {
my $self = shift;
- my ($metafile) = @_;
- my $yaml;
+ my ($meta, $file) = @_;
+ $file =~ s{\.(?:yml|json)$}{};
+
+ my @created;
+ push @created, "$file\.yml"
+ if $meta && $meta->save( "$file\.yml", {version => "1.4"} );
+ push @created, "$file\.json"
+ if $meta && $meta->save( "$file\.json" );
- my $class = $self->_mb_feature('YAML_support')
- ? 'YAML::Tiny' : 'Module::Build::YAML' ;
+ if ( @created ) {
+ $self->log_info("Created " . join(" and ", @created) . "\n");
+ }
+ return @created;
+}
- eval "require $class; 1" or die $@;
- my $meta = $class->read($metafile)
- or $self->log_warn( "Error reading '$metafile': " . $class->errstr . "\n");
+sub _get_meta_object {
+ my $self = shift;
+ my %args = @_;
+ return unless $self->try_require("CPAN::Meta", "2.110420");
- return $meta->[0] || {};
+ my $meta;
+ eval {
+ my $data = $self->get_metadata(
+ fatal => $args{fatal},
+ auto => $args{auto},
+ );
+ $data->{dynamic_config} = $args{dynamic} if defined $args{dynamic};
+ $meta = CPAN::Meta->create( $data );
+ };
+ if ($@ && ! $args{quiet}) {
+ $self->log_warn(
+ "Could not get valid metadata. Error is: $@\n"
+ );
+ }
+
+ return $meta;
}
+# We return a version 1.4 structure for backwards compatibility
+sub read_metafile {
+ my $self = shift;
+ my ($metafile) = @_;
+
+ return unless $self->try_require("CPAN::Meta", "2.110420");
+ my $meta = CPAN::Meta->load_file($metafile);
+ return $meta->as_struct( {version => "1.4"} );
+}
+
+# For legacy compatibility, we upconvert a 1.4 data structure, ensuring
+# validity, and then downconvert it back to save it.
+#
+# generally, this code should no longer be used
sub write_metafile {
my $self = shift;
- my ($metafile, $node) = @_;
- my $yaml;
+ my ($metafile, $struct) = @_;
- if ($self->_mb_feature('YAML_support')) {
- # XXX this is probably redundant, but stick with it
- require YAML::Tiny;
- $yaml = YAML::Tiny->new($node);
- } else {
- require Module::Build::YAML;
- $yaml = Module::Build::YAML->new($node);
- }
- my $result = $yaml->write($metafile)
- or $self->log_warn( "Error writing '$metafile': " . $yaml->errstr . "\n");
- return $result;
+ return unless $self->try_require("CPAN::Meta", "2.110420");
+
+ my $meta = CPAN::Meta->new( $struct );
+ return $meta->save( $metafile, { version => "1.4" } );
}
sub normalize_version {
my ($self, $version) = @_;
+ $version = 0 unless defined $version and length $version;
+
if ( $version =~ /[=<>!,]/ ) { # logic, not just version
# take as is without modification
}
@@ -4247,7 +4634,6 @@ sub _normalize_prereqs {
return \%prereq_types;
}
-
# wrapper around old prepare_metadata API;
sub get_metadata {
my ($self, %args) = @_;
@@ -4270,6 +4656,8 @@ sub prepare_metadata {
my $fatal = $args->{fatal} || 0;
my $p = $self->{properties};
+ $self->auto_config_requires if $args->{auto};
+
# A little helper sub
my $add_node = sub {
my ($name, $val) = @_;
@@ -4277,11 +4665,11 @@ sub prepare_metadata {
push @$keys, $name if $keys;
};
- foreach (qw(dist_name dist_version dist_author dist_abstract license)) {
- (my $name = $_) =~ s/^dist_//;
- $add_node->($name, $self->$_());
- unless ( defined($node->{$name}) && length($node->{$name}) ) {
- my $err = "ERROR: Missing required field '$_' for metafile\n";
+ # validate required fields
+ foreach my $f (qw(dist_name dist_version dist_author dist_abstract license)) {
+ my $field = $self->$f();
+ unless ( defined $field and length $field ) {
+ my $err = "ERROR: Missing required field '$f' for metafile\n";
if ( $fatal ) {
die $err;
}
@@ -4290,33 +4678,46 @@ sub prepare_metadata {
}
}
}
+
+
+ # add dist_* fields
+ foreach my $f (qw(dist_name dist_version dist_author dist_abstract)) {
+ (my $name = $f) =~ s/^dist_//;
+ $add_node->($name, $self->$f());
+ }
+
+ # normalize version
$node->{version} = $self->normalize_version($node->{version});
- if (defined( my $l = $self->license )) {
- unless ( exists $self->valid_licenses->{ $l } ) {
- my $err = "Unknown license string '$l'";
- if ( $fatal ) {
- die $err;
- }
- else {
- $self->log_warn($err);
- }
- }
+ # validate license information
+ my $license = $self->license;
+ my ($meta_license, $meta_license_url);
- if (my $key = $self->valid_licenses->{ $l }) {
- my $class = "Software::License::$key";
- if (eval "require Software::License; require $class; 1") {
- # S::L requires a 'holder' key
- $node->{resources}{license} = $class->new({holder=>"nobody"})->url;
- }
- else {
- $node->{resources}{license} = $self->_license_url($l);
- }
- }
- # XXX we are silently omitting the url for any unknown license
+ # XXX this is still meta spec version 1 stuff
+
+ # if Software::License::* exists, then we can use it to get normalized name
+ # for META files
+
+ if ( my $sl = $self->_software_license_object ) {
+ $meta_license = $sl->meta_name;
+ $meta_license_url = $sl->url;
+ }
+ elsif ( exists $self->valid_licenses()->{$license} ) {
+ $meta_license = $license;
+ $meta_license_url = $self->_license_url( $license );
+ }
+ else {
+ # if we didn't find a license from a Software::License class,
+ # then treat it as unknown
+ $self->log_warn( "Can not determine license type for '" . $self->license
+ . "'\nSetting META license field to 'unknown'.\n");
+ $meta_license = 'unknown';
}
+ $node->{license} = $meta_license;
+ $node->{resources}{license} = $meta_license_url if defined $meta_license_url;
+ # add prerequisite data
my $prereqs = $self->_normalize_prereqs;
for my $t ( keys %$prereqs ) {
$add_node->($t, $prereqs->{$t});
@@ -4385,6 +4786,8 @@ sub find_dist_packages {
return $self->find_packages_in_files(\@pm_files, \%dist_files);
}
+# XXX Do not document this function; mst wrote it and now says the API is
+# stupid and needs to be fixed and it shouldn't become a public API until then
sub find_packages_in_files {
my ($self, $file_list, $filename_map) = @_;
@@ -4791,6 +5194,13 @@ sub install_map {
my $localdir = File::Spec->catdir( $blib, $type );
next unless -e $localdir;
+ # the line "...next if (($type eq 'bindoc'..." was one of many changes introduced for
+ # improving HTML generation on ActivePerl, see https://rt.cpan.org/Public/Bug/Display.html?id=53478
+ # Most changes were ok, but this particular line caused test failures in t/manifypods.t on windows,
+ # therefore it is commented out.
+
+ # ********* next if (($type eq 'bindoc' || $type eq 'libdoc') && not $self->is_unixish);
+
if (my $dest = $self->install_destination($type)) {
$map{$localdir} = $dest;
} else {
@@ -5234,7 +5644,7 @@ sub dir_contains {
return 0 if @second_dirs < @first_dirs;
- my $is_same = ( File::Spec->case_tolerant
+ my $is_same = ( $self->_case_tolerant
? sub {lc(shift()) eq lc(shift())}
: sub {shift() eq shift()} );
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
index 95d695f6f56..452dfb96ad5 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Compat.pm
@@ -2,7 +2,7 @@ package Module::Build::Compat;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
use File::Basename ();
use File::Spec;
@@ -65,10 +65,6 @@ my %macro_to_build = %makefile_to_build;
# "LIB=foo make" is not the same as "perl Makefile.PL LIB=foo"
delete $macro_to_build{LIB};
-sub _simple_prereq {
- return $_[0] =~ /^[0-9_]+\.?[0-9_]*$/; # crudly, a decimal literal
-}
-
sub _merge_prereq {
my ($req, $breq) = @_;
$req ||= {};
@@ -78,8 +74,18 @@ sub _merge_prereq {
for my $p ( $req, $breq ) {
for my $k (keys %$p) {
next if $k eq 'perl';
- die "Prereq '$p->{$k}' for '$k' is not supported by Module::Build::Compat\n"
- unless _simple_prereq($p->{$k});
+
+ my $v_obj = eval { Module::Build::Version->new($p->{$k}) };
+ if ( ! defined $v_obj ) {
+ die "A prereq of the form '$p->{$k}' for '$k' is not supported by Module::Build::Compat ( use a simpler version like '0.05' or 'v1.4.25' )\n";
+ }
+
+ # It seems like a lot of people trip over "0.1.2" stuff, so we help them here...
+ if ( $v_obj->is_qv ) {
+ my $proper_ver = $v_obj->numify;
+ warn "Dotted-decimal prereq '$p->{$k}' for '$k' is not portable - converting it to '$proper_ver'\n";
+ $p->{$k} = $proper_ver;
+ }
}
}
# merge
@@ -201,7 +207,7 @@ EOF
} elsif ($type eq 'traditional') {
my (%MM_Args, %prereq);
- if (eval "use Tie::IxHash; 1") {
+ if (eval "use Tie::IxHash 1.2; 1") {
tie %MM_Args, 'Tie::IxHash'; # Don't care if it fails here
tie %prereq, 'Tie::IxHash'; # Don't care if it fails here
}
@@ -444,7 +450,6 @@ __END__
Module::Build::Compat - Compatibility with ExtUtils::MakeMaker
-
=head1 SYNOPSIS
# In a Build.PL :
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
index 997960073fd..9f3dc6779e5 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Config.pm
@@ -2,7 +2,7 @@ package Module::Build::Config;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Config;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
index 15114ee072b..85fa28d869b 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/ConfigData.pm
@@ -181,12 +181,6 @@ do{ my $x = [
},
'description' => 'Bundle Module::Build in inc/'
},
- 'YAML_support' => {
- 'requires' => {
- 'YAML::Tiny' => '1.38'
- },
- 'description' => 'Use YAML::Tiny to write META.yml files'
- },
'manpage_support' => {
'requires' => {
'Pod::Man' => 0
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
index a68dca540ab..80af7c4c0d9 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Cookbook.pm
@@ -1,7 +1,7 @@
package Module::Build::Cookbook;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
=head1 NAME
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
index 2a9bad1b637..8191410460f 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Dumper.pm
@@ -1,7 +1,7 @@
package Module::Build::Dumper;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
# This is just a split-out of a wrapper function to do Data::Dumper
# stuff "the right way". See:
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
index cf85d4ee3d3..9a80a594304 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Notes.pm
@@ -4,7 +4,7 @@ package Module::Build::Notes;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Data::Dumper;
use IO::File;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
index 977b4370d91..62e8b0408c5 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PPMMaker.pm
@@ -5,7 +5,7 @@ use Config;
use vars qw($VERSION);
use IO::File;
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
# This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a
@@ -154,7 +154,6 @@ __END__
Module::Build::PPMMaker - Perl Package Manager file creation
-
=head1 SYNOPSIS
On the command line, builds a .ppd file:
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm
index 9356325c9f4..e088c84833d 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Amiga;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
index 8d46fc47d56..8669036ab3d 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Default.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Default;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm
index 140e27872aa..0cd526448b1 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::EBCDIC;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm
index 66bbdc95da6..21c757b3172 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::MPEiX;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
index b80781bd955..3f49c8288a5 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::MacOS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
use vars qw(@ISA);
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm
index 95e31515876..4717481fb86 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::RiscOS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
index 0be5fc7df07..611c2cf8d3d 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Unix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
index f406b7afb6f..4842e6cbde9 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::VMS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
use Config;
@@ -77,10 +77,29 @@ Prefixify taking into account VMS' filepath syntax.
=cut
# Translated from ExtUtils::MM_VMS::prefixify()
+
+sub _catprefix {
+ my($self, $rprefix, $default) = @_;
+
+ my($rvol, $rdirs) = File::Spec->splitpath($rprefix);
+ if( $rvol ) {
+ return File::Spec->catpath($rvol,
+ File::Spec->catdir($rdirs, $default),
+ ''
+ )
+ }
+ else {
+ return File::Spec->catdir($rdirs, $default);
+ }
+}
+
+
sub _prefixify {
my($self, $path, $sprefix, $type) = @_;
my $rprefix = $self->prefix;
+ return '' unless defined $path;
+
$self->log_verbose(" prefixify $path from $sprefix to $rprefix\n");
# Translate $(PERLPREFIX) to a real path.
@@ -90,7 +109,7 @@ sub _prefixify {
$self->log_verbose(" rprefix translated to $rprefix\n".
" sprefix translated to $sprefix\n");
- if( length $path == 0 ) {
+ if( length($path) == 0 ) {
$self->log_verbose(" no path to prefixify.\n")
}
elsif( !File::Spec->file_name_is_absolute($path) ) {
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
index 001a9507d44..bec44da6af9 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::VOS;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
index 1e248a75c5f..5094c41629e 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::Windows;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Config;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
index dab064805d3..cd4cf24ceb4 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/aix.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::aix;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
index 37c59ad0ce2..2ecd9ae5561 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::cygwin;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
@@ -14,7 +14,7 @@ sub manpage_separator {
}
# Copied from ExtUtils::MM_Cygwin::maybe_command()
-# If our path begins with F</cygdrive/> then we use C<ExtUtils::MM_Win32>
+# If our path begins with F</cygdrive/> then we use the Windows version
# to determine if it may be a command. Otherwise we use the tests
# from C<ExtUtils::MM_Unix>.
@@ -22,8 +22,8 @@ sub _maybe_command {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i) {
- require Module::Build::Platform::Win32;
- return Module::Build::Platform::Win32->_maybe_command($file);
+ require Module::Build::Platform::Windows;
+ return Module::Build::Platform::Windows->_maybe_command($file);
}
return $self->SUPER::_maybe_command($file);
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
index c2f3126c440..e7d256a839e 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::darwin;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
index be164ae980b..d9436713ba8 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Platform/os2.pm
@@ -2,7 +2,7 @@ package Module::Build::Platform::os2;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Module::Build::Platform::Unix;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
index 225450c6b98..8230192056f 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/PodParser.pm
@@ -2,7 +2,7 @@ package Module::Build::PodParser;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use vars qw(@ISA);
@@ -11,17 +11,8 @@ sub new {
my $package = shift;
my $self;
-
- # Try using Pod::Parser first
- if (eval{ require Pod::Parser; 1; }) {
- @ISA = qw(Pod::Parser);
- $self = $package->SUPER::new(@_);
- $self->{have_pod_parser} = 1;
- } else {
- @ISA = ();
- *parse_from_filehandle = \&_myparse_from_filehandle;
- $self = bless {have_pod_parser => 0, @_}, $package;
- }
+ @ISA = ();
+ $self = bless {have_pod_parser => 0, @_}, $package;
unless ($self->{fh}) {
die "No 'file' or 'fh' parameter given" unless $self->{file};
@@ -31,7 +22,7 @@ sub new {
return $self;
}
-sub _myparse_from_filehandle {
+sub parse_from_filehandle {
my ($self, $fh) = @_;
local $_;
@@ -71,36 +62,3 @@ sub get_author {
return $self->{author} || [];
}
-
-################## Pod::Parser overrides ###########
-sub initialize {
- my $self = shift;
- $self->{_head} = '';
- $self->SUPER::initialize();
-}
-
-sub command {
- my ($self, $cmd, $text) = @_;
- if ( $cmd eq 'head1' ) {
- $text =~ s/^\s+//;
- $text =~ s/\s+$//;
- $self->{_head} = $text;
- }
-}
-
-sub textblock {
- my ($self, $text) = @_;
- $text =~ s/^\s+//;
- $text =~ s/\s+$//;
- if (uc $self->{_head} eq 'NAME') {
- my ($name, $abstract) = split( /\s+-\s+/, $text, 2 );
- $self->{abstract} = $abstract;
- } elsif ($self->{_head} =~ /^AUTHORS?$/i) {
- push @{$self->{author}}, $text if $text =~ /\@/;
- }
-}
-
-sub verbatim {}
-sub interior_sequence {}
-
-1;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Version.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Version.pm
index 21abe00cbe0..e659712ddb1 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Version.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/Version.pm
@@ -1,684 +1,21 @@
package Module::Build::Version;
use strict;
-
use vars qw($VERSION);
-$VERSION = 0.77;
-
-eval "use version $VERSION";
-if ($@) { # can't locate version files, use our own
-
- # Avoid redefined warnings if an old version.pm was available
- delete $version::{$_} foreach keys %version::;
-
- # first we get the stub version module
- my $version;
- while (<DATA>) {
- s/(\$VERSION)\s=\s\d+/\$VERSION = 0/;
- $version .= $_ if $_;
- last if /^1;$/;
- }
-
- # and now get the current version::vpp code
- my $vpp;
- while (<DATA>) {
- s/(\$VERSION)\s=\s\d+/\$VERSION = 0/;
- $vpp .= $_ if $_;
- last if /^1;$/;
- }
-
- # but we eval them in reverse order since version depends on
- # version::vpp to already exist
- eval $vpp; die $@ if $@;
- $INC{'version/vpp.pm'} = 'inside Module::Build::Version';
- eval $version; die $@ if $@;
- $INC{'version.pm'} = 'inside Module::Build::Version';
-}
-
-# now we can safely subclass version, installed or not
-use vars qw(@ISA);
-@ISA = qw(version);
-
-1;
-__DATA__
-# stub version module to make everything else happy
-package version;
-
-use 5.005_04;
-use strict;
-
-use vars qw(@ISA $VERSION $CLASS *declare *qv);
-
-$VERSION = 0.77;
-
-$CLASS = 'version';
-
-push @ISA, "version::vpp";
-local $^W;
-*version::qv = \&version::vpp::qv;
-*version::declare = \&version::vpp::declare;
-*version::_VERSION = \&version::vpp::_VERSION;
-if ($] > 5.009001 && $] <= 5.010000) {
- no strict 'refs';
- *{'version::stringify'} = \*version::vpp::stringify;
- *{'version::(""'} = \*version::vpp::stringify;
- *{'version::new'} = \*version::vpp::new;
-}
-
-# Preloaded methods go here.
-sub import {
- no strict 'refs';
- my ($class) = shift;
-
- # Set up any derived class
- unless ($class eq 'version') {
- local $^W;
- *{$class.'::declare'} = \&version::declare;
- *{$class.'::qv'} = \&version::qv;
- }
-
- my %args;
- if (@_) { # any remaining terms are arguments
- map { $args{$_} = 1 } @_
- }
- else { # no parameters at all on use line
- %args =
- (
- qv => 1,
- 'UNIVERSAL::VERSION' => 1,
- );
- }
-
- my $callpkg = caller();
-
- if (exists($args{declare})) {
- *{$callpkg."::declare"} =
- sub {return $class->declare(shift) }
- unless defined(&{$callpkg.'::declare'});
- }
-
- if (exists($args{qv})) {
- *{$callpkg."::qv"} =
- sub {return $class->qv(shift) }
- unless defined(&{"$callpkg\::qv"});
- }
-
- if (exists($args{'UNIVERSAL::VERSION'})) {
- local $^W;
- *UNIVERSAL::VERSION = \&version::_VERSION;
- }
+$VERSION = '0.87'; ### XXX sync with version of version.pm below
- if (exists($args{'VERSION'})) {
- *{$callpkg."::VERSION"} = \&version::_VERSION;
- }
-}
+use version 0.87;
+our @ISA = qw(version);
1;
-# replace everything from here to the end with the current version/vpp.pm
-package version::vpp;
-use strict;
-
-use POSIX qw/locale_h/;
-use locale;
-use vars qw ($VERSION @ISA @REGEXS);
-$VERSION = '0.77';
-$VERSION = eval $VERSION;
-
-push @REGEXS, qr/
- ^v? # optional leading 'v'
- (\d*) # major revision not required
- \. # requires at least one decimal
- (?:(\d+)\.?){1,}
- /x;
-
-use overload (
- '""' => \&stringify,
- '0+' => \&numify,
- 'cmp' => \&vcmp,
- '<=>' => \&vcmp,
- 'bool' => \&vbool,
- 'nomethod' => \&vnoop,
-);
-
-my $VERSION_MAX = 0x7FFFFFFF;
-
-eval "use warnings";
-if ($@) {
- eval '
- package warnings;
- sub enabled {return $^W;}
- 1;
- ';
-}
-
-sub new
-{
- my ($class, $value) = @_;
- my $self = bless ({}, ref ($class) || $class);
-
- if ( ref($value) && eval('$value->isa("version")') ) {
- # Can copy the elements directly
- $self->{version} = [ @{$value->{version} } ];
- $self->{qv} = 1 if $value->{qv};
- $self->{alpha} = 1 if $value->{alpha};
- $self->{original} = ''.$value->{original};
- return $self;
- }
-
- my $currlocale = setlocale(LC_ALL);
-
- # if the current locale uses commas for decimal points, we
- # just replace commas with decimal places, rather than changing
- # locales
- if ( localeconv()->{decimal_point} eq ',' ) {
- $value =~ tr/,/./;
- }
-
- if ( not defined $value or $value =~ /^undef$/ ) {
- # RT #19517 - special case for undef comparison
- # or someone forgot to pass a value
- push @{$self->{version}}, 0;
- $self->{original} = "0";
- return ($self);
- }
-
- if ( $#_ == 2 ) { # must be CVS-style
- $value = 'v'.$_[2];
- }
-
- $value = _un_vstring($value);
-
- # exponential notation
- if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
- $value = sprintf("%.9f",$value);
- $value =~ s/(0+)$//; # trim trailing zeros
- }
-
- # This is not very efficient, but it is morally equivalent
- # to the XS code (as that is the reference implementation).
- # See vutil/vutil.c for details
- my $qv = 0;
- my $alpha = 0;
- my $width = 3;
- my $saw_period = 0;
- my $vinf = 0;
- my ($start, $last, $pos, $s);
- $s = 0;
-
- while ( substr($value,$s,1) =~ /\s/ ) { # leading whitespace is OK
- $s++;
- }
-
- if (substr($value,$s,1) eq 'v') {
- $s++; # get past 'v'
- $qv = 1; # force quoted version processing
- }
-
- $start = $last = $pos = $s;
-
- # pre-scan the input string to check for decimals/underbars
- while ( substr($value,$pos,1) =~ /[._\d,]/ ) {
- if ( substr($value,$pos,1) eq '.' ) {
- if ($alpha) {
- Carp::croak("Invalid version format ".
- "(underscores before decimal)");
- }
- $saw_period++;
- $last = $pos;
- }
- elsif ( substr($value,$pos,1) eq '_' ) {
- if ($alpha) {
- require Carp;
- Carp::croak("Invalid version format ".
- "(multiple underscores)");
- }
- $alpha = 1;
- $width = $pos - $last - 1; # natural width of sub-version
- }
- elsif ( substr($value,$pos,1) eq ','
- and substr($value,$pos+1,1) =~ /[0-9]/ ) {
- # looks like an unhandled locale
- $saw_period++;
- $last = $pos;
- }
- $pos++;
- }
-
- if ( $alpha && !$saw_period ) {
- require Carp;
- Carp::croak("Invalid version format ".
- "(alpha without decimal)");
- }
-
- if ( $alpha && $saw_period && $width == 0 ) {
- require Carp;
- Carp::croak("Invalid version format ".
- "(misplaced _ in number)");
- }
-
- if ( $saw_period > 1 ) {
- $qv = 1; # force quoted version processing
- }
-
- $last = $pos;
- $pos = $s;
-
- if ( $qv ) {
- $self->{qv} = 1;
- }
-
- if ( $alpha ) {
- $self->{alpha} = 1;
- }
-
- if ( !$qv && $width < 3 ) {
- $self->{width} = $width;
- }
-
- while ( substr($value,$pos,1) =~ /\d/ ) {
- $pos++;
- }
-
- if ( substr($value,$pos,1) !~ /[a-z]/ ) { ### FIX THIS ###
- my $rev;
-
- while (1) {
- $rev = 0;
- {
-
- # this is atoi() that delimits on underscores
- my $end = $pos;
- my $mult = 1;
- my $orev;
-
- # the following if() will only be true after the decimal
- # point of a version originally created with a bare
- # floating point number, i.e. not quoted in any way
- if ( !$qv && $s > $start && $saw_period == 1 ) {
- $mult *= 100;
- while ( $s < $end ) {
- $orev = $rev;
- $rev += substr($value,$s,1) * $mult;
- $mult /= 10;
- if ( abs($orev) > abs($rev)
- || abs($rev) > abs($VERSION_MAX) ) {
- if ( warnings::enabled("overflow") ) {
- require Carp;
- Carp::carp("Integer overflow in version");
- }
- $s = $end - 1;
- $rev = $VERSION_MAX;
- }
- $s++;
- if ( substr($value,$s,1) eq '_' ) {
- $s++;
- }
- }
- }
- else {
- while (--$end >= $s) {
- $orev = $rev;
- $rev += substr($value,$end,1) * $mult;
- $mult *= 10;
- if ( abs($orev) > abs($rev)
- || abs($rev) > abs($VERSION_MAX) ) {
- if ( warnings::enabled("overflow") ) {
- require Carp;
- Carp::carp("Integer overflow in version");
- }
- $end = $s - 1;
- $rev = $VERSION_MAX;
- }
- }
- }
- }
-
- # Append revision
- push @{$self->{version}}, $rev;
- if ( substr($value,$pos,1) eq '.'
- && substr($value,$pos+1,1) =~ /\d/ ) {
- $s = ++$pos;
- }
- elsif ( substr($value,$pos,1) eq '_'
- && substr($value,$pos+1,1) =~ /\d/ ) {
- $s = ++$pos;
- }
- elsif ( substr($value,$pos,1) eq ','
- && substr($value,$pos+1,1) =~ /\d/ ) {
- $s = ++$pos;
- }
- elsif ( substr($value,$pos,1) =~ /\d/ ) {
- $s = $pos;
- }
- else {
- $s = $pos;
- last;
- }
- if ( $qv ) {
- while ( substr($value,$pos,1) =~ /\d/ ) {
- $pos++;
- }
- }
- else {
- my $digits = 0;
- while (substr($value,$pos,1) =~ /[\d_]/ && $digits < 3) {
- if ( substr($value,$pos,1) ne '_' ) {
- $digits++;
- }
- $pos++;
- }
- }
- }
- }
- if ( $qv ) { # quoted versions always get at least three terms
- my $len = scalar @{$self->{version}};
- $len = 3 - $len;
- while ($len-- > 0) {
- push @{$self->{version}}, 0;
- }
- }
-
- if ( substr($value,$pos) ) { # any remaining text
- if ( warnings::enabled("misc") ) {
- require Carp;
- Carp::carp("Version string '$value' contains invalid data; ".
- "ignoring: '".substr($value,$pos)."'");
- }
- }
-
- # cache the original value for use when stringification
- if ( $vinf ) {
- $self->{vinf} = 1;
- $self->{original} = 'v.Inf';
- }
- else {
- $self->{original} = substr($value,0,$pos);
- }
-
- return ($self);
-}
-
-*parse = \&new;
-
-sub numify
-{
- my ($self) = @_;
- unless (_verify($self)) {
- require Carp;
- Carp::croak("Invalid version object");
- }
- my $width = $self->{width} || 3;
- my $alpha = $self->{alpha} || "";
- my $len = $#{$self->{version}};
- my $digit = $self->{version}[0];
- my $string = sprintf("%d.", $digit );
-
- for ( my $i = 1 ; $i < $len ; $i++ ) {
- $digit = $self->{version}[$i];
- if ( $width < 3 ) {
- my $denom = 10**(3-$width);
- my $quot = int($digit/$denom);
- my $rem = $digit - ($quot * $denom);
- $string .= sprintf("%0".$width."d_%d", $quot, $rem);
- }
- else {
- $string .= sprintf("%03d", $digit);
- }
- }
-
- if ( $len > 0 ) {
- $digit = $self->{version}[$len];
- if ( $alpha && $width == 3 ) {
- $string .= "_";
- }
- $string .= sprintf("%0".$width."d", $digit);
- }
- else # $len = 0
- {
- $string .= sprintf("000");
- }
-
- return $string;
-}
-
-sub normal
-{
- my ($self) = @_;
- unless (_verify($self)) {
- require Carp;
- Carp::croak("Invalid version object");
- }
- my $alpha = $self->{alpha} || "";
- my $len = $#{$self->{version}};
- my $digit = $self->{version}[0];
- my $string = sprintf("v%d", $digit );
-
- for ( my $i = 1 ; $i < $len ; $i++ ) {
- $digit = $self->{version}[$i];
- $string .= sprintf(".%d", $digit);
- }
-
- if ( $len > 0 ) {
- $digit = $self->{version}[$len];
- if ( $alpha ) {
- $string .= sprintf("_%0d", $digit);
- }
- else {
- $string .= sprintf(".%0d", $digit);
- }
- }
-
- if ( $len <= 2 ) {
- for ( $len = 2 - $len; $len != 0; $len-- ) {
- $string .= sprintf(".%0d", 0);
- }
- }
-
- return $string;
-}
-
-sub stringify
-{
- my ($self) = @_;
- unless (_verify($self)) {
- require Carp;
- Carp::croak("Invalid version object");
- }
- return exists $self->{original}
- ? $self->{original}
- : exists $self->{qv}
- ? $self->normal
- : $self->numify;
-}
-
-sub vcmp
-{
- require UNIVERSAL;
- my ($left,$right,$swap) = @_;
- my $class = ref($left);
- unless ( UNIVERSAL::isa($right, $class) ) {
- $right = $class->new($right);
- }
-
- if ( $swap ) {
- ($left, $right) = ($right, $left);
- }
- unless (_verify($left)) {
- require Carp;
- Carp::croak("Invalid version object");
- }
- unless (_verify($right)) {
- require Carp;
- Carp::croak("Invalid version object");
- }
- my $l = $#{$left->{version}};
- my $r = $#{$right->{version}};
- my $m = $l < $r ? $l : $r;
- my $lalpha = $left->is_alpha;
- my $ralpha = $right->is_alpha;
- my $retval = 0;
- my $i = 0;
- while ( $i <= $m && $retval == 0 ) {
- $retval = $left->{version}[$i] <=> $right->{version}[$i];
- $i++;
- }
-
- # tiebreaker for alpha with identical terms
- if ( $retval == 0
- && $l == $r
- && $left->{version}[$m] == $right->{version}[$m]
- && ( $lalpha || $ralpha ) ) {
-
- if ( $lalpha && !$ralpha ) {
- $retval = -1;
- }
- elsif ( $ralpha && !$lalpha) {
- $retval = +1;
- }
- }
-
- # possible match except for trailing 0's
- if ( $retval == 0 && $l != $r ) {
- if ( $l < $r ) {
- while ( $i <= $r && $retval == 0 ) {
- if ( $right->{version}[$i] != 0 ) {
- $retval = -1; # not a match after all
- }
- $i++;
- }
- }
- else {
- while ( $i <= $l && $retval == 0 ) {
- if ( $left->{version}[$i] != 0 ) {
- $retval = +1; # not a match after all
- }
- $i++;
- }
- }
- }
-
- return $retval;
-}
-
-sub vbool {
- my ($self) = @_;
- return vcmp($self,$self->new("0"),1);
-}
-
-sub vnoop {
- require Carp;
- Carp::croak("operation not supported with version object");
-}
-
-sub is_alpha {
- my ($self) = @_;
- return (exists $self->{alpha});
-}
-
-sub qv {
- my $value = shift;
- my $class = 'version';
- if (@_) {
- $class = ref($value) || $value;
- $value = shift;
- }
-
- $value = _un_vstring($value);
- $value = 'v'.$value unless $value =~ /(^v|\d+\.\d+\.\d)/;
- my $version = $class->new($value);
- return $version;
-}
-
-*declare = \&qv;
-
-sub is_qv {
- my ($self) = @_;
- return (exists $self->{qv});
-}
-
-
-sub _verify {
- my ($self) = @_;
- if ( ref($self)
- && eval { exists $self->{version} }
- && ref($self->{version}) eq 'ARRAY'
- ) {
- return 1;
- }
- else {
- return 0;
- }
-}
-
-sub _un_vstring {
- my $value = shift;
- # may be a v-string
- if ( $] >= 5.006_000 && length($value) >= 3 && $value !~ /[._]/ ) {
- my $tvalue = sprintf("v%vd",$value);
- if ( $tvalue =~ /^v\d+\.\d+\.\d+$/ ) {
- # must be a v-string
- $value = $tvalue;
- }
- }
- return $value;
-}
-
-sub _VERSION {
- my ($obj, $req) = @_;
- my $class = ref($obj) || $obj;
-
- no strict 'refs';
- if ( exists $INC{"$class.pm"} and not %{"$class\::"} and $] >= 5.008) {
- # file but no package
- require Carp;
- Carp::croak( "$class defines neither package nor VERSION"
- ."--version check failed");
- }
-
- my $version = eval "\$$class\::VERSION";
- if ( defined $version ) {
- local $^W if $] <= 5.008;
- $version = version::vpp->new($version);
- }
-
- if ( defined $req ) {
- unless ( defined $version ) {
- require Carp;
- my $msg = $] < 5.006
- ? "$class version $req required--this is only version "
- : "$class does not define \$$class\::VERSION"
- ."--version check failed";
+=head1 NAME
- if ( $ENV{VERSION_DEBUG} ) {
- Carp::confess($msg);
- }
- else {
- Carp::croak($msg);
- }
- }
+Module::Build::Version - DEPRECATED
- $req = version::vpp->new($req);
+=head1 DESCRIPTION
- if ( $req > $version ) {
- require Carp;
- if ( $req->is_qv ) {
- Carp::croak(
- sprintf ("%s version %s required--".
- "this is only version %s", $class,
- $req->normal, $version->normal)
- );
- }
- else {
- Carp::croak(
- sprintf ("%s version %s required--".
- "this is only version %s", $class,
- $req->stringify, $version->stringify)
- );
- }
- }
- }
+Module::Build now lists L<version> as a C<configure_requires> dependency
+and no longer installs a copy.
- return defined $version ? $version->stringify : undef;
-}
+=cut
-1; #this line is important and will help the module return a true value
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/YAML.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/YAML.pm
index 2da91f22563..133dee54274 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/YAML.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/Module/Build/YAML.pm
@@ -1,600 +1,19 @@
-# Adapted from YAML::Tiny 1.40
package Module::Build::YAML;
-
use strict;
-use Carp 'croak';
-
-# UTF Support?
-sub HAVE_UTF8 () { $] >= 5.007003 }
-BEGIN {
- if ( HAVE_UTF8 ) {
- # The string eval helps hide this from Test::MinimumVersion
- eval "require utf8;";
- die "Failed to load UTF-8 support" if $@;
- }
-
- # Class structure
- require 5.004;
-
- $Module::Build::YAML::VERSION = '1.40';
-
- # Error storage
- $Module::Build::YAML::errstr = '';
-}
-
-# The character class of all characters we need to escape
-# NOTE: Inlined, since it's only used once
-# my $RE_ESCAPE = '[\\x00-\\x08\\x0b-\\x0d\\x0e-\\x1f\"\n]';
-
-# Printed form of the unprintable characters in the lowest range
-# of ASCII characters, listed by ASCII ordinal position.
-my @UNPRINTABLE = qw(
- z x01 x02 x03 x04 x05 x06 a
- x08 t n v f r x0e x0f
- x10 x11 x12 x13 x14 x15 x16 x17
- x18 x19 x1a e x1c x1d x1e x1f
-);
-
-# Printable characters for escapes
-my %UNESCAPES = (
- z => "\x00", a => "\x07", t => "\x09",
- n => "\x0a", v => "\x0b", f => "\x0c",
- r => "\x0d", e => "\x1b", '\\' => '\\',
-);
-
-# Special magic boolean words
-my %QUOTE = map { $_ => 1 } qw{
- null Null NULL
- y Y yes Yes YES n N no No NO
- true True TRUE false False FALSE
- on On ON off Off OFF
-};
-
-#####################################################################
-# Implementation
-
-# Create an empty Module::Build::YAML object
-sub new {
- my $class = shift;
- bless [ @_ ], $class;
-}
-
-# Create an object from a file
-sub read {
- my $class = ref $_[0] ? ref shift : shift;
-
- # Check the file
- my $file = shift or return $class->_error( 'You did not specify a file name' );
- return $class->_error( "File '$file' does not exist" ) unless -e $file;
- return $class->_error( "'$file' is a directory, not a file" ) unless -f _;
- return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _;
-
- # Slurp in the file
- local $/ = undef;
- local *CFG;
- unless ( open(CFG, $file) ) {
- return $class->_error("Failed to open file '$file': $!");
- }
- my $contents = <CFG>;
- unless ( close(CFG) ) {
- return $class->_error("Failed to close file '$file': $!");
- }
-
- $class->read_string( $contents );
-}
-
-# Create an object from a string
-sub read_string {
- my $class = ref $_[0] ? ref shift : shift;
- my $self = bless [], $class;
- my $string = $_[0];
- unless ( defined $string ) {
- return $self->_error("Did not provide a string to load");
- }
-
- # Byte order marks
- # NOTE: Keeping this here to educate maintainers
- # my %BOM = (
- # "\357\273\277" => 'UTF-8',
- # "\376\377" => 'UTF-16BE',
- # "\377\376" => 'UTF-16LE',
- # "\377\376\0\0" => 'UTF-32LE'
- # "\0\0\376\377" => 'UTF-32BE',
- # );
- if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
- return $self->_error("Stream has a non UTF-8 BOM");
- } else {
- # Strip UTF-8 bom if found, we'll just ignore it
- $string =~ s/^\357\273\277//;
- }
-
- # Try to decode as utf8
- utf8::decode($string) if HAVE_UTF8;
-
- # Check for some special cases
- return $self unless length $string;
- unless ( $string =~ /[\012\015]+\z/ ) {
- return $self->_error("Stream does not end with newline character");
- }
-
- # Split the file into lines
- my @lines = grep { ! /^\s*(?:\#.*)?\z/ }
- split /(?:\015{1,2}\012|\015|\012)/, $string;
-
- # Strip the initial YAML header
- @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines;
-
- # A nibbling parser
- while ( @lines ) {
- # Do we have a document header?
- if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) {
- # Handle scalar documents
- shift @lines;
- if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) {
- push @$self, $self->_read_scalar( "$1", [ undef ], \@lines );
- next;
- }
- }
-
- if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) {
- # A naked document
- push @$self, undef;
- while ( @lines and $lines[0] !~ /^---/ ) {
- shift @lines;
- }
-
- } elsif ( $lines[0] =~ /^\s*\-/ ) {
- # An array at the root
- my $document = [ ];
- push @$self, $document;
- $self->_read_array( $document, [ 0 ], \@lines );
-
- } elsif ( $lines[0] =~ /^(\s*)\S/ ) {
- # A hash at the root
- my $document = { };
- push @$self, $document;
- $self->_read_hash( $document, [ length($1) ], \@lines );
-
- } else {
- croak("Module::Build::YAML failed to classify the line '$lines[0]'");
- }
- }
-
- $self;
-}
-
-# Deparse a scalar string to the actual scalar
-sub _read_scalar {
- my ($self, $string, $indent, $lines) = @_;
-
- # Trim trailing whitespace
- $string =~ s/\s*\z//;
-
- # Explitic null/undef
- return undef if $string eq '~';
-
- # Quotes
- if ( $string =~ /^\'(.*?)\'\z/ ) {
- return '' unless defined $1;
- $string = $1;
- $string =~ s/\'\'/\'/g;
- return $string;
- }
- if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) {
- # Reusing the variable is a little ugly,
- # but avoids a new variable and a string copy.
- $string = $1;
- $string =~ s/\\"/"/g;
- $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex;
- return $string;
- }
-
- # Special cases
- if ( $string =~ /^[\'\"!&]/ ) {
- croak("Module::Build::YAML does not support a feature in line '$lines->[0]'");
- }
- return {} if $string eq '{}';
- return [] if $string eq '[]';
-
- # Regular unquoted string
- return $string unless $string =~ /^[>|]/;
-
- # Error
- croak("Module::Build::YAML failed to find multi-line scalar content") unless @$lines;
-
- # Check the indent depth
- $lines->[0] =~ /^(\s*)/;
- $indent->[-1] = length("$1");
- if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) {
- croak("Module::Build::YAML found bad indenting in line '$lines->[0]'");
- }
-
- # Pull the lines
- my @multiline = ();
- while ( @$lines ) {
- $lines->[0] =~ /^(\s*)/;
- last unless length($1) >= $indent->[-1];
- push @multiline, substr(shift(@$lines), length($1));
- }
-
- my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
- my $t = (substr($string, 1, 1) eq '-') ? '' : "\n";
- return join( $j, @multiline ) . $t;
-}
-
-# Parse an array
-sub _read_array {
- my ($self, $array, $indent, $lines) = @_;
-
- while ( @$lines ) {
- # Check for a new document
- if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
- while ( @$lines and $lines->[0] !~ /^---/ ) {
- shift @$lines;
- }
- return 1;
- }
-
- # Check the indent level
- $lines->[0] =~ /^(\s*)/;
- if ( length($1) < $indent->[-1] ) {
- return 1;
- } elsif ( length($1) > $indent->[-1] ) {
- croak("Module::Build::YAML found bad indenting in line '$lines->[0]'");
- }
-
- if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) {
- # Inline nested hash
- my $indent2 = length("$1");
- $lines->[0] =~ s/-/ /;
- push @$array, { };
- $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines );
-
- } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) {
- # Array entry with a value
- shift @$lines;
- push @$array, $self->_read_scalar( "$2", [ @$indent, undef ], $lines );
-
- } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) {
- shift @$lines;
- unless ( @$lines ) {
- push @$array, undef;
- return 1;
- }
- if ( $lines->[0] =~ /^(\s*)\-/ ) {
- my $indent2 = length("$1");
- if ( $indent->[-1] == $indent2 ) {
- # Null array entry
- push @$array, undef;
- } else {
- # Naked indenter
- push @$array, [ ];
- $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines );
- }
-
- } elsif ( $lines->[0] =~ /^(\s*)\S/ ) {
- push @$array, { };
- $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines );
-
- } else {
- croak("Module::Build::YAML failed to classify line '$lines->[0]'");
- }
-
- } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) {
- # This is probably a structure like the following...
- # ---
- # foo:
- # - list
- # bar: value
- #
- # ... so lets return and let the hash parser handle it
- return 1;
-
- } else {
- croak("Module::Build::YAML failed to classify line '$lines->[0]'");
- }
- }
-
- return 1;
-}
-
-# Parse an array
-sub _read_hash {
- my ($self, $hash, $indent, $lines) = @_;
-
- while ( @$lines ) {
- # Check for a new document
- if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
- while ( @$lines and $lines->[0] !~ /^---/ ) {
- shift @$lines;
- }
- return 1;
- }
-
- # Check the indent level
- $lines->[0] =~ /^(\s*)/;
- if ( length($1) < $indent->[-1] ) {
- return 1;
- } elsif ( length($1) > $indent->[-1] ) {
- croak("Module::Build::YAML found bad indenting in line '$lines->[0]'");
- }
-
- # Get the key
- unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) {
- if ( $lines->[0] =~ /^\s*[?\'\"]/ ) {
- croak("Module::Build::YAML does not support a feature in line '$lines->[0]'");
- }
- croak("Module::Build::YAML failed to classify line '$lines->[0]'");
- }
- my $key = $1;
-
- # Do we have a value?
- if ( length $lines->[0] ) {
- # Yes
- $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines );
- } else {
- # An indent
- shift @$lines;
- unless ( @$lines ) {
- $hash->{$key} = undef;
- return 1;
- }
- if ( $lines->[0] =~ /^(\s*)-/ ) {
- $hash->{$key} = [];
- $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines );
- } elsif ( $lines->[0] =~ /^(\s*)./ ) {
- my $indent2 = length("$1");
- if ( $indent->[-1] >= $indent2 ) {
- # Null hash entry
- $hash->{$key} = undef;
- } else {
- $hash->{$key} = {};
- $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
- }
- }
- }
- }
-
- return 1;
-}
-
-# Save an object to a file
-sub write {
- my $self = shift;
- my $file = shift or return $self->_error('No file name provided');
-
- # Write it to the file
- open( CFG, '>' . $file ) or return $self->_error(
- "Failed to open file '$file' for writing: $!"
- );
- print CFG $self->write_string;
- close CFG;
-
- return 1;
-}
-
-# Save an object to a string
-sub write_string {
- my $self = shift;
- return '' unless @$self;
-
- # Iterate over the documents
- my $indent = 0;
- my @lines = ();
- foreach my $cursor ( @$self ) {
- push @lines, '---';
-
- # An empty document
- if ( ! defined $cursor ) {
- # Do nothing
-
- # A scalar document
- } elsif ( ! ref $cursor ) {
- $lines[-1] .= ' ' . $self->_write_scalar( $cursor, $indent );
-
- # A list at the root
- } elsif ( ref $cursor eq 'ARRAY' ) {
- unless ( @$cursor ) {
- $lines[-1] .= ' []';
- next;
- }
- push @lines, $self->_write_array( $cursor, $indent, {} );
-
- # A hash at the root
- } elsif ( ref $cursor eq 'HASH' ) {
- unless ( %$cursor ) {
- $lines[-1] .= ' {}';
- next;
- }
- push @lines, $self->_write_hash( $cursor, $indent, {} );
-
- } else {
- croak("Cannot serialize " . ref($cursor));
- }
- }
-
- join '', map { "$_\n" } @lines;
-}
-
-sub _write_scalar {
- my $string = $_[1];
- return '~' unless defined $string;
- return "''" unless length $string;
- if ( $string =~ /[\x00-\x08\x0b-\x0d\x0e-\x1f\"\'\n]/ ) {
- $string =~ s/\\/\\\\/g;
- $string =~ s/"/\\"/g;
- $string =~ s/\n/\\n/g;
- $string =~ s/([\x00-\x1f])/\\$UNPRINTABLE[ord($1)]/g;
- return qq|"$string"|;
- }
- if ( $string =~ /(?:^\W|\s)/ or $QUOTE{$string} ) {
- return "'$string'";
- }
- return $string;
-}
-
-sub _write_array {
- my ($self, $array, $indent, $seen) = @_;
- if ( $seen->{refaddr($array)}++ ) {
- die "Module::Build::YAML does not support circular references";
- }
- my @lines = ();
- foreach my $el ( @$array ) {
- my $line = (' ' x $indent) . '-';
- my $type = ref $el;
- if ( ! $type ) {
- $line .= ' ' . $self->_write_scalar( $el, $indent + 1 );
- push @lines, $line;
-
- } elsif ( $type eq 'ARRAY' ) {
- if ( @$el ) {
- push @lines, $line;
- push @lines, $self->_write_array( $el, $indent + 1, $seen );
- } else {
- $line .= ' []';
- push @lines, $line;
- }
-
- } elsif ( $type eq 'HASH' ) {
- if ( keys %$el ) {
- push @lines, $line;
- push @lines, $self->_write_hash( $el, $indent + 1, $seen );
- } else {
- $line .= ' {}';
- push @lines, $line;
- }
-
- } else {
- die "Module::Build::YAML does not support $type references";
- }
- }
-
- @lines;
-}
-
-sub _write_hash {
- my ($self, $hash, $indent, $seen) = @_;
- if ( $seen->{refaddr($hash)}++ ) {
- die "Module::Build::YAML does not support circular references";
- }
- my @lines = ();
- foreach my $name ( sort keys %$hash ) {
- my $el = $hash->{$name};
- my $line = (' ' x $indent) . "$name:";
- my $type = ref $el;
- if ( ! $type ) {
- $line .= ' ' . $self->_write_scalar( $el, $indent + 1 );
- push @lines, $line;
-
- } elsif ( $type eq 'ARRAY' ) {
- if ( @$el ) {
- push @lines, $line;
- push @lines, $self->_write_array( $el, $indent + 1, $seen );
- } else {
- $line .= ' []';
- push @lines, $line;
- }
-
- } elsif ( $type eq 'HASH' ) {
- if ( keys %$el ) {
- push @lines, $line;
- push @lines, $self->_write_hash( $el, $indent + 1, $seen );
- } else {
- $line .= ' {}';
- push @lines, $line;
- }
-
- } else {
- die "Module::Build::YAML does not support $type references";
- }
- }
-
- @lines;
-}
-
-# Set error
-sub _error {
- $Module::Build::YAML::errstr = $_[1];
- undef;
-}
-
-# Retrieve error
-sub errstr {
- $Module::Build::YAML::errstr;
-}
-
-#####################################################################
-# YAML Compatibility
-
-sub Dump {
- Module::Build::YAML->new(@_)->write_string;
-}
-
-sub Load {
- my $self = Module::Build::YAML->read_string(@_);
- unless ( $self ) {
- croak("Failed to load YAML document from string");
- }
- if ( wantarray ) {
- return @$self;
- } else {
- # To match YAML.pm, return the last document
- return $self->[-1];
- }
-}
-
-BEGIN {
- *freeze = *Dump;
- *thaw = *Load;
-}
-
-sub DumpFile {
- my $file = shift;
- Module::Build::YAML->new(@_)->write($file);
-}
+use CPAN::Meta::YAML 0.002 ();
+our @ISA = qw(CPAN::Meta::YAML);
+our $VERSION = '1.41';
+1;
-sub LoadFile {
- my $self = Module::Build::YAML->read($_[0]);
- unless ( $self ) {
- croak("Failed to load YAML document from '" . ($_[0] || '') . "'");
- }
- if ( wantarray ) {
- return @$self;
- } else {
- # Return only the last document to match YAML.pm,
- return $self->[-1];
- }
-}
+=head1 NAME
-#####################################################################
-# Use Scalar::Util if possible, otherwise emulate it
+Module::Build::YAML - DEPRECATED
-BEGIN {
- eval {
- require Scalar::Util;
- };
- if ( $@ ) {
- # Failed to load Scalar::Util
- eval <<'END_PERL';
-sub refaddr {
- my $pkg = ref($_[0]) or return undef;
- if (!!UNIVERSAL::can($_[0], 'can')) {
- bless $_[0], 'Scalar::Util::Fake';
- } else {
- $pkg = undef;
- }
- "$_[0]" =~ /0x(\w+)/;
- my $i = do { local $^W; hex $1 };
- bless $_[0], $pkg if defined $pkg;
- $i;
-}
-END_PERL
- } else {
- Scalar::Util->import('refaddr');
- }
-}
+=head1 DESCRIPTION
-1;
+This module was originally an inline copy of L<YAML::Tiny>. It has been
+deprecated in favor of using L<CPAN::Meta::YAML> directly. This module is kept
+as a subclass wrapper for compatibility.
-__END__
+=cut
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest.pm
index fc9e2e94bf8..c83167197b7 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest.pm
@@ -1,7 +1,7 @@
package inc::latest;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use Carp;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest/private.pm b/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest/private.pm
index 572ae8a82cb..9e4d5d7b567 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest/private.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/lib/inc/latest/private.pm
@@ -1,7 +1,7 @@
package inc::latest::private;
use strict;
use vars qw($VERSION);
-$VERSION = '0.3603';
+$VERSION = '0.39_01';
$VERSION = eval $VERSION;
use File::Spec;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/actions/installdeps.t b/gnu/usr.bin/perl/cpan/Module-Build/t/actions/installdeps.t
index 95e221d0add..5df98336b5c 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/actions/installdeps.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/actions/installdeps.t
@@ -3,7 +3,7 @@ use lib 't/lib';
use MBTest;
use DistGen;
-plan tests => 7;
+plan tests => 6;
# Ensure any Module::Build modules are loaded from correct directory
blib_load('Module::Build');
@@ -33,8 +33,6 @@ my $out = stdout_of( sub {
$dist->run_build('installdeps')
});
ok( length($out), "ran mocked Build installdeps");
-my $expected = quotemeta(Module::Build->find_command($^X));
-like( $out, qr/$expected/i, "relative cpan_client resolved relative to \$^X" );
like( $out, qr/File::Spec/, "saw File::Spec prereq" );
like( $out, qr/Getopt::Long/, "saw Getopt::Long prereq" );
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/actions/manifest_skip.t b/gnu/usr.bin/perl/cpan/Module-Build/t/actions/manifest_skip.t
new file mode 100644
index 00000000000..a3677dd85c2
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/actions/manifest_skip.t
@@ -0,0 +1,54 @@
+use strict;
+use lib 't/lib';
+use MBTest;
+use DistGen;
+
+plan tests => 7;
+
+# Ensure any Module::Build modules are loaded from correct directory
+blib_load('Module::Build');
+
+# create dist object in a temp directory
+# enter the directory and generate the skeleton files
+my $dist = DistGen->new->chdir_in;
+$dist->change_build_pl(
+ module_name => $dist->name,
+ requires => {
+ 'File::Spec' => 9999,
+ },
+ build_requires => {
+ 'Getopt::Long' => 9998,
+ },
+ cpan_client => $^X . ' -le print($_)for($^X,@ARGV)',
+)->regen;
+
+ok( ! -e 'MANIFEST.SKIP', "MANIFEST.SKIP doesn't exist at start" );
+
+# get a Module::Build object and test with it
+my $mb;
+stdout_stderr_of( sub { $mb = $dist->new_from_context('verbose' => 1) } );
+isa_ok( $mb, "Module::Build" );
+
+my ($out, $err) = stdout_stderr_of( sub {
+ $dist->run_build('manifest_skip')
+});
+ok( -e 'MANIFEST.SKIP', "'Build manifest_skip' creates MANIFEST.SKIP" );
+like( $out, qr/Creating a new MANIFEST.SKIP file/, "Saw creation message");
+
+# shouldn't overwrite
+my $old_mtime = -M 'MANIFEST.SKIP';
+($out, $err) = stdout_stderr_of( sub {
+ $dist->run_build('manifest_skip')
+});
+like( $err, qr/MANIFEST.SKIP already exists/,
+ "Running it again warns about pre-existing MANIFEST.SKIP"
+);
+is( -M 'MANIFEST.SKIP', $old_mtime, "File does not appear modified" );
+
+# cleanup
+($out, $err) = stdout_stderr_of( sub {
+ $dist->run_build('distclean')
+});
+ok( -e 'MANIFEST.SKIP', "MANIFEST.SKIP still exists after distclean" );
+
+# vim:ts=2:sw=2:et:sta:sts=2
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/basic.t b/gnu/usr.bin/perl/cpan/Module-Build/t/basic.t
index 5d76ffaebd7..e26847e3d60 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/basic.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/basic.t
@@ -60,8 +60,8 @@ $dist->chdir_in;
ok $flagged;
ok $mb->prereq_failures;
ok $mb->prereq_failures->{requires}{$dist->name};
- is $mb->prereq_failures->{requires}{$dist->name}{have}, 0.01;
- is $mb->prereq_failures->{requires}{$dist->name}{need}, 3.14159265;
+ is $mb->prereq_failures->{requires}{$dist->name}{have}, "0.01";
+ is $mb->prereq_failures->{requires}{$dist->name}{need}, "3.14159265";
$mb->dispatch('realclean');
$dist->clean;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/bundled/Software/License.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/bundled/Software/License.pm
new file mode 100644
index 00000000000..6457ab60264
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/bundled/Software/License.pm
@@ -0,0 +1,56 @@
+# Modified from the original as a "mock" version for testing
+use strict;
+use warnings;
+use 5.006; # warnings
+package Software::License;
+our $VERSION = 9999;
+
+sub new {
+ my ($class, $arg) = @_;
+
+ # XXX changed from Carp::croak to die
+ die "no copyright holder specified" unless $arg->{holder};
+
+ bless $arg => $class;
+}
+
+
+sub year { defined $_[0]->{year} ? $_[0]->{year} : (localtime)[5]+1900 }
+sub holder { $_[0]->{holder} }
+
+sub version {
+ my ($self) = @_;
+ my $pkg = ref $self ? ref $self : $self;
+ $pkg =~ s/.+:://;
+ my (undef, @vparts) = split /_/, $pkg;
+
+ return unless @vparts;
+ return join '.', @vparts;
+}
+
+
+# sub meta1_name { return undef; } # sort this out later, should be easy
+sub meta_name { return undef; }
+sub meta_yml_name { $_[0]->meta_name }
+
+sub meta2_name {
+ my ($self) = @_;
+ my $meta1 = $self->meta_name;
+
+ return undef unless defined $meta1;
+
+ return $meta1
+ if $meta1 =~ /\A(?:open_source|restricted|unrestricted|unknown)\z/;
+
+ return undef;
+}
+
+# XXX these are trivial mocks of the real thing
+sub notice { 'NOTICE' }
+sub license { 'LICENSE' }
+sub fulltext { 'FULLTEXT' }
+
+1;
+
+
+
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/compat.t b/gnu/usr.bin/perl/cpan/Module-Build/t/compat.t
index 7e5a515eaaf..1546d2b814c 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/compat.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/compat.t
@@ -218,23 +218,25 @@ ok $mb, "Module::Build->new_from_context";
(my $libdir2 = $libdir) =~ s/libdir/lbiidr/;
my $libarch2 = File::Spec->catdir($libdir2, 'arch');
+ my $check_base = $libdir2;
+ $check_base =~ s/\]\z// if $^O eq 'VMS'; # trim trailing ] for appending other dirs
SKIP: {
my @cases = (
{
label => "INSTALLDIRS=vendor",
args => [ 'INSTALLDIRS=vendor', "INSTALLVENDORLIB=$libdir2", "INSTALLVENDORARCH=$libarch2"],
- check => qr/\Q$libdir2\E .* Simple\.pm/ix,
+ check => qr/\Q$check_base\E .* Simple\.pm/ix,
},
{
label => "PREFIX=\$libdir2",
args => [ "PREFIX=$libdir2"],
- check => qr/\Q$libdir2\E .* Simple\.pm/ix,
+ check => qr/\Q$check_base\E .* Simple\.pm/ix,
},
{
label => "PREFIX=\$libdir2 LIB=mylib",
args => [ "PREFIX=$libdir2", "LIB=mylib" ],
- check => qr{\Q$libdir2\E[/\\]mylib[/\\]Simple\.pm}ix,
+ check => qr{\Q$check_base\E[/\\\.]mylib[/\\\]]Simple\.pm}ix,
},
);
@@ -242,15 +244,8 @@ ok $mb, "Module::Build->new_from_context";
skip "Needs ExtUtils::Install 1.32 or later", 2 * @cases
if ExtUtils::Install->VERSION < 1.32;
- skip "Needs upstream patch at http://rt.cpan.org/Public/Bug/Display.html?id=55288", 2 * @cases
- if $^O eq 'VMS';
-
for my $c (@cases) {
my @make_args = @{$c->{args}};
- if ($is_vms_mms) { # VMS MMK/MMS macros use different syntax.
- $make_args[0] = '/macro=("' . join('","',@make_args) . '")';
- pop @make_args while scalar(@make_args) > 1;
- }
($output) = stdout_stderr_of(
sub {
$result = $mb->run_perl_script('Makefile.PL', [], \@make_args);
@@ -318,6 +313,63 @@ ok $mb, "Module::Build->new_from_context";
ok( ! exists $args->{TESTS}, 'Not using incorrect recursive tests key' );
}
+ 1 while unlink 'Makefile.PL';
+ ok ! -e 'Makefile.PL', "Makefile.PL cleaned up";
+}
+
+{
+ # make sure using prereq with '0.1.2' complains
+ $dist->change_build_pl({
+ module_name => $distname,
+ license => 'perl',
+ requires => {
+ 'Foo::Frobnicate' => '0.1.2',
+ },
+ create_makefile_pl => 'traditional',
+ });
+ $dist->regen;
+
+ my $mb;
+ stdout_stderr_of( sub {
+ $mb = Module::Build->new_from_context;
+ });
+
+ my $output = stdout_stderr_of( sub { $mb->do_create_makefile_pl } );
+ ok -e 'Makefile.PL', "Makefile.PL created";
+ like $output, qr/is not portable/, "Correctly complains and converts dotted-decimal";
+
+ my $file_contents = slurp 'Makefile.PL';
+ like $file_contents, qr/Foo::Frobnicate.+0\.001002/, "Properly converted dotted-decimal";
+
+ 1 while unlink 'Makefile.PL';
+ ok ! -e 'Makefile.PL', "Makefile.PL cleaned up";
+}
+
+{
+ # make sure using invalid prereq blows up
+ $dist->change_build_pl({
+ module_name => $distname,
+ license => 'perl',
+ requires => {
+ 'Foo::Frobnicate' => '3.5_2_7',
+ },
+ create_makefile_pl => 'traditional',
+ });
+ $dist->regen;
+
+ ok ! -e 'Makefile.PL', "Makefile.PL doesn't exist before we start";
+
+ my $mb;
+ stdout_stderr_of( sub {
+ $mb = $dist->run_build_pl;
+ });
+
+ my ($output, $error) = stdout_stderr_of( sub { $dist->run_build('distmeta') } );
+ like $error, qr/is not supported/ms, "Correctly dies when it encounters invalid prereq";
+ ok ! -e 'Makefile.PL', "Makefile.PL NOT created";
+
+ 1 while unlink 'Makefile.PL';
+ ok ! -e 'Makefile.PL', "Makefile.PL cleaned up";
}
#########################################################
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm
index 9fbd6d0c8ca..ae8ed343907 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/DistGen.pm
@@ -84,6 +84,8 @@ sub reset {
my %options = @_;
$options{name} ||= 'Simple';
+ $options{version} ||= q{'0.01'};
+ $options{license} ||= 'perl';
$options{dir} = File::Spec->rel2abs(
defined $options{dir} ? $options{dir} : MBTest->tmpdir
);
@@ -151,7 +153,7 @@ sub _gen_default_filedata {
my \$builder = Module::Build->new(
module_name => '$self->{name}',
- license => 'perl',
+ license => '$self->{license}',
);
\$builder->create_build_script();
@@ -164,7 +166,7 @@ sub _gen_default_filedata {
my \$builder = Module::Build->new(
module_name => '$self->{name}',
- license => 'perl',
+ license => '$self->{license}',
);
\$builder->create_build_script();
@@ -179,7 +181,7 @@ sub _gen_default_filedata {
package $self->{name};
use vars qw( \$VERSION );
- \$VERSION = '0.01';
+ \$VERSION = $self->{version};
use strict;
@@ -214,7 +216,7 @@ sub _gen_default_filedata {
$self->$add_unless($module_filename, undent(<<" ---"));
package $self->{name};
- \$VERSION = '0.01';
+ \$VERSION = $self->{version};
require Exporter;
require DynaLoader;
@@ -627,6 +629,8 @@ The C<new> method does not write any files -- see L</regen()> below.
my $dist = DistGen->new(
name => 'Foo::Bar',
+ version => '0.01',
+ license => 'perl',
dir => MBTest->tmpdir,
xs => 1,
no_manifest => 0,
@@ -642,6 +646,17 @@ The name of the module this distribution represents. The default is
'Simple'. This should be a "Foo::Bar" (module) name, not a "Foo-Bar"
dist name.
+=item version
+
+The version string that will be set. (E.g. C<our $VERSION = 0.01>)
+Note -- to put this value in quotes, add those to the string.
+
+ version => q{'0.01_01'}
+
+=item license
+
+The license string that will be set in Build.PL. Defaults to 'perl'.
+
=item dir
The (parent) directory in which to create the distribution directory. The
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
index 6dc4c8627a4..0df382fc6aa 100644
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/MBTest.pm
@@ -12,6 +12,7 @@ use File::Path ();
BEGIN {
# Environment variables which might effect our testing
my @delete_env_keys = qw(
+ HOME
DEVEL_COVER_OPTIONS
MODULEBUILDRC
PERL_MB_OPT
@@ -54,12 +55,10 @@ BEGIN {
my $t_lib = File::Spec->catdir('t', 'bundled');
push @INC, $t_lib; # Let user's installed version override
- if ($ENV{PERL_CORE}) {
- # We change directories, so expand @INC and $^X to absolute paths
- # Also add .
- @INC = (map(File::Spec->rel2abs($_), @INC), ".");
- $^X = File::Spec->rel2abs($^X);
- }
+ # We change directories, so expand @INC and $^X to absolute paths
+ # Also add .
+ @INC = (map(File::Spec->rel2abs($_), @INC), ".");
+ $^X = File::Spec->rel2abs($^X);
}
use Exporter;
@@ -96,7 +95,11 @@ __PACKAGE__->export(scalar caller, @extra_exports);
# always return to the current directory
{
- my $cwd = File::Spec->rel2abs(Cwd::cwd);
+ my $cwd;
+ # must be done in BEGIN because tmpdir uses it in BEGIN for $ENV{HOME}
+ BEGIN {
+ $cwd = File::Spec->rel2abs(Cwd::cwd);
+ }
sub original_cwd { return $cwd }
@@ -123,6 +126,10 @@ sub tmpdir {
return File::Temp::tempdir('MB-XXXXXXXX', CLEANUP => 1, DIR => $dir, @args);
}
+BEGIN {
+ $ENV{HOME} = tmpdir; # don't want .modulebuildrc or other things interfering
+}
+
sub save_handle {
my ($handle, $subr) = @_;
my $outfile = File::Spec->catfile(File::Spec->tmpdir, temp_file_name());
@@ -201,6 +208,9 @@ sub check_compiler {
my $have_c_compiler;
stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} );
+ # XXX link_executable() is not yet implemented for Windows
+ # and noexec tmpdir is irrelevant on Windows
+ return ($have_c_compiler, 1) if $^O eq "MSWin32";
# check noexec tmpdir
my $tmp_exec;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm
new file mode 100644
index 00000000000..2d58f7d6dd0
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Module/Signature.pm
@@ -0,0 +1,11 @@
+package Module::Signature; # mocked
+use strict;
+use warnings;
+our $VERSION = 999;
+
+sub sign {
+ open my $fh, ">", "SIGNATURE";
+ print {$fh} "SIGNATURE";
+}
+
+1;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm
new file mode 100644
index 00000000000..80d9fa5e784
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/lib/Software/License/VaporWare.pm
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+
+package Software::License::VaporWare;
+our $VERSION = '0.001';
+
+use Software::License;
+our @ISA = qw/Software::License/;
+
+sub name { 'VaporWare License' }
+sub url { 'http://example.com/vaporware/' }
+sub meta_name { 'unrestricted' }
+sub meta2_name { 'unrestricted' }
+
+1;
+
+
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/metadata2.t b/gnu/usr.bin/perl/cpan/Module-Build/t/metadata2.t
index a0fdd604d18..347a9a4d644 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/metadata2.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/metadata2.t
@@ -12,10 +12,7 @@ use DistGen;
############################## ACTION distmeta works without a MANIFEST file
-SKIP: {
- skip( 'YAML_support feature is not enabled', 4 )
- unless Module::Build::ConfigData->feature('YAML_support');
-
+{
my $dist = DistGen->new( no_manifest => 1 )->chdir_in->regen;
ok ! -e 'MANIFEST';
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/mymeta.t b/gnu/usr.bin/perl/cpan/Module-Build/t/mymeta.t
index 91a269027e6..d760edadbb7 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/mymeta.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/mymeta.t
@@ -3,10 +3,12 @@
use strict;
use lib 't/lib';
use MBTest;
-plan tests => 24;
+use CPAN::Meta 2.110420;
+use CPAN::Meta::YAML;
+use Parse::CPAN::Meta 1.4401;
+plan tests => 39;
blib_load('Module::Build');
-blib_load('Module::Build::YAML');
my $tmp = MBTest->tmpdir;
@@ -35,65 +37,100 @@ $dist->chdir_in;
{
ok( ! -e "META.yml", "META.yml doesn't exist before Build.PL runs" );
ok( ! -e "MYMETA.yml", "MYMETA.yml doesn't exist before Build.PL runs" );
+ ok( ! -e "META.json", "META.json doesn't exist before Build.PL runs" );
+ ok( ! -e "MYMETA.json", "MYMETA.json doesn't exist before Build.PL runs" );
my $output;
$output = stdout_of sub { $dist->run_build_pl };
- like($output, qr/Creating new 'MYMETA.yml' with configuration results/,
+ like($output, qr/Created MYMETA\.yml and MYMETA\.json/,
"Ran Build.PL and saw MYMETA.yml creation message"
);
ok( -e "MYMETA.yml", "MYMETA.yml exists" );
+ ok( -e "MYMETA.json", "MYMETA.json exists" );
}
#########################
# Test interactions between META/MYMETA
{
- my $output = stdout_of sub { $dist->run_build('distmeta') };
- like($output, qr/Creating META.yml/,
+ my $output = stdout_stderr_of sub { $dist->run_build('distmeta') };
+ like($output, qr/Created META\.yml and META\.json/,
"Ran Build distmeta to create META.yml");
- my $meta = Module::Build::YAML->read('META.yml')->[0];
- my $mymeta = Module::Build::YAML->read('MYMETA.yml')->[0];
- is( delete $mymeta->{dynamic_config}, 0,
- "MYMETA 'dynamic_config' is 0"
+ # regenerate MYMETA to pick up from META instead of creating from scratch
+ $output = stdout_of sub { $dist->run_build_pl };
+ like($output, qr/Created MYMETA\.yml and MYMETA\.json/,
+ "Re-ran Build.PL and regenerated MYMETA.yml based on META.yml"
);
- is_deeply( $meta, $mymeta, "Other generated MYMETA matches generated META" );
+
+ for my $suffix ( qw/.yml .json/ ) {
+ my $meta = Parse::CPAN::Meta->load_file("META$suffix");
+ my $mymeta = Parse::CPAN::Meta->load_file("MYMETA$suffix");
+ is( delete $meta->{dynamic_config}, 1,
+ "META$suffix 'dynamic_config' is 1"
+ );
+ is( delete $mymeta->{dynamic_config}, 0,
+ "MYMETA$suffix 'dynamic_config' is 0"
+ );
+ is_deeply( $mymeta, $meta, "Other generated MYMETA$suffix matches generated META$suffix" )
+ or do {
+ require Data::Dumper;
+ diag "MYMETA:\n" . Data::Dumper::Dumper($mymeta)
+ . "META:\n" . Data::Dumper::Dumper($meta);
+ };
+ }
+
$output = stdout_stderr_of sub { $dist->run_build('realclean') };
like( $output, qr/Cleaning up/, "Ran realclean");
ok( ! -e 'Build', "Build file removed" );
- ok( ! -e 'MYMETA.yml', "MYMETA file removed" );
+ ok( ! -e 'MYMETA.yml', "MYMETA.yml file removed" );
+ ok( ! -e 'MYMETA.json', "MYMETA.json file removed" );
# test that dynamic prereq is picked up
+ my $meta = Parse::CPAN::Meta->load_file("META.yml");
+ my $meta2 = Parse::CPAN::Meta->load_file("META.json");
local $ENV{BUMP_PREREQ} = 1;
$output = stdout_of sub { $dist->run_build_pl };
- like($output, qr/Creating new 'MYMETA.yml' with configuration results/,
+ like($output, qr/Created MYMETA\.yml and MYMETA\.json/,
"Ran Build.PL with dynamic config"
);
ok( -e "MYMETA.yml", "MYMETA.yml exists" );
- $mymeta = Module::Build::YAML->read('MYMETA.yml')->[0];
+ ok( -e "MYMETA.json", "MYMETA.json exists" );
+ my $mymeta = Parse::CPAN::Meta->load_file('MYMETA.yml');
+ my $mymeta2 = Parse::CPAN::Meta->load_file('MYMETA.json');
isnt( $meta->{requires}{'File::Spec'},
$mymeta->{requires}{'File::Spec'},
- "MYMETA requires differs from META"
+ "MYMETA.yml requires differs from META.yml"
+ );
+ isnt( $meta2->{prereqs}{runtime}{requires}{'File::Spec'},
+ $mymeta2->{prereqs}{runtime}{requires}{'File::Spec'},
+ "MYMETA.json requires differs from META.json"
);
$output = stdout_stderr_of sub { $dist->run_build('realclean') };
like( $output, qr/Cleaning up/, "Ran realclean");
ok( ! -e 'Build', "Build file removed" );
ok( ! -e 'MYMETA.yml', "MYMETA file removed" );
+ ok( ! -e 'MYMETA.json', "MYMETA file removed" );
# manually change META and check that changes are preserved
$meta->{author} = ['John Gault'];
- ok( Module::Build::YAML->new($meta)->write('META.yml'),
+ $meta2->{author} = ['John Gault'];
+ ok( CPAN::Meta::YAML->new($meta)->write('META.yml'),
"Wrote manually modified META.yml" );
+ ok( CPAN::Meta->new( $meta2 )->save('META.json'),
+ "Wrote manually modified META.json" );
$output = stdout_of sub { $dist->run_build_pl };
- like($output, qr/Creating new 'MYMETA.yml' with configuration results/,
+ like($output, qr/Created MYMETA\.yml and MYMETA\.json/,
"Ran Build.PL"
);
- my $mymeta2 = Module::Build::YAML->read('MYMETA.yml')->[0];
+ $mymeta = Parse::CPAN::Meta->load_file('MYMETA.yml');
+ $mymeta2 = Parse::CPAN::Meta->load_file('MYMETA.json');
+ is_deeply( $mymeta->{author}, [ 'John Gault' ],
+ "MYMETA.yml preserved META.yml modifications"
+ );
is_deeply( $mymeta2->{author}, [ 'John Gault' ],
- "MYMETA preserved META modifications"
+ "MYMETA.json preserved META.json modifications"
);
-
-
}
#########################
@@ -112,11 +149,12 @@ $dist->chdir_in;
{
my $output = stdout_of sub { $dist->run_build_pl };
- like($output, qr/Creating new 'MYMETA.yml' with configuration results/,
+ like($output, qr/Created MYMETA\.yml and MYMETA\.json/,
"Ran Build.PL and saw MYMETA.yml creation message"
);
$output = stdout_stderr_of sub { $dist->run_build('distclean') };
ok( ! -f 'MYMETA.yml', "No MYMETA.yml after distclean" );
+ ok( ! -f 'MYMETA.json', "No MYMETA.json after distclean" );
ok( ! -f 'MANIFEST.SKIP', "No MANIFEST.SKIP after distclean" );
}
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/dist_suffix.t b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/dist_suffix.t
new file mode 100644
index 00000000000..aaee1126691
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/dist_suffix.t
@@ -0,0 +1,33 @@
+# sample.t -- a sample test file for Module::Build
+
+use strict;
+use lib 't/lib';
+use MBTest;
+use DistGen;
+
+plan tests => 2;
+
+# Ensure any Module::Build modules are loaded from correct directory
+blib_load('Module::Build');
+
+#--------------------------------------------------------------------------#
+# Create test distribution
+#--------------------------------------------------------------------------#
+
+use DistGen;
+my $dist = DistGen->new( name => 'Simple::Name' );
+
+$dist->change_build_pl(
+ module_name => 'Simple::Name',
+ dist_suffix => 'SUFFIX',
+)->regen;
+
+$dist->chdir_in;
+
+my $mb = $dist->new_from_context();
+isa_ok( $mb, "Module::Build" );
+is( $mb->dist_dir, "Simple-Name-0.01-SUFFIX",
+ "dist_suffix set correctly"
+);
+
+# vim:ts=2:sw=2:et:sta:sts=2
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/license.t b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/license.t
new file mode 100644
index 00000000000..db63b3951bb
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/license.t
@@ -0,0 +1,66 @@
+use strict;
+use lib 't/lib';
+use MBTest;
+use DistGen;
+
+plan 'no_plan';
+
+# Ensure any Module::Build modules are loaded from correct directory
+blib_load('Module::Build');
+
+#--------------------------------------------------------------------------#
+# Create test distribution
+#--------------------------------------------------------------------------#
+
+{
+ my $dist = DistGen->new(
+ name => 'Simple::Name',
+ version => '0.01',
+ license => 'perl'
+ );
+
+ $dist->regen;
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->license, 'perl',
+ "license 'perl' is valid"
+ );
+
+ my $meta = $mb->get_metadata( fatal => 0 );
+
+ is( $meta->{license} => 'perl', "META license will be 'perl'" );
+ is( $meta->{resources}{license}, "http://dev.perl.org/licenses/",
+ "META license URL is correct"
+ );
+
+}
+
+{
+ my $dist = DistGen->new(
+ name => 'Simple::Name',
+ version => '0.01',
+ license => 'VaporWare'
+ );
+
+ $dist->regen;
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->license, 'VaporWare',
+ "license 'VaporWare' is valid"
+ );
+
+ my $meta = $mb->get_metadata( fatal => 0 );
+
+ is( $meta->{license} => 'unrestricted', "META license will be 'unrestricted'" );
+ is( $meta->{resources}{license}, "http://example.com/vaporware/",
+ "META license URL is correct"
+ );
+
+}
+
+# Test with alpha number
+# vim:ts=2:sw=2:et:sta:sts=2
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/release_status.t b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/release_status.t
new file mode 100644
index 00000000000..45c7f3381cb
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/release_status.t
@@ -0,0 +1,204 @@
+use strict;
+use lib 't/lib';
+use MBTest;
+use DistGen;
+
+if ( $] lt 5.008001 ) {
+ plan skip_all => "dotted-version numbers are buggy before 5.8.1";
+} else {
+ plan 'no_plan';
+}
+
+# Ensure any Module::Build modules are loaded from correct directory
+blib_load('Module::Build');
+
+#--------------------------------------------------------------------------#
+# Create test distribution
+#--------------------------------------------------------------------------#
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => '0.01' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->release_status, "stable",
+ "regular version has release_status 'stable'"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => 'v1.2.3' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->release_status, "stable",
+ "dotted-decimal version has release_status 'stable'"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => q{'0.01_01'} );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->release_status, "testing",
+ "alpha version has release_status 'testing'"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => 'v1.2.3_1' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->release_status, "testing",
+ "dotted alpha version has release_status 'testing'"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => q{'0.01_01'} );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'unstable',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->release_status, "unstable",
+ "explicit 'unstable' keeps release_status 'unstable'"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => '0.01' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'testing',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->dist_suffix, "TRIAL",
+ "regular version marked 'testing' gets 'TRIAL' suffix"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => 'v1.2.3' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'testing',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->dist_suffix, "TRIAL",
+ "dotted version marked 'testing' gets 'TRIAL' suffix"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => '0.01' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'unstable',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->dist_suffix, "TRIAL",
+ "regular version marked 'unstable' gets 'TRIAL' suffix"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => '0.01' );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'beta',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $output = stdout_stderr_of sub { $dist->run_build_pl() };
+ like( $output, qr/Illegal value 'beta' for release_status/i,
+ "Got error message for illegal release_status"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => q{'0.01_01'} );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ release_status => 'stable',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $output = stdout_stderr_of sub { $dist->run_build_pl() };
+ like( $output, qr/Illegal value 'stable' with version '0.01_01'/i,
+ "Got error message for illegal 'stable' with alpha version"
+ );
+}
+
+{
+ my $dist = DistGen->new( name => 'Simple::Name', version => q{'0.01_01'} );
+
+ $dist->change_build_pl(
+ module_name => 'Simple::Name',
+ dist_version => '1.23beta1',
+ )->regen;
+
+ $dist->chdir_in;
+
+ my $mb = $dist->new_from_context();
+ isa_ok( $mb, "Module::Build" );
+ is( $mb->dist_suffix, "",
+ "non-standard dist_version does not get a suffix"
+ );
+ is( $mb->release_status, "stable",
+ "non-standard dist_version defaults to stable release_status"
+ );
+}
+
+# Test with alpha number
+# vim:ts=2:sw=2:et:sta:sts=2
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/requires.t b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/requires.t
new file mode 100644
index 00000000000..72a2e6d9aba
--- /dev/null
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/requires.t
@@ -0,0 +1,54 @@
+# sample.t -- a sample test file for Module::Build
+
+use strict;
+use lib 't/lib';
+use MBTest;
+use DistGen;
+
+plan tests => 4;
+
+# Ensure any Module::Build modules are loaded from correct directory
+blib_load('Module::Build');
+
+my ($dist, $mb, $prereqs);
+
+#--------------------------------------------------------------------------#
+# try undefined prereq version
+#--------------------------------------------------------------------------#
+
+$dist = DistGen->new( name => 'Simple::Requires' );
+
+$dist->change_build_pl(
+ module_name => 'Simple::Requires',
+ requires => {
+ 'File::Basename' => undef,
+ },
+)->regen;
+
+$dist->chdir_in;
+
+$mb = $dist->new_from_context();
+isa_ok( $mb, "Module::Build" );
+
+$prereqs = $mb->_normalize_prereqs;
+is($prereqs->{requires}{'File::Basename'}, 0, "undef prereq converted to 0");
+
+#--------------------------------------------------------------------------#
+# try empty string prereq version
+#--------------------------------------------------------------------------#
+
+$dist->change_build_pl(
+ module_name => 'Simple::Requires',
+ requires => {
+ 'File::Basename' => '',
+ },
+)->regen;
+
+$mb = $dist->new_from_context();
+isa_ok( $mb, "Module::Build" );
+
+$prereqs = $mb->_normalize_prereqs;
+is($prereqs->{requires}{'File::Basename'}, 0, "empty string prereq converted to 0");
+
+
+# vim:ts=2:sw=2:et:sta:sts=2
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/share_dir.t b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/share_dir.t
index 1d81a0aa45c..f1cda13429a 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/properties/share_dir.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/properties/share_dir.t
@@ -9,7 +9,7 @@ use File::Spec::Functions qw/catdir catfile/;
# Begin testing
#--------------------------------------------------------------------------#
-plan tests => 21;
+plan tests => 23;
blib_load('Module::Build');
@@ -43,11 +43,19 @@ ok( ! exists $mb->{properties}{requires}{'File::ShareDir'},
$dist->add_file('share/foo.txt',<< '---');
This is foo.txt
---
+$dist->add_file('share/subdir/share/anotherbar.txt',<< '---');
+This is anotherbar.txt in a subdir - test for a bug in M::B 0.38 when full path contains 'share/.../*share/...' subdir
+---
+$dist->add_file('share/subdir/whatever/anotherfoo.txt',<< '---');
+This is anotherfoo.txt in a subdir - this shoud work on M::B 0.38
+---
$dist->add_file('other/share/bar.txt',<< '---');
This is bar.txt
---
$dist->regen;
ok( -e catfile(qw/share foo.txt/), "Created 'share' directory" );
+ok( -d catfile(qw/share subdir share/), "Created 'share/subdir/share' directory" );
+ok( -d catfile(qw/share subdir whatever/), "Created 'share/subdir/whatever' directory" );
ok( -e catfile(qw/other share bar.txt/), "Created 'other/share' directory" );
# Check default when share_dir is not given
@@ -163,6 +171,8 @@ is_deeply( $mb->share_dir,
is_deeply( $mb->_find_share_dir_files,
{
"share/foo.txt" => "dist/Simple-Share/foo.txt",
+ "share/subdir/share/anotherbar.txt" => "dist/Simple-Share/subdir/share/anotherbar.txt",
+ "share/subdir/whatever/anotherfoo.txt" => "dist/Simple-Share/subdir/whatever/anotherfoo.txt",
"other/share/bar.txt" => "module/Simple-Share/bar.txt",
},
"share_dir filemap for copying to lib complete"
@@ -187,6 +197,8 @@ skip 'filename case not necessarily preserved', 1 if $^O eq 'VMS';
is_deeply(
[ sort @$share_list ], [
'blib/lib/auto/share/dist/Simple-Share/foo.txt',
+ 'blib/lib/auto/share/dist/Simple-Share/subdir/share/anotherbar.txt',
+ 'blib/lib/auto/share/dist/Simple-Share/subdir/whatever/anotherfoo.txt',
'blib/lib/auto/share/module/Simple-Share/bar.txt',
],
"share_dir files copied to blib"
@@ -217,6 +229,8 @@ skip 'filename case not necessarily preserved', 1 if $^O eq 'VMS';
is_deeply(
[ sort @$share_list ], [
"$temp_install/lib/perl5/auto/share/dist/Simple-Share/foo.txt",
+ "$temp_install/lib/perl5/auto/share/dist/Simple-Share/subdir/share/anotherbar.txt",
+ "$temp_install/lib/perl5/auto/share/dist/Simple-Share/subdir/whatever/anotherfoo.txt",
"$temp_install/lib/perl5/auto/share/module/Simple-Share/bar.txt",
],
"share_dir files correctly installed"
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/runthrough.t b/gnu/usr.bin/perl/cpan/Module-Build/t/runthrough.t
index 9e8d52ed11c..1c0edf4402a 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/runthrough.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/runthrough.t
@@ -6,7 +6,6 @@ use MBTest tests => 29;
blib_load('Module::Build');
blib_load('Module::Build::ConfigData');
-my $have_yaml = Module::Build::ConfigData->feature('YAML_support');
#########################
@@ -106,18 +105,16 @@ ok grep {$_ eq 'save_out' } $mb->cleanup;
}
}
-SKIP: {
- skip( 'YAML_support feature is not enabled', 7 ) unless $have_yaml;
-
+{
my $output = eval {
- stdout_of( sub { $mb->dispatch('disttest') } )
+ stdout_stderr_of( sub { $mb->dispatch('disttest') } )
};
is $@, '';
# After a test, the distdir should contain a blib/ directory
ok -e File::Spec->catdir('Simple-0.01', 'blib');
- eval {$mb->dispatch('distdir')};
+ stdout_stderr_of ( sub { eval {$mb->dispatch('distdir')} } );
is $@, '';
# The 'distdir' should contain a lib/ directory
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/script_dist.t b/gnu/usr.bin/perl/cpan/Module-Build/t/script_dist.t
index 7fd82d9547a..fa02b49d33f 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/script_dist.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/script_dist.t
@@ -7,6 +7,7 @@ use lib 't/lib';
use MBTest 'no_plan';
use DistGen qw(undent);
+use CPAN::Meta::YAML;
blib_load('Module::Build');
blib_load('Module::Build::ConfigData');
@@ -39,7 +40,7 @@ my %details = (
dist_version => '0.01',
);
my %meta_provides = (
- 'bin-foo' => {
+ 'foo' => {
file => 'bin/foo',
version => '0.01',
}
@@ -68,13 +69,11 @@ is($mb->dist_name, 'bin-foo');
is($mb->dist_version, '0.01');
is_deeply($mb->dist_author,
['A. U. Thor, a.u.thor@a.galaxy.far.far.away']);
-ok $mb->dispatch('distmeta');
-
-SKIP: {
- skip( 'YAML_support feature is not enabled', 1 )
- unless Module::Build::ConfigData->feature('YAML_support');
- require YAML::Tiny;
- my $yml = YAML::Tiny::LoadFile('META.yml');
- is_deeply($yml->{provides}, \%meta_provides);
-}
+my $result;
+stdout_stderr_of( sub { $result = $mb->dispatch('distmeta') } );
+ok $result;
+
+my $yml = CPAN::Meta::YAML->read_string(slurp('META.yml'))->[0];
+is_deeply($yml->{provides}, \%meta_provides);
+
$dist->chdir_original if $dist->did_chdir;
diff --git a/gnu/usr.bin/perl/cpan/Module-Build/t/tilde.t b/gnu/usr.bin/perl/cpan/Module-Build/t/tilde.t
index a5ed79083b0..04f0210f30b 100755
--- a/gnu/usr.bin/perl/cpan/Module-Build/t/tilde.t
+++ b/gnu/usr.bin/perl/cpan/Module-Build/t/tilde.t
@@ -46,19 +46,20 @@ SKIP: {
unless (defined $home) {
my @info = eval { getpwuid $> };
- skip "No home directory for tilde-expansion tests", 15 if $@;
+ skip "No home directory for tilde-expansion tests", 15 if $@
+ or !defined $info[7];
$home = $info[7];
}
is( run_sample( $p => '~' )->$p(), $home );
- is( run_sample( $p => '~/foo' )->$p(), "$home/foo" );
+ is( run_sample( $p => '~/fooxzy' )->$p(), "$home/fooxzy" );
- is( run_sample( $p => '~/ foo')->$p(), "$home/ foo" );
+ is( run_sample( $p => '~/ fooxzy')->$p(), "$home/ fooxzy" );
is( run_sample( $p => '~/fo o')->$p(), "$home/fo o" );
- is( run_sample( $p => 'foo~' )->$p(), 'foo~' );
+ is( run_sample( $p => 'fooxzy~' )->$p(), 'fooxzy~' );
is( run_sample( prefix => '~' )->prefix,
$home );
@@ -89,24 +90,25 @@ SKIP: {
skip "On OS/2 EMX all users are equal", 2 if $^O eq 'os2';
is( run_sample( $p => '~~' )->$p(), '~~' );
- is( run_sample( $p => '~ foo' )->$p(), '~ foo' );
+ is( run_sample( $p => '~ fooxzy' )->$p(), '~ fooxzy' );
}
# Again, with named users
SKIP: {
my @info = eval { getpwuid $> };
- skip "No home directory for tilde-expansion tests", 1 if $@;
+ skip "No home directory for tilde-expansion tests", 1 if $@
+ or !defined $info[7] or !defined $info[0];
my ($me, $home) = @info[0,7];
- my $expected = "$home/foo";
+ my $expected = "$home/fooxzy";
if ($^O eq 'VMS') {
# Convert the path to UNIX format and trim off the trailing slash
$home = VMS::Filespec::unixify($home);
$home =~ s#/$##;
- $expected = $home . '/../[^/]+' . '/foo';
+ $expected = $home . '/../[^/]+' . '/fooxzy';
}
- like( run_sample( $p => "~$me/foo")->$p(), qr($expected)i );
+ like( run_sample( $p => "~$me/fooxzy")->$p(), qr(\Q$expected\E)i );
}