ExtUtils::MM_Unix::parse_version croaks with an error if a file
contains a line of the form
$AnotherModule::VERSION == ...
$AnotherModule::VERSION != ...
$AnotherModule::VERSION <= ...
$AnotherModule::VERSION >= ...
before the module's $VERSION definition. Below a patch with a slightly
changed regex for parse_version and new tests.
Regards,
Slaven
diff -ur ../../build/ExtUtils-MakeMaker-6.05/lib/ExtUtils/MM_Unix.pm
./lib/ExtUtils/MM_Unix.pm
--- ../../build/ExtUtils-MakeMaker-6.05/lib/ExtUtils/MM_Unix.pm Tue Aug 27 03:17:55
2002
+++ ./lib/ExtUtils/MM_Unix.pm Mon Sep 30 22:38:50 2002
@@ -2927,7 +2927,8 @@
next if $inpod || /^\s*#/;
chop;
# next unless /\$(([\w\:\']*)\bVERSION)\b.*\=/;
- next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
+ # next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
+ next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*(?<![!=<>])\=(?!=)/;
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;
diff -ur ../../build/ExtUtils-MakeMaker-6.05/t/MM_Unix.t ./t/MM_Unix.t
--- ../../build/ExtUtils-MakeMaker-6.05/t/MM_Unix.t Mon May 6 03:20:34 2002
+++ ./t/MM_Unix.t Mon Sep 30 22:46:15 2002
@@ -18,7 +18,7 @@
plan skip_all => 'Non-Unix platform';
}
else {
- plan tests => 112;
+ plan tests => 118;
}
}
@@ -193,6 +193,12 @@
'$VERSION = -1.0' => -1.0,
'$VERSION = undef' => 'undef',
'$wibble = 1.0' => 'undef',
+ '$Something::VERSION == 1.0' => 'undef',
+ '$Something::VERSION <= 1.0' => 'undef',
+ '$Something::VERSION >= 1.0' => 'undef',
+ '$Something::VERSION != 1.0' => 'undef',
+ '$VERSION = sprintf("%d.%03d", q$Revision: 3.74 $ =~ /(\d+)\.(\d+)/);'
+=> '3.074',
+ '$VERSION = substr(q$Revision: 2.8 $, 10) + 2 . "";' => '4.8',
);
while( my($code, $expect) = each %versions ) {
--
Slaven Rezic - [EMAIL PROTECTED]
tksm - Perl/Tk program for searching and replacing in multiple files
http://ptktools.sourceforge.net/#tksm