diff options
author | justdave%syndicomm.com <> | 2003-12-07 09:47:18 +0000 |
---|---|---|
committer | justdave%syndicomm.com <> | 2003-12-07 09:47:18 +0000 |
commit | b3612adaf807df9743c8003faee62071f680f92f (patch) | |
tree | c713461d9b69722e5bbf2409baa7c1655015d97f /checksetup.pl | |
parent | f3c1ad0edbbd141c7e502f958499ce3a39eebc76 (diff) | |
download | bugs-b3612adaf807df9743c8003faee62071f680f92f.tar bugs-b3612adaf807df9743c8003faee62071f680f92f.tar.gz bugs-b3612adaf807df9743c8003faee62071f680f92f.tar.bz2 bugs-b3612adaf807df9743c8003faee62071f680f92f.tar.xz bugs-b3612adaf807df9743c8003faee62071f680f92f.zip |
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
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-x | checksetup.pl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/checksetup.pl b/checksetup.pl index 5f05e7c7a..eae9e39bc 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -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}; } |