Commit c01c5624 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 781672: checksetup.pl fails to check the version of the latest…

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
parent 49dfaed8
...@@ -676,8 +676,15 @@ sub have_vers { ...@@ -676,8 +676,15 @@ sub have_vers {
Bugzilla::Install::Util::set_output_encoding(); Bugzilla::Install::Util::set_output_encoding();
# VERSION is provided by UNIVERSAL::, and can be called even if # VERSION is provided by UNIVERSAL::, and can be called even if
# the module isn't loaded. # the module isn't loaded. We eval'uate ->VERSION because it can die
my $vnum = $module->VERSION || -1; # 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. # Fix CPAN versions like 1.9304.
if ($module eq 'CPAN' and $vnum =~ /^(\d\.\d{2})\d{2}$/) { if ($module eq 'CPAN' and $vnum =~ /^(\d\.\d{2})\d{2}$/) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment