get_isa_hash() is only used in S_isa_lookup(), so it can be static. Also, it has
[p5sagit/p5-mst-13.2.git] / Porting / cmpVERSION.pl
CommitLineData
f1c5bace 1#!/usr/bin/perl -w
2
3#
4# cmpVERSION - compare two Perl source trees for modules
5# that have identical version numbers but different contents.
6#
7# Original by slaven@rezic.de, modified by jhi.
8#
9
10use strict;
11
12use ExtUtils::MakeMaker;
13use File::Compare;
14use File::Find;
15use File::Spec::Functions qw(rel2abs abs2rel catfile catdir curdir);
16
17for (@ARGV[0, 1]) {
18 die "$0: '$_' does not look like Perl directory\n"
19 unless -f catfile($_, "perl.h") && -d catdir($_, "Porting");
20}
21
22my $dir2 = rel2abs($ARGV[1]);
23chdir $ARGV[0] or die "$0: chdir '$ARGV[0]' failed: $!\n";
24
88830c88 25# Files to skip from the check for one reason or another,
26# usually because they pull in their version from some other file.
27my %skip;
477acd91 28@skip{
29 './lib/Carp/Heavy.pm',
8adca191 30 './lib/Exporter/Heavy.pm',
31 './win32/FindExt.pm'
477acd91 32} = ();
ae8d64f5 33my $skip_dirs = qr|^\./t/lib|;
88830c88 34
f1c5bace 35my @wanted;
36find(
37 sub { /\.pm$/ &&
ae8d64f5 38 $File::Find::dir !~ $skip_dirs &&
88830c88 39 ! exists $skip{$File::Find::name}
40 &&
f1c5bace 41 do { my $file2 =
42 catfile(catdir($dir2, $File::Find::dir), $_);
780d3752 43 (my $xs_file1 = $_) =~ s/\.pm$/.xs/;
44 (my $xs_file2 = $file2) =~ s/\.pm$/.xs/;
45 if (-e $xs_file1 && -e $xs_file2) {
46 return if compare($_, $file2) == 0 &&
47 compare($xs_file1, $xs_file2) == 0;
48 } else {
49 return if compare($_, $file2) == 0;
50 }
f1c5bace 51 my $version1 = eval {MM->parse_version($_)};
52 my $version2 = eval {MM->parse_version($file2)};
53 push @wanted, $File::Find::name
0ac6c0fd 54 if defined $version1 &&
55 defined $version2 &&
56 $version1 eq $version2
f1c5bace 57 } }, curdir);
58print map { $_, "\n" } sort @wanted;
59