summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Config/Perl/V.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Config/Perl/V.pm')
-rwxr-xr-xMaster/tlpkg/tlperl/lib/Config/Perl/V.pm115
1 files changed, 74 insertions, 41 deletions
diff --git a/Master/tlpkg/tlperl/lib/Config/Perl/V.pm b/Master/tlpkg/tlperl/lib/Config/Perl/V.pm
index c52b82608cf..4cbf6fe66f0 100755
--- a/Master/tlpkg/tlperl/lib/Config/Perl/V.pm
+++ b/Master/tlpkg/tlperl/lib/Config/Perl/V.pm
@@ -8,7 +8,7 @@ use warnings;
use Config;
use Exporter;
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
-$VERSION = "0.17";
+$VERSION = "0.22";
@ISA = ("Exporter");
@EXPORT_OK = qw( plv2hash summary myconfig signature );
%EXPORT_TAGS = (
@@ -22,14 +22,28 @@ $VERSION = "0.17";
# The list are as the perl binary has stored it in PL_bincompat_options
# search for it in
-# perl.c line 1661 S_Internals_V ()
-# perl.h line 4664 (second block),
+# perl.c line 1643 S_Internals_V ()
+# perl -ne'(/^S_Internals_V/../^}/)&&s/^\s+"( .*)"/$1/ and print' perl.c
+# perl.h line 4566 PL_bincompat_options
+# perl -ne'(/^\w.*PL_bincompat/../^\w}/)&&s/^\s+"( .*)"/$1/ and print' perl.h
my %BTD = map { $_ => 0 } qw(
DEBUGGING
+ 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_DJB2
+ 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
@@ -38,6 +52,10 @@ my %BTD = map { $_ => 0 } qw(
PERL_MEM_LOG_NOIMPL
PERL_MEM_LOG_STDERR
PERL_MEM_LOG_TIMESTAMP
+ PERL_NEW_COPY_ON_WRITE
+ PERL_PERTURB_KEYS_DETERMINISTIC
+ PERL_PERTURB_KEYS_DISABLED
+ PERL_PERTURB_KEYS_RANDOM
PERL_PRESERVE_IVUV
PERL_RELOCATABLE_INCPUSH
PERL_USE_DEVEL
@@ -45,7 +63,9 @@ my %BTD = map { $_ => 0 } qw(
UNLINK_ALL_VERSIONS
USE_ATTRIBUTES_FOR_PERLIO
USE_FAST_STDIO
+ USE_HASH_SEED_EXPLICIT
USE_LOCALE
+ USE_LOCALE_CTYPE
USE_PERL_ATOF
USE_SITECUSTOMIZE
@@ -55,19 +75,21 @@ my %BTD = map { $_ => 0 } qw(
FAKE_THREADS
FCRYPT
HAS_TIMES
+ 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
PERL_NEED_TIMESBASE
PERL_OLD_COPY_ON_WRITE
- PERL_NEW_COPY_ON_WRITE
PERL_POISON
PERL_SAWAMPERSAND
PERL_TRACK_MEMPOOL
@@ -81,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
@@ -92,7 +115,7 @@ my %BTD = map { $_ => 0 } qw(
);
# These are all the keys that are
-# 1. Always present in %Config (first block)
+# 1. Always present in %Config - lib/Config.pm #87 tie %Config
# 2. Reported by 'perl -V' (the rest)
my @config_vars = qw(
@@ -208,39 +231,60 @@ 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";
+ }
- my %kv = m/\G,?\s*([^=]+)=('[^']+?'|\S+)/gc;
+ if ($pv =~ m/^\s+(Snapshot of:)\s+(\S+)/) {
+ $config{git_commit_id_title} = $1;
+ $config{git_commit_id} = $2;
+ }
+
+ if (my %kv = ($pv =~ m{\b
+ (\w+) # key
+ \s*= # assign
+ ( '\s*[^']*?\s*' # quoted value
+ | \S+[^=]*?\s*\n # unquoted running till end of line
+ | \S+ # unquoted value
+ | \s*\n # empty
+ )
+ (?:,?\s+|\s*\n)? # separator (5.8.x reports did not have a ','
+ }gx)) { # between every kv pair
while (my ($k, $v) = each %kv) {
$k =~ s/\s+$//;
+ $v =~ s/\s*\n\z//;
$v =~ s/,$//;
$v =~ m/^'(.*)'$/ and $v = $1;
- $v =~ s/^\s+//;
$v =~ s/\s+$//;
$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)(.*?)(?:[\s\n]+Buil[td] under)}ms
+ and $build->{patches} = [ split m/\n+\s*/, $1 ];
+ $pv =~ m{^\s+Compile-time options:(?:\s+|\n)(.*?)(?:[\s\n]+(?:Locally applied|Buil[td] under))}ms
+ 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 => {},
@@ -301,20 +345,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;
@@ -501,7 +534,7 @@ H.Merijn Brand <h.m.brand@xs4all.nl>
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2009-2013 H.Merijn Brand
+Copyright (C) 2009-2014 H.Merijn Brand
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.