Closed
Bug 679965
(bz_packagers)
Opened 14 years ago
Closed 13 years ago
Offer Linux packagers an easy way to specify the location of the Bugzilla modules
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
Attachments
(2 files, 2 obsolete files)
2.52 KB,
text/plain
|
dkl
:
review+
|
Details |
561 bytes,
patch
|
Details | Diff | Splinter Review |
In most Linux distributions, the Bugzilla modules (Bugzilla.pm and Bugzilla/*.pm) are not in the same directory as the *.cgi scripts when provided by a RPM or other package format. This forces them to edit all *.cgi scripts to fix the
use lib qw(. lib);
line to make it point to the new location, e.g. /usr/share/bugzilla/lib.
The attached file is a fake Bugzilla.pm module which the packagers can put in the Perl directory, e.g. in /usr/lib/perl5/vendor_perl/5.x.y/ which will be loaded when the real Bugzilla.pm cannot be found. This module contains a $bz_root_dir variable which must point to the new location of the Bugzilla modules. With the example above, it would be:
$bz_root_dir = '/usr/share/bugzilla/lib';
It will then add the new location in @INC and load the real Bugzilla.pm module transparently for the caller.
This fake module requires *no* code change upstream and so works with all versions of Bugzilla. We could either offer this module in contrib/, or let it in this bug so that Linux packagers can find it and use it.
Comment 1•14 years ago
|
||
Comment on attachment 553979 [details]
fake Bugzilla.pm module for Linux packagers
>my ($bz_root_dir, @bugzilla_lib_paths);
Those would have to be "our" instead of "my".
Comment 2•14 years ago
|
||
I think we should throw this in contrib or something, though, I like it.
![]() |
Assignee | |
Updated•14 years ago
|
Flags: approval?
Target Milestone: --- → Bugzilla 5.0
Comment 4•14 years ago
|
||
Comment on attachment 560826 [details]
fake Bugzilla.pm module for Linux packagers, v1.1
> # Specify the path to the real Bugzilla.pm file.
> # Some Linux distros may set it to '/usr/share/bugzilla/lib'.
> # That's the single line you are supposed to edit in this file!!
> $bz_root_dir = '/usr/share/bugzilla/lib';
You could also do this with a "use constant", which would eliminate the need for a BEGIN block.
Comment 5•14 years ago
|
||
Also, I think the one line that is going to be edited should be nearer the top of the file.
![]() |
Assignee | |
Comment 6•13 years ago
|
||
Now using constants. Tested, and works fine.
Attachment #560826 -
Attachment is obsolete: true
Attachment #599392 -
Flags: review?(dkl)
![]() |
Assignee | |
Comment 7•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
Also asking bkor for review as he uses this file for real in the bugzilla RPM in Mageia.
Attachment #599392 -
Flags: review?(bugzilla-mozilla)
Comment 8•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
>use constant BZ_ROOT_DIR => '/usr/share/bugzilla/lib';
>use constant BZ_LIB_DIR => BZ_ROOT_DIR . '/lib';
These are effectively the same. Should it not be instead:
use constant BZ_ROOT_DIR => '/usr/share/bugzilla';
FWIW, Fedora uses /usr/share/bugzilla as well but they leave all of Bugzilla.pm and Bugzilla/*.pm modules in the BZ_ROOT_DIR so this
would not be necessary. But I can still test it and make sure it does work properly.
dkl
Comment 9•13 years ago
|
||
I am getting errors from this based on Bugzilla::Constants::bz_locations gets the $libpath value based on where Bugzilla/Constants.pm resides. So if my Bugzilla modules are located at /usr/share/bugzilla/lib, bz_locations things the data files for example are /usr/share/bugzilla/lib/data/params which is incorrect. The data dir is in the same patch as my *.cgi scripts at a different location. How were you able to work around this in your testing?
dkl
Comment 10•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
r- based on comment 9 unless I am doing something wrong.
dkl
Attachment #599392 -
Flags: review?(dkl) → review-
![]() |
Assignee | |
Comment 11•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
You of course have to fix paths specified in bz_locations() if they are not standard. This fake Bugzilla.pm is not going to do it for you. Its goal is to let .cgi and .pl scripts find the real Bugzilla.pm and others Bugzilla/*.pm files. From there, it's the job of bz_locations() to have the right data in it.
Attachment #599392 -
Flags: review- → review?(dkl)
Comment 12•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
I dont understand. all of the comment in bz_locations() says that it assumes all bz data is in the same dir as Bugzilla/Constants.pm. With your comment im 679965, the comments are therefore wrong
So the packager would either 1) leave Bugzilla/Constants.pm in the cgi dir, 2) make bz_locations() use a different method of determining its current directory or 3) require the packager to manually add the right paths to Bugzilla/Constants.pm wherever the modules reside.
dkl
Comment 13•13 years ago
|
||
Comment on attachment 599392 [details]
fake Bugzilla.pm module for Linux packagers, v2
r+ knowing that packagers will need to manually patch Constants.pm and checksetup.pl to work with the fake Bugzilla.pm module.
dkl
Attachment #599392 -
Flags: review?(dkl) → review+
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #599392 -
Flags: review?(bugzilla-mozilla)
![]() |
Assignee | |
Updated•13 years ago
|
Flags: approval? → approval+
![]() |
Assignee | |
Comment 14•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
added contrib/Bugzilla.pm
Committed revision 8150.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
![]() |
Assignee | |
Comment 15•13 years ago
|
||
I forgot to fix permissions for contrib/Bugzilla.pm. By default, all files in contrib/ are executable. This shouldn't be the case for Bugzilla.pm.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Install/Filesystem.pm
Committed revision 8175.
![]() |
Assignee | |
Comment 16•13 years ago
|
||
Comment on attachment 613393 [details] [diff] [review]
fix perms on contrib/Bugzilla.pm
>+ 'contrib/Bugzilla.pm', => { perms => OWNER_WRITE },
FYI, I removed the extra comma before => on checkin.
![]() |
Assignee | |
Comment 17•13 years ago
|
||
Added to relnotes for 4.4.
You need to log in
before you can comment on or make changes to this bug.
Description
•