bugzilla/bugzilla-invalid-version.patch
Emmanuel Seyman f3a02032d4 - Fix the comparison of module versions (#1044854)
- Really honor the PROJECT environment variable (#911943)
2014-01-14 02:32:03 +01:00

22 lines
917 B
Diff

=== modified file 'Bugzilla/Install/Requirements.pm'
--- ./Bugzilla/Install/Requirements.pm 2013-03-26 11:07:25 +0000
+++ ./Bugzilla/Install/Requirements.pm 2013-12-02 16:00:20 +0000
@@ -659,8 +659,15 @@
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