Bug 226673: Eliminate some warnings in checksetup.pl for "blah::Version used…

Bug 226673: Eliminate some warnings in checksetup.pl for "blah::Version used only once" and make sure errors don't get wrapped in CGI:Carp's HTML wrapper. r=bbaetz, a=justdave
parent f3c1ad0e
......@@ -38,7 +38,6 @@ use strict;
#require "globals.pl";
package RelationSet;
use CGI::Carp qw(fatalsToBrowser);
# create a new empty RelationSet
#
......
......@@ -38,7 +38,6 @@ use strict;
#require "globals.pl";
package RelationSet;
use CGI::Carp qw(fatalsToBrowser);
# create a new empty RelationSet
#
......
......@@ -187,8 +187,15 @@ sub have_vers {
no strict 'refs';
printf("Checking for %15s %-9s ", $pkg, !$wanted?'(any)':"(v$wanted)") unless $silent;
eval { my $p; ($p = $pkg . ".pm") =~ s!::!/!g; require $p; };
# Modules may change $SIG{__DIE__} and $SIG{__WARN__}, so localise them here
# so that later errors display 'normally'
local $::SIG{__DIE__};
local $::SIG{__WARN__};
eval "require $pkg;";
# do this twice to avoid a "used only once" error for these vars
$vnum = ${"${pkg}::VERSION"} || ${"${pkg}::Version"} || 0;
$vnum = ${"${pkg}::VERSION"} || ${"${pkg}::Version"} || 0;
$vnum = -1 if $@;
......@@ -260,11 +267,7 @@ my $modules = [
my %missing = ();
# Modules may change $SIG{__DIE__} and $SIG{__WARN__}, so localise them here
# so that later errors display 'normally'
foreach my $module (@{$modules}) {
local $::SIG{__DIE__};
local $::SIG{__WARN__};
unless (have_vers($module->{name}, $module->{version})) {
$missing{$module->{name}} = $module->{version};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment