Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
ef79ea33
Commit
ef79ea33
authored
Dec 02, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 938300: vers_cmp() incorrectly compares module versions
r=sgreen a=justdave
parent
7f666621
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
Requirements.pm
Bugzilla/Install/Requirements.pm
+14
-15
No files found.
Bugzilla/Install/Requirements.pm
View file @
ef79ea33
...
...
@@ -14,6 +14,7 @@ package Bugzilla::Install::Requirements;
# MUST NOT "use."
use
strict
;
use
version
;
use
Bugzilla::
Constants
;
use
Bugzilla::Install::
Util
qw(vers_cmp install_string bin_loc
...
...
@@ -199,7 +200,9 @@ sub OPTIONAL_MODULES {
package
=>
'Chart'
,
module
=>
'Chart::Lines'
,
# Versions below 2.1 cannot be detected accurately.
version
=>
'2.1'
,
# There is no 2.1.0 release (it was 2.1), but .0 is required to fix
# https://rt.cpan.org/Public/Bug/Display.html?id=28218.
version
=>
'2.1.0'
,
feature
=>
[
qw(new_charts old_charts)
],
},
{
...
...
@@ -665,8 +668,8 @@ sub check_graphviz {
return
$return
;
}
# This was originally clipped from the libnet Makefile.PL, adapted here
to
#
use the below vers_cmp routine for
accurate version checking.
# This was originally clipped from the libnet Makefile.PL, adapted here
for
# accurate version checking.
sub
have_vers
{
my
(
$params
,
$output
)
=
@_
;
my
$module
=
$params
->
{
module
};
...
...
@@ -691,21 +694,17 @@ sub have_vers {
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
# the version
if
(
$module
eq
'CGI'
&&
$vnum
=~
/(2\.7\d)(\d+)/
)
{
$vnum
=
$1
.
"."
.
$2
;
}
# CPAN did a similar thing, where it has versions like 1.9304.
if
(
$module
eq
'CPAN'
and
$vnum
=~
/^(\d\.\d{2})\d{2}$/
)
{
$vnum
=
$1
;
# If we come here, then the version is not a valid one.
# We try to sanitize it.
if
(
$vnum
=~
/^((\d+)(\.\d+)*)/
)
{
$vnum
=
$1
;
}
}
$vnum
||=
-
1
;
my
$vok
=
(
vers_cmp
(
$vnum
,
$wanted
)
>
-
1
);
# Must do a string comparison as $vnum may be of the form 5.10.1.
my
$vok
=
(
$vnum
ne
'-1'
&&
version
->
new
(
$vnum
)
>=
version
->
new
(
$wanted
))
?
1
:
0
;
my
$blacklisted
;
if
(
$vok
&&
$params
->
{
blacklist
})
{
$blacklisted
=
grep
(
$vnum
=~
/$_/
,
@
{
$params
->
{
blacklist
}});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment