Bug 7143 - Evaluate makemaker version using perl best practices
Summary: Evaluate makemaker version using perl best practices
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Building & Packaging (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Windows 7
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 20:11 UTC by Quanah Gibson-Mount
Modified: 2015-03-10 20:55 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Quanah Gibson-Mount 2015-02-20 20:11:50 UTC
As per:

http://perldoc.perl.org/perlmodstyle.html#Version-numbering

Makefile.PL can be simplified with:

--- Makefile.PL.orig    2015-02-20 14:09:08.821327624 -0600
+++ Makefile.PL 2015-02-20 14:09:42.725326495 -0600
@@ -8,12 +8,9 @@
 use ExtUtils::MakeMaker;

 # Store the version for later use
-my $mm_version = $ExtUtils::MakeMaker::VERSION;
-
 # avoid stupid 'Argument "6.30_01" isn't numeric in numeric ge (>=)' warnings;
 # strip off the beta subversion noise that causes the trouble.
-$mm_version =~ s/_\S+$//;      # "6.30_01" => "6.30"
-$mm_version += 0;
+my $mm_version = eval $ExtUtils::MakeMaker::VERSION;

 if ($mm_version < 6.17) {
   die "SpamAssassin Makefile.PL requires at least ExtUtils::MakeMaker v6.17";
Comment 1 Kevin A. McGrail 2015-03-10 20:55:10 UTC
Thanks.  I cleaned up removing the one comment that says it strips it off since 6.64_01 becomes 6.6401 with the eval but otherwise looks sound.

svn commit -m 'use eval instead of regex to fix MakeMaker version - bug 7143' Makefile.PL 
Sending        Makefile.PL
Transmitting file data .
Committed revision 1665679.