[PATCH Search::Xapian] Makefile.PL: fix automated testing false negative

Alyssa Ross <[email protected]>
Newsgroups gmane.comp.search.xapian.general
Message-ID <[email protected]>
In the case of Search::Xapian 1.2.x and xapian-core 1.4.y, $msg is
deliberately unset because the two versions should be
compatible. Since this is intended to be an escape from this
conditional, it should be respected by the AUTOMATED_TESTING check, so
automated testing with compatible libraries doesn't nevertheless
result in no Makefile.
---
 Makefile.PL | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.PL b/Makefile.PL
index 7aa3583..0efadc4 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -205,23 +205,23 @@ if ($xver !~ /^\Q$BASEVERSION\E(?:_(?:svn|git)[0-9]+)?$/) {
     my $msg;
     if ($no_chance) {
 	$msg = "Xapian version $xver is incompatible with Search::Xapian $VERSION\n";
     } elsif ($BASEVERSION =~ /^1\.2\./ && $xver =~ /^1\.4\./) {
 	# Search::Xapian 1.2.x and xapian-core 1.4.y should work together
 	# (for x >= 24).
     } else {
 	# We try to keep working with Xapian 1.5.x and up but no promises.
 	$msg = "Xapian version $xver may be incompatible with Search::Xapian $VERSION\n";
     }
 
-    if ($ENV{AUTOMATED_TESTING}) {
+    if ($ENV{AUTOMATED_TESTING} && defined $msg) {
 	# Don't let automated testers continue, as we don't want bogus failure
 	# reports due to builds with incompatible versions.
 	print $msg;
 	# Remove Makefile since "exit status 0 without generating Makefile"
 	# is taken to indicate "can't build because of missing dependencies"
 	# by CPAN test building scripts.
 	unlink "Makefile";
 	exit 0;
     }
     if ($no_chance) {
 	unlink "Makefile";
-- 
2.22.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.