summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-06-18 14:30:52 +0200
committerNicholas Clark <nick@ccl4.org>2012-06-18 14:30:52 +0200
commitcdc958a84461faa25ffaf2eb0fef7d83fe52bdca (patch)
tree3a0f4ca4ded4a7846822e47a3489d97ff9841171
parent31c2fa87f75a985ad4493f8a830a704fa7a4f6c4 (diff)
parentac976f88fc7085a921c5e232d11cc53d7e1ffb91 (diff)
downloadperl-cdc958a84461faa25ffaf2eb0fef7d83fe52bdca.tar.gz
Merge fixes for Porting tests when building with -Dmksymlinks.
-rwxr-xr-xPorting/cmpVERSION.pl62
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL2
-rw-r--r--pod/perldelta.pod6
-rw-r--r--t/porting/authors.t2
-rw-r--r--t/porting/cmp_version.t3
-rw-r--r--t/porting/manifest.t2
-rw-r--r--t/porting/pending-author.t2
-rw-r--r--t/test.pl18
8 files changed, 59 insertions, 38 deletions
diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl
index e618533a0a..ebf57cf771 100755
--- a/Porting/cmpVERSION.pl
+++ b/Porting/cmpVERSION.pl
@@ -87,23 +87,31 @@ my $skip_dirs = qr|^t/lib|;
sub pm_file_from_xs {
my $xs = shift;
- # First try a .pm at the same level as the .xs file, with the same basename
- my $pm = $xs;
- $pm =~ s/xs\z/pm/;
- return $pm if -f $pm;
-
- # Try for a (different) .pm at the same level, based on the directory name:
- my ($path) = $xs =~ m!^(.*)/!;
- my ($last) = $path =~ m!([^-/]+)\z!;
- $pm = "$path/$last.pm";
- return $pm if -f $pm;
-
- # Try to work out the extension's full package, and look for a .pm in lib/
- # based on that:
- ($last) = $path =~ m!([^/]+)\z!;
- $last =~ tr !-!/!;
- $pm = "$path/lib/$last.pm";
- return $pm if -f $pm;
+ foreach my $try (sub {
+ # First try a .pm at the same level as the .xs file
+ # with the same basename
+ return shift =~ s/\.xs\z//r;
+ },
+ sub {
+ # Try for a (different) .pm at the same level, based
+ # on the directory name:
+ my ($path) = shift =~ m!^(.*)/!;
+ my ($last) = $path =~ m!([^-/]+)\z!;
+ return "$path/$last";
+ },
+ sub {
+ # Try to work out the extension's full package, and
+ # look for a .pm in lib/ based on that:
+ my ($path) = shift =~ m!^(.*)/!;
+ my ($last) = $path =~ m!([^/]+)\z!;
+ $last =~ tr !-!/!;
+ return "$path/lib/$last";
+ }) {
+ # For all cases, first look to see if the .pm file is generated.
+ my $base = $try->($xs);
+ return "${base}_pm.PL" if -f "${base}_pm.PL";
+ return "${base}.pm" if -f "${base}.pm";
+ }
die "No idea which .pm file corresponds to '$xs', so aborting";
}
@@ -122,7 +130,7 @@ foreach (`git --no-pager diff --name-only $tag_to_compare --diff-filter=ACMRTUXB
my $this_dir = $1;
next if $this_dir =~ $skip_dirs || exists $skip{$_};
next if exists $upstream_files{$_};
- if (/\.pm\z/ || m|^lib/.*\.pl\z|) {
+ if (/\.pm\z/ || m|^lib/.*\.pl\z| || /_pm\.PL\z/) {
push @{$module_diffs{$_}}, $_;
} elsif (/\.xs\z/ && !/\bt\b/) {
push @{$module_diffs{pm_file_from_xs($_)}}, $_;
@@ -146,12 +154,14 @@ foreach my $pm_file (sort keys %module_diffs) {
my $pm_version = eval {MM->parse_version($pm_file)};
my $orig_pm_content = get_file_from_git($pm_file, $tag_to_compare);
my $orig_pm_version = eval {MM->parse_version(\$orig_pm_content)};
-
- if ((!defined $pm_version || !defined $orig_pm_version)
- || ($pm_version eq 'undef' || $orig_pm_version eq 'undef') # sigh
- || ($pm_version ne $orig_pm_version) # good
- ) {
- printf "ok %d - %s\n", ++$count, $pm_file if $tap;
+ ++$count;
+
+ if (!defined $orig_pm_version || $orig_pm_version eq 'undef') { # sigh
+ print "ok $count - SKIP Can't pass \$VERSION in $pm_file\n" if $tap;
+ } elsif (!defined $pm_version || $pm_version eq 'undef') {
+ print "not ok $count - in $pm_file version was $orig_pm_version, now unparsable\n" if $tap;
+ } elsif ($pm_version ne $orig_pm_version) { # good
+ print "ok $count - $pm_file\n" if $tap;
} else {
if ($tap) {
foreach (sort @{$module_diffs{$pm_file}}) {
@@ -159,9 +169,9 @@ foreach my $pm_file (sort keys %module_diffs) {
}
if (exists $skip_versions{$pm_file}
and grep $pm_version eq $_, @{$skip_versions{$pm_file}}) {
- printf "ok %d - SKIP $pm_file version $pm_version\n", ++$count;
+ print "ok $count - SKIP $pm_file version $pm_version\n";
} else {
- printf "not ok %d - %s\n", ++$count, $pm_file;
+ print "not ok $count - $pm_file\n";
}
} else {
push @diff, @{$module_diffs{$pm_file}};
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 495847c962..ad056c8ab4 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -85,7 +85,7 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.15';
}
use Config;
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 7c30b552d9..482a714071 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -169,6 +169,12 @@ The constructor now respects overridden accessor methods [perl #29230].
=item *
+L<DynaLoader> has been upgraded from version 1.14 to 1.15.
+
+This is due to a minor code change in the XS for the VMS implementation.
+
+=item *
+
L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
It no longer fails when trying to embed manifests on Windows
diff --git a/t/porting/authors.t b/t/porting/authors.t
index 9b9ba7c80d..bc69e3a2a1 100644
--- a/t/porting/authors.t
+++ b/t/porting/authors.t
@@ -4,7 +4,7 @@
BEGIN {
@INC = '..' if -f '../TestInit.pm';
}
-use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
+use TestInit qw(T); # T is chdir to the top level
use strict;
require 't/test.pl';
diff --git a/t/porting/cmp_version.t b/t/porting/cmp_version.t
index 6204c57612..e7627e4b3d 100644
--- a/t/porting/cmp_version.t
+++ b/t/porting/cmp_version.t
@@ -12,6 +12,7 @@ use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
require 't/test.pl';
-find_git_or_skip('all');
+my $source = find_git_or_skip('all');
+chdir $source or die "Can't chdir to $source: $!";
system "$^X Porting/cmpVERSION.pl --exclude --tap";
diff --git a/t/porting/manifest.t b/t/porting/manifest.t
index 068540c983..ea4fe832d7 100644
--- a/t/porting/manifest.t
+++ b/t/porting/manifest.t
@@ -5,7 +5,7 @@
BEGIN {
@INC = '..' if -f '../TestInit.pm';
}
-use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
+use TestInit qw(T); # T is chdir to the top level
require 't/test.pl';
diff --git a/t/porting/pending-author.t b/t/porting/pending-author.t
index e6240fbcff..0cb4054529 100644
--- a/t/porting/pending-author.t
+++ b/t/porting/pending-author.t
@@ -23,7 +23,7 @@
BEGIN {
@INC = '..' if -f '../TestInit.pm';
}
-use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
+use TestInit qw(T); # T is chdir to the top level
use strict;
require 't/test.pl';
diff --git a/t/test.pl b/t/test.pl
index b33c634fef..9d1da296c9 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -153,9 +153,9 @@ sub skip_all_without_config {
}
sub find_git_or_skip {
- my ($found_dir, $reason);
+ my ($source_dir, $reason);
if (-d '.git') {
- $found_dir = 1;
+ $source_dir = '.';
} elsif (-l 'MANIFEST' && -l 'AUTHORS') {
my $where = readlink 'MANIFEST';
die "Can't readling MANIFEST: $!" unless defined $where;
@@ -163,16 +163,20 @@ sub find_git_or_skip {
unless $where =~ s!/MANIFEST\z!!;
if (-d "$where/.git") {
# Looks like we are in a symlink tree
- chdir $where or die "Can't chdir '$where': $!";
- note("Found source tree at $where");
- $found_dir = 1;
+ if (exists $ENV{GIT_DIR}) {
+ diag("Found source tree at $where, but \$ENV{GIT_DIR} is $ENV{GIT_DIR}. Not changing it");
+ } else {
+ note("Found source tree at $where, setting \$ENV{GIT_DIR}");
+ $ENV{GIT_DIR} = "$where/.git";
+ }
+ $source_dir = $where;
}
}
- if ($found_dir) {
+ if ($source_dir) {
my $version_string = `git --version`;
if (defined $version_string
&& $version_string =~ /\Agit version (\d+\.\d+\.\d+)(.*)/) {
- return if eval "v$1 ge v1.5.0";
+ return $source_dir if eval "v$1 ge v1.5.0";
# If you have earlier than 1.5.0 and it works, change this test
$reason = "in git checkout, but git version '$1$2' too old";
} else {