public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Emmanuel Seyman <emmanuel@seyman.fr>
To: git-commits@fedoraproject.org
Subject: [rpms/bugzilla] epel10.3: - Fix the comparison of module versions (#1044854)
Date: Wed, 21 Oct 2026 06:41:30 GMT [thread overview]
Message-ID: <179256489055.1.14316202785548488510.rpms-bugzilla-f3a02032d46c@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/bugzilla
Branch : epel10.3
Commit : f3a02032d46cab2a2d62b59d90b52e45dfa1be50
Author : Emmanuel Seyman <emmanuel@seyman.fr>
Date : 2014-01-14T02:32:03+01:00
Stats : +98/-2 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/bugzilla/c/f3a02032d46cab2a2d62b59d90b52e45dfa1be50?branch=epel10.3
Log:
- Fix the comparison of module versions (#1044854)
- Really honor the PROJECT environment variable (#911943)
---
diff --git a/bugzilla-invalid-version.patch b/bugzilla-invalid-version.patch
new file mode 100644
index 0000000..21360a8
--- /dev/null
+++ b/bugzilla-invalid-version.patch
@@ -0,0 +1,22 @@
+=== 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
+
diff --git a/bugzilla-rw-paths.patch b/bugzilla-rw-paths.patch
index f2f342b..1bad35c 100644
--- a/bugzilla-rw-paths.patch
+++ b/bugzilla-rw-paths.patch
@@ -11,7 +11,7 @@ diff -up ./Bugzilla/Constants.pm.orig ./Bugzilla/Constants.pm
- 'localconfig' => "$libpath/$localconfig",
- 'datadir' => $datadir,
- 'attachdir' => "$datadir/attachments",
-+ 'localconfig' => "/etc/bugzilla/localconfig",
++ 'localconfig' => "/etc/bugzilla/$localconfig",
+ 'datadir' => "/var/lib/bugzilla/$datadir",
+ 'attachdir' => "/var/lib/bugzilla/$datadir/attachments",
'skinsdir' => "$libpath/skins",
diff --git a/bugzilla-vers-cmp.patch b/bugzilla-vers-cmp.patch
new file mode 100644
index 0000000..33f4d5e
--- /dev/null
+++ b/bugzilla-vers-cmp.patch
@@ -0,0 +1,64 @@
+=== modified file 'Bugzilla/Install/Requirements.pm'
+--- ./Bugzilla/Install/Requirements.pm 2013-12-02 16:00:20 +0000
++++ ./Bugzilla/Install/Requirements.pm 2013-12-02 16:07:30 +0000
+@@ -24,6 +24,7 @@
+ # MUST NOT "use."
+
+ use strict;
++use version;
+
+ use Bugzilla::Constants;
+ use Bugzilla::Install::Util qw(vers_cmp install_string bin_loc
+@@ -206,7 +207,9 @@
+ 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)],
+ },
+ {
+@@ -640,8 +643,8 @@
+ 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};
+@@ -666,21 +669,17 @@
+ if ($@) {
+ no strict 'refs';
+ $vnum = ${"${module}::VERSION"};
++
++ # 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;
+
+- # 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;
+- }
+-
+- 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}});
+
diff --git a/bugzilla.spec b/bugzilla.spec
index e3c747f..358238b 100644
--- a/bugzilla.spec
+++ b/bugzilla.spec
@@ -6,7 +6,7 @@ URL: http://www.bugzilla.org/
Name: bugzilla
Version: 4.2.7
Group: Applications/Publishing
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MPLv1.1
Source0: http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-%{version}.tar.gz
Source1: bugzilla-httpd-conf
@@ -15,6 +15,10 @@ Source3: bugzilla.cron-daily
Patch0: bugzilla-rw-paths.patch
Patch1: bugzilla-yum.patch
Patch2: bugzilla-project-mod_perl.patch
+# Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=938300
+Patch3: bugzilla-invalid-version.patch
+# Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=781672
+Patch4: bugzilla-vers-cmp.patch
BuildArch: noarch
Requires: webserver, patchutils, perl(SOAP::Lite), which
@@ -106,6 +110,8 @@ Contributed scripts and functions for Bugzilla
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
rm -f Bugzilla/Constants.pm.orig
rm -f Bugzilla/Install/Requirements.pm.orig
# Remove bundled libs
@@ -217,6 +223,10 @@ popd > /dev/null)
%{bzinstallprefix}/bugzilla/contrib/syncLDAP.pl
%changelog
+* Tue Jan 14 2014 Emmanuel Seyman <emmanuel@seyman.fr> - 4.2.7-3
+- Fix the comparison of module versions (#1044854)
+- Really honor the PROJECT environment variable (#911943)
+
* Thu Nov 14 2013 Emmanuel Seyman <emmanuel@seyman.fr> - 4.2.7-2
- Add patch to cache bz_locations() (bmo #843457)
- Fix constants patch to honor the PROJECT environment variable (#911943)
reply other threads:[~2026-10-21 6:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179256489055.1.14316202785548488510.rpms-bugzilla-f3a02032d46c@fedoraproject.org \
--to=emmanuel@seyman.fr \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox