This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The blead version has got the dor.
[perl5.git] / Porting / cmpVERSION.pl
CommitLineData
f1c5bace
JH
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
25my @wanted;
26find(
27 sub { /\.pm$/ &&
28 do { my $file2 =
29 catfile(catdir($dir2, $File::Find::dir), $_);
30 return if compare($_, $file2) == 0;
31 my $version1 = eval {MM->parse_version($_)};
32 my $version2 = eval {MM->parse_version($file2)};
33 push @wanted, $File::Find::name
34 if $version1 eq $version2
35 } }, curdir);
36print map { $_, "\n" } sort @wanted;
37
38