diff options
author | H.Merijn Brand <h.m.brand@xs4all.nl> | 2014-08-01 13:14:09 +0200 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2014-08-01 13:14:09 +0200 |
commit | b4ade0121f513ffbfbd57484ccf779f28bcfb95b (patch) | |
tree | e1c4d9a93e0e00c011faecd0f5c2af24c825f0f3 /cpan/Config-Perl-V/V.pm | |
parent | 311454c04d15fb2cc6ad80afc47e72759d358c52 (diff) | |
download | perl-b4ade0121f513ffbfbd57484ccf779f28bcfb95b.tar.gz |
Sync Config::Perl::V to version 0.21
* Add tests for each major distribution since 5.6.2
* Better detect build times
* Sync with 5.20.1
Diffstat (limited to 'cpan/Config-Perl-V/V.pm')
-rw-r--r-- | cpan/Config-Perl-V/V.pm | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/cpan/Config-Perl-V/V.pm b/cpan/Config-Perl-V/V.pm index 066acacd70..738a53c161 100644 --- a/cpan/Config-Perl-V/V.pm +++ b/cpan/Config-Perl-V/V.pm @@ -8,7 +8,7 @@ use warnings; use Config; use Exporter; use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS); -$VERSION = "0.20"; +$VERSION = "0.21"; @ISA = ("Exporter"); @EXPORT_OK = qw( plv2hash summary myconfig signature ); %EXPORT_TAGS = ( @@ -29,21 +29,21 @@ $VERSION = "0.20"; my %BTD = map { $_ => 0 } qw( DEBUGGING - NO_MATHOMS NO_HASH_SEED + NO_MATHOMS NO_TAINT_SUPPORT PERL_BOOL_AS_CHAR PERL_DISABLE_PMC PERL_DONT_CREATE_GVSV PERL_EXTERNAL_GLOB - PERL_HASH_FUNC_SIPHASH - PERL_HASH_FUNC_SDBM PERL_HASH_FUNC_DJB2 - PERL_HASH_FUNC_SUPERFAST PERL_HASH_FUNC_MURMUR3 PERL_HASH_FUNC_ONE_AT_A_TIME PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_HASH_FUNC_ONE_AT_A_TIME_OLD + PERL_HASH_FUNC_SDBM + PERL_HASH_FUNC_SIPHASH + PERL_HASH_FUNC_SUPERFAST PERL_IS_MINIPERL PERL_MALLOC_WRAP PERL_MEM_LOG @@ -78,12 +78,13 @@ my %BTD = map { $_ => 0 } qw( HAVE_INTERP_INTERN MULTIPLICITY MYMALLOC - PERLIO_LAYERS PERL_DEBUG_READONLY_COW PERL_DEBUG_READONLY_OPS PERL_GLOBAL_STRUCT + PERL_GLOBAL_STRUCT_PRIVATE PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS + PERLIO_LAYERS PERL_MAD PERL_MICRO PERL_NEED_APPCTX @@ -102,6 +103,7 @@ my %BTD = map { $_ => 0 } qw( USE_LARGE_FILES USE_LOCALE_COLLATE USE_LOCALE_NUMERIC + USE_LOCALE_TIME USE_LONG_DOUBLE USE_PERLIO USE_REENTRANT_API @@ -229,27 +231,26 @@ sub _make_derived sub plv2hash { my %config; - for (split m/\n+/ => join "\n", @_) { - - if (s/^Summary of my\s+(\S+)\s+\(\s*(.*?)\s*\)//) { - $config{"package"} = $1; - my $rev = $2; - $rev =~ s/^ revision \s+ (\S+) \s*//x and $config{revision} = $1; - $rev and $config{version_patchlevel_string} = $rev; - my ($rel) = $config{package} =~ m{perl(\d)}; - my ($vers, $subvers) = $rev =~ m{version\s+(\d+)\s+subversion\s+(\d+)}; - defined $vers && defined $subvers && defined $rel and - $config{version} = "$rel.$vers.$subvers"; - next; - } - if (s/^\s+(Snapshot of:)\s+(\S+)//) { - $config{git_commit_id_title} = $1; - $config{git_commit_id} = $2; - next; - } + my $pv = join "\n" => @_; + + if ($pv =~ m/^Summary of my\s+(\S+)\s+\(\s*(.*?)\s*\)/m) { + $config{"package"} = $1; + my $rev = $2; + $rev =~ s/^ revision \s+ (\S+) \s*//x and $config{revision} = $1; + $rev and $config{version_patchlevel_string} = $rev; + my ($rel) = $config{"package"} =~ m{perl(\d)}; + my ($vers, $subvers) = $rev =~ m{version\s+(\d+)\s+subversion\s+(\d+)}; + defined $vers && defined $subvers && defined $rel and + $config{version} = "$rel.$vers.$subvers"; + } + + if ($pv =~ m/^\s+(Snapshot of:)\s+(\S+)/) { + $config{git_commit_id_title} = $1; + $config{git_commit_id} = $2; + } - my %kv = m/\G,?\s*([^=]+)=('[^']+?'|\S+)/gc; + if (my %kv = ($pv =~ m/\b(\w+)\s*=\s*('[^']+?'|\S+)/g)) { while (my ($k, $v) = each %kv) { $k =~ s/\s+$//; @@ -260,8 +261,21 @@ sub plv2hash $config{$k} = $v; } } + my $build = { %empty_build }; + + $pv =~ m{^\s+Compiled at\s+(.*)}m + and $build->{stamp} = $1; + $pv =~ m{^\s+Locally applied patches:(?:\s+|\n)(.*)}m + and $build->{patches} = [ split m/\n+/, $1 ]; + $pv =~ m{^\s+Compile-time options:(?:\s+|\n)(.*)}m + and map { $build->{options}{$_} = 1 } split m/\s+|\n/ => $1; + $build->{osname} = $config{osname}; + $pv =~ m{^\s+Built under\s+(.*)}m + and $build->{osname} = $1; + $config{osname} ||= $build->{osname}; + return _make_derived ({ build => $build, environment => {}, @@ -322,20 +336,9 @@ sub myconfig } else { #y $pv = qx[$^X -e"sub Config::myconfig{};" -V]; - my $pv = qx[$^X -V]; - $pv =~ s{.*?\n\n}{}s; - $pv =~ s{\n(?: \s+|\t\s*)}{\0}g; - - # print STDERR $pv; - - $pv =~ m{^\s+Built under\s+(.*)}m - and $build->{osname} = $1; - $pv =~ m{^\s+Compiled at\s+(.*)}m - and $build->{stamp} = $1; - $pv =~ m{^\s+Locally applied patches:(?:\s+|\0)(.*)}m - and $build->{patches} = [ split m/\0+/, $1 ]; - $pv =~ m{^\s+Compile-time options:(?:\s+|\0)(.*)}m - and map { $build->{options}{$_} = 1 } split m/\s+|\0/ => $1; + my $cnf = plv2hash (qx[$^X -V]); + + $build->{$_} = $cnf->{build}{$_} for qw( osname stamp patches options ); } my @KEYS = keys %ENV; |