summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-13 13:46:18 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-13 13:46:18 +0000
commitf1c5bace3cddb63bc864a4d515fe402f7e49136a (patch)
tree66fd1cb35d4022ef0f845f926d3eedf1b13c312a
parent14885b4f644f1be8e008dafda1c2d0646c53881d (diff)
downloadperl-f1c5bace3cddb63bc864a4d515fe402f7e49136a.tar.gz
Add cmpVERSION.pl from Slaven for comparing two
Perl source trees for modules that have changed but have the same version numbers. p4raw-id: //depot/perl@20678
-rw-r--r--MANIFEST1
-rw-r--r--Porting/cmpVERSION.pl38
2 files changed, 39 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index 09d6300bd0..694c562e98 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2398,6 +2398,7 @@ Porting/apply Apply patches sent by mail
Porting/check83.pl Check whether we are 8.3-friendly
Porting/checkURL.pl Check whether we have working URLs
Porting/checkVERSION.pl Check whether we have $VERSIONs
+Porting/cmpVERSION.pl Compare whether two trees have changed modules
Porting/config.sh Sample config.sh
Porting/config_H Sample config.h
Porting/Contract Social contract for contributed modules in Perl core
diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl
new file mode 100644
index 0000000000..b33547669c
--- /dev/null
+++ b/Porting/cmpVERSION.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+#
+# cmpVERSION - compare two Perl source trees for modules
+# that have identical version numbers but different contents.
+#
+# Original by slaven@rezic.de, modified by jhi.
+#
+
+use strict;
+
+use ExtUtils::MakeMaker;
+use File::Compare;
+use File::Find;
+use File::Spec::Functions qw(rel2abs abs2rel catfile catdir curdir);
+
+for (@ARGV[0, 1]) {
+ die "$0: '$_' does not look like Perl directory\n"
+ unless -f catfile($_, "perl.h") && -d catdir($_, "Porting");
+}
+
+my $dir2 = rel2abs($ARGV[1]);
+chdir $ARGV[0] or die "$0: chdir '$ARGV[0]' failed: $!\n";
+
+my @wanted;
+find(
+ sub { /\.pm$/ &&
+ do { my $file2 =
+ catfile(catdir($dir2, $File::Find::dir), $_);
+ return if compare($_, $file2) == 0;
+ my $version1 = eval {MM->parse_version($_)};
+ my $version2 = eval {MM->parse_version($file2)};
+ push @wanted, $File::Find::name
+ if $version1 eq $version2
+ } }, curdir);
+print map { $_, "\n" } sort @wanted;
+
+