checksetup.pl dependency on CGI::Carp

RESOLVED FIXED in Bugzilla 2.14

Status

()

--
trivial
RESOLVED FIXED
18 years ago
6 years ago

People

(Reporter: barnboy, Assigned: justdave)

Tracking

unspecified
Bugzilla 2.14
x86
Linux

Details

Attachments

(2 attachments)

(Reporter)

Description

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 Checksetup.pl.
I am documenting this for the next release of the Bugzilla Guide.  This bug,
however, I'm filing for someone to fix checksetup.pl 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 checksetup.pl 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 checksetup.pl 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 checksetup.pl 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/Carp.pm 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 RelationSet.pm line 38.
        RelationSet::BEGIN() called at CGI/Carp.pm line 38
        require 0 called at CGI/Carp.pm line 38
        require RelationSet.pm called at ./processmail line 34
        main::BEGIN() called at CGI/Carp.pm line 38
        require 0 called at CGI/Carp.pm line 38
BEGIN failed--compilation aborted at RelationSet.pm line 38.
        require RelationSet.pm called at ./processmail line 34
        main::BEGIN() called at RelationSet.pm line 38
        require 0 called at RelationSet.pm line 38
Compilation failed in require at RelationSet.pm line 34.
        main::BEGIN() called at RelationSet.pm line 34
        require 0 called at RelationSet.pm 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 :)
Status: NEW → ASSIGNED
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 
checksetup.pl (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.
Status: ASSIGNED → RESOLVED
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.