public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/bugzilla] epel10: Patch bugzilla so that it will cache bz_locations() and not memorize it.
@ 2026-10-21  6:01 Emmanuel Seyman
  0 siblings, 0 replies; only message in thread
From: Emmanuel Seyman @ 2026-10-21  6:01 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/bugzilla
            Branch : epel10
            Commit : bc9a72be42f9fb45b2fde8db121ab6456a4fefd5
            Author : Emmanuel Seyman <emmanuel@seyman.fr>
            Date   : 2013-11-15T00:01:00+01:00
            Stats  : +49/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/bugzilla/c/bc9a72be42f9fb45b2fde8db121ab6456a4fefd5?branch=epel10

            Log:
            Patch bugzilla so that it will cache bz_locations() and not memorize it.
Clean up our own patch to Bugzilla/Constants.pm so that the PROJECT
environment variable can be used.

---
diff --git a/bugzilla-project-mod_perl.patch b/bugzilla-project-mod_perl.patch
new file mode 100644
index 0000000..a29632a
--- /dev/null
+++ b/bugzilla-project-mod_perl.patch
@@ -0,0 +1,41 @@
+diff -up ./Bugzilla/Constants.pm.orig ./Bugzilla/Constants.pm
+--- ./Bugzilla/Constants.pm.orig	2013-11-14 23:21:44.947050044 +0100
++++ ./Bugzilla/Constants.pm	2013-11-14 23:23:55.873245730 +0100
+@@ -591,6 +591,13 @@ use constant AUDIT_CREATE => '__create__
+ use constant AUDIT_REMOVE => '__remove__';
+ 
+ sub bz_locations {
++    # Force memoize() to re-compute data per project, to avoid
++    # sharing the same data across different installations.
++    return _bz_locations($ENV{'PROJECT'});
++}
++
++sub _bz_locations {
++    my $project = shift;
+     # We know that Bugzilla/Constants.pm must be in %INC at this point.
+     # So the only question is, what's the name of the directory
+     # above it? This is the most reliable way to get our current working
+@@ -607,12 +614,13 @@ sub bz_locations {
+     $libpath =~ /(.*)/;
+     $libpath = $1;
+ 
+-    my ($project, $localconfig, $datadir);
+-    if ($ENV{'PROJECT'} && $ENV{'PROJECT'} =~ /^(\w+)$/) {
++    my ($localconfig, $datadir);
++    if ($project && $project =~ /^(\w+)$/) {
+         $project = $1;
+         $localconfig = "localconfig.$project";
+         $datadir = "data/$project";
+     } else {
++	$project = undef;
+         $localconfig = "localconfig";
+         $datadir = "data";
+     }
+@@ -647,6 +655,6 @@ sub bz_locations {
+ 
+ # This makes us not re-compute all the bz_locations data every time it's
+ # called.
+-BEGIN { memoize('bz_locations') };
++BEGIN { memoize('_bz_locations') };
+ 
+ 1;

diff --git a/bugzilla.spec b/bugzilla.spec
index 93f13b3..e3c747f 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: 1%{?dist}
+Release: 2%{?dist}
 License: MPLv1.1
 Source0: http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-%{version}.tar.gz
 Source1: bugzilla-httpd-conf
@@ -14,6 +14,7 @@ Source2: README.fedora.bugzilla
 Source3: bugzilla.cron-daily
 Patch0: bugzilla-rw-paths.patch
 Patch1: bugzilla-yum.patch
+Patch2: bugzilla-project-mod_perl.patch
 
 BuildArch: noarch
 Requires: webserver, patchutils, perl(SOAP::Lite), which
@@ -104,6 +105,7 @@ Contributed scripts and functions for Bugzilla
 %setup -q -n %{name}-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 rm -f Bugzilla/Constants.pm.orig
 rm -f Bugzilla/Install/Requirements.pm.orig
 # Remove bundled libs
@@ -215,7 +217,11 @@ popd > /dev/null)
 %{bzinstallprefix}/bugzilla/contrib/syncLDAP.pl
 
 %changelog
-* Thu Oct 17 2013 Emmanuel Seyman <emmanuel@seyman.fr> - 4.2.6-6
+* 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)
+
+* Thu Oct 17 2013 Emmanuel Seyman <emmanuel@seyman.fr> - 4.2.7-1
 - Update to 4.2.7 (security updates)
 - Patch bugzilla to write compiled templates under /var (#949130)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-21  6:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  6:01 [rpms/bugzilla] epel10: Patch bugzilla so that it will cache bz_locations() and not memorize it Emmanuel Seyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox