summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install/Requirements.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-08-01 03:19:44 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2013-08-01 03:19:44 +0200
commitc01c56247f6c35ec1f155610ca6737f7d03e533b (patch)
treedd445de8565d59482bb5561c93d0dd675ddb7b1e /Bugzilla/Install/Requirements.pm
parent49dfaed80a4a534473a19a78d19d4d2df95c88b9 (diff)
downloadbugzilla-c01c56247f6c35ec1f155610ca6737f7d03e533b.tar.gz
bugzilla-c01c56247f6c35ec1f155610ca6737f7d03e533b.tar.xz
Bug 781672: checksetup.pl fails to check the version of the latest Apache2::SizeLimit release (it throws "Invalid version format (non-numeric data)")
r=dkl a=sgreen
Diffstat (limited to 'Bugzilla/Install/Requirements.pm')
-rw-r--r--Bugzilla/Install/Requirements.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm
index b6e3f9033..0d02904e9 100644
--- a/Bugzilla/Install/Requirements.pm
+++ b/Bugzilla/Install/Requirements.pm
@@ -676,8 +676,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;
# Fix CPAN versions like 1.9304.
if ($module eq 'CPAN' and $vnum =~ /^(\d\.\d{2})\d{2}$/) {