Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 11374
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: trevor.schellhorn-perl [...] marketingtips.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 6.25
Fixed in: (no value)



Subject: ExtUtils::MakeMaker doesn't handle VERSION defined with version.pm
ExtUtils::MakeMaker doesn't deal well when module versions are defined using the 'version.pm' module. Attached is a patch that handles the situation by checking if the line with the $VERSION definition contains the 'version->new' code. I have also updated the 'parse_version.t' test case to check for this. I tested this code on perl 5.8.6. I did not do any checks to see if the version module was installed though. This may pose an issue if the version module is not installed on the target machine.
diff -ru ExtUtils-MakeMaker-6.25-orig/lib/ExtUtils/MM_Unix.pm ExtUtils-MakeMaker-6.25/lib/ExtUtils/MM_Unix.pm --- ExtUtils-MakeMaker-6.25-orig/lib/ExtUtils/MM_Unix.pm 2004-12-15 04:01:32.000000000 -0800 +++ ExtUtils-MakeMaker-6.25/lib/ExtUtils/MM_Unix.pm 2005-02-03 18:37:16.000000000 -0800 @@ -3051,6 +3051,9 @@ $_ }; \$$2 }; + # Check if we need to load version.pm + $eval =~ s/(no strict;)/$1 use version;/ + if $_ =~ m/version->new/ or $_ =~ m/new version/; local $^W = 0; $result = eval($eval); warn "Could not eval '$eval' in $parsefile: $@" if $@; diff -ru ExtUtils-MakeMaker-6.25-orig/t/parse_version.t ExtUtils-MakeMaker-6.25/t/parse_version.t --- ExtUtils-MakeMaker-6.25-orig/t/parse_version.t 2004-12-04 12:06:00.000000000 -0800 +++ ExtUtils-MakeMaker-6.25/t/parse_version.t 2005-02-03 18:45:01.000000000 -0800 @@ -11,7 +11,7 @@ } chdir 't'; -use Test::More tests => 10; +use Test::More tests => 12; use ExtUtils::MakeMaker; my %versions = ('$VERSION = 0.02' => 0.02, @@ -19,6 +19,7 @@ '$VERSION = -1.0' => -1.0, '$VERSION = undef' => 'undef', '$wibble = 1.0' => 'undef', + '$VERSION = version->new( \'1.1.1\' )' => '1.1.1', ); while( my($code, $expect) = each %versions ) {
From: trevor.schellhorn-perl [...] marketingtips.com
[guest - Thu Feb 3 21:54:23 2005]: Show quoted text
> ExtUtils::MakeMaker doesn't deal well when module versions are defined > using the 'version.pm' module. Attached is a patch that handles > the situation by checking if the line with the $VERSION definition > contains the 'version->new' code. I have also updated the > 'parse_version.t' test case to check for this. > > I tested this code on perl 5.8.6. I did not do any checks to see if > the version module was installed though. This may pose an issue if > the version module is not installed on the target machine.
In using this patch, we are still having issues when comparing module versions. I am going to be adding some stuff to this patch to help handle that. These changes will require some testing to make sure that other people agree. I have discussed some of this with Ken Williams who handles the Module::Build stuff. We have talked about getting a general module version comparison routine that both ExtUtils::MakeMaker and Module::Build can use. I will let you know when I get a patch for this done up and look over the stuff in Module::Build for the module comparison. (I think he has put this off waiting for this.)
MakeMaker was made compatible with version.pm a few versions back. Instructions for how it interacts with $VERSION are in the VERSION_FROM docs.