dependency on CGI::Carp

RESOLVED FIXED in Bugzilla 2.14



18 years ago
6 years ago


(Reporter: barnboy, Assigned: justdave)


Bugzilla 2.14



(2 attachments)



18 years ago
Dave, I hope you don't mind me assigning this to you intially -- if you think
it's in Tara's or Cyeh's department or something, take it away : )

We have an undocumented dependency on CGI::Carp in
I am documenting this for the next release of the Bugzilla Guide.  This bug,
however, I'm filing for someone to fix so that it checks for the
presence of CGI::Carp before executing (rather than dumping with an Unhandled
Exception).  Here's a copy of the email I sent to the newsgroup:

I'm going to file a bug on this in a few minutes...

I'm running through my install docs and noted this bug in on a 
vanilla install of Linux-Mandrake 8.0.

Unfortunately, I do not have "CGI::Carp" in the documentation as a 
prerequisite; I believe the assumption was that it was always installed with 
Perl -- but that ain't the case with Mandrake 8.0 and Perl 5.6.0.  Anybody 
feel like hacking to mark this as a dependency, while I get 
this prerequisite listed in the documentation?

I've verified this fixes the problem:
bash# perl -MCPAN -e 'install "CGI::Carp"'

However, this needs to be documented (my responsibility, I'm working on it) 
and fixed in so that it checks for the presence of this module 
(not my job, but I'll do it if nobody else wants to).  Thanks!

Uncaught exception from user code:
        Uncaught exception from user code:
        Uncaught exception from user code:
        Uncaught exception from user code:
        Can't locate CGI/ in @INC (@INC contains: 
/usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 
/usr/lib/perl5/site_perl .) at line 38.
        RelationSet::BEGIN() called at CGI/ line 38
        require 0 called at CGI/ line 38
        require called at ./processmail line 34
        main::BEGIN() called at CGI/ line 38
        require 0 called at CGI/ line 38
BEGIN failed--compilation aborted at line 38.
        require called at ./processmail line 34
        main::BEGIN() called at line 38
        require 0 called at line 38
Compilation failed in require at line 34.
        main::BEGIN() called at line 34
        require 0 called at line 34
BEGIN failed--compilation aborted at ./processmail line 34.
Reminder: Bugzilla now requires version 8.7 or later of sendmail.
Not at all...  saw you post about it on the newsgroup and was waiting for it to 
show up so I could snag it. :)  You just saved me the trouble :)
Target Milestone: --- → Bugzilla 2.14
Created attachment 36332 [details] [diff] [review]
Patch to add CGI::Carp to the version checks
Besides adding the version check for CGI::Carp, I also reorganized the version 
checks so that instead of stopping on the spot when a good version is not found, 
it now saves a list of missing modules, and then reports all of them at the end, 
with the instructions for how to install them.

I also added an error check for the database version check.  If you have a 
password-protected database, and don't have the password in your localconfig it 
wasn't bailing when it failed to connect to the database, and you wound up with 
all kinds of errors later.

CGI::Carp, when you load it to check the version numbers, installs alternate 
'die' and 'warn' handlers.  This makes any additional errors that ocurr in (such as the one above that I ran into) look really funky since the 
output's going to your screen and not to the web server logs. :-)  So I also had 
to put in code around the version check for CGI::Carp to save and restore the die 
and warn handlers.
Keywords: patch, review

Comment 4

18 years ago
Two Comments:
 * The @missing if statement should start off w/a newline or two as the text that
   tells you that something is missing runs together with the version checking.
 * It looks kinda funny when it just says "Uncaught exeception from user code:"
   followed by a blank line.  Perhaps 'exit;' instead of 'die "\n";'?

With those minor changes, r=jake
Checked in.
Last Resolved: 18 years ago
Resolution: --- → FIXED
Moving to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Version: Bugzilla 2.12 → unspecified
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.