]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 781672: checksetup.pl fails to check the version of the latest Apache2::SizeLimit...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 2 Dec 2013 16:00:20 +0000 (17:00 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 2 Dec 2013 16:00:20 +0000 (17:00 +0100)
r=dkl a=justdave

Bugzilla/Install/Requirements.pm

index 83723b327fe025a7ea4b507c155e3532b78941f4..78234151300c5a55fded65d1004d03e4ef04a7e1 100644 (file)
@@ -659,8 +659,15 @@ sub have_vers {
     Bugzilla::Install::Util::set_output_encoding();
 
     # VERSION is provided by UNIVERSAL::, and can be called even if
-    # the module isn't loaded.
-    my $vnum = $module->VERSION || -1;
+    # the module isn't loaded. We eval'uate ->VERSION because it can die
+    # when the version is not valid (yes, this happens from time to time).
+    # In that case, we use an uglier method to get the version.
+    my $vnum = eval { $module->VERSION };
+    if ($@) {
+        no strict 'refs';
+        $vnum = ${"${module}::VERSION"};
+    }
+    $vnum ||= -1;
 
     # CGI's versioning scheme went 2.75, 2.751, 2.752, 2.753, 2.76
     # That breaks the standard version tests, so we need to manually correct