Change 20678 by [EMAIL PROTECTED] on 2003/08/13 13:46:18

        Add cmpVERSION.pl from Slaven for comparing two
        Perl source trees for modules that have changed
        but have the same version numbers.

Affected files ...

... //depot/perl/MANIFEST#1062 edit
... //depot/perl/Porting/cmpVERSION.pl#1 add

Differences ...

==== //depot/perl/MANIFEST#1062 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#1061~20652~   Tue Aug 12 06:06:40 2003
+++ perl/MANIFEST       Wed Aug 13 06:46:18 2003
@@ -2398,6 +2398,7 @@
 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

==== //depot/perl/Porting/cmpVERSION.pl#1 (text) ====
Index: perl/Porting/cmpVERSION.pl
--- /dev/null   Tue May  5 13:32:27 1998
+++ perl/Porting/cmpVERSION.pl  Wed Aug 13 06:46:18 2003
@@ -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 [EMAIL PROTECTED], 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;
+
+
End of Patch.

Reply via email to