From 301bcfdaa73a979264d6ee1845c40043ddd464eb Mon Sep 17 00:00:00 2001
From: Father Chrysostomos <sprout@cpan.org>
Date: Mon, 30 Oct 2017 13:37:21 -0700
Subject: [PATCH] make_ext.pl: Use version.pm for version cmp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We do a version comparison to determine whether Makefile.PL needs to
be run (in case a module version changed).  The simple string compar-
ison we have done up till now fails if the two version numbers differ
simply by a trailing zero (as currently happens with DB_File, which
is at version 1.840, with XS_VERSION set to 1.84.  Since version.pm’s
routines are compiled into miniperl, there is no reason not to do this
‘properly’, and it stops multiple ‘make’ invocations from rebuilding
DB_File again, and again....
---
 make_ext.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git make_ext.pl.orig make_ext.pl
index 80d8f68aa318..9bc4718d52d4 100644
--- make_ext.pl.orig
+++ make_ext.pl
@@ -303,7 +303,7 @@ sub build_extension {
 	    last unless defined $oldv;
 	    require ExtUtils::MM_Unix;
 	    defined (my $newv = parse_version MM $vmod) or last;
-	    if ($newv ne $oldv) {
+	    if (version->parse($newv) ne $oldv) {
 		close $mfh or die "close $makefile: $!";
 		_unlink($makefile);
 		{
