]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 226673: Eliminate some warnings in checksetup.pl for "blah::Version used only...
authorjustdave%syndicomm.com <>
Sun, 7 Dec 2003 09:47:18 +0000 (09:47 +0000)
committerjustdave%syndicomm.com <>
Sun, 7 Dec 2003 09:47:18 +0000 (09:47 +0000)
r=bbaetz, a=justdave

Bugzilla/RelationSet.pm
RelationSet.pm
checksetup.pl

index a3af4b60a94b538b0944e0c938d2ab306e7c5f3b..f2f822fc4a20759125518d1b76b02c5229939f96 100644 (file)
@@ -38,7 +38,6 @@ use strict;
 #require "globals.pl";
 
 package RelationSet;
-use CGI::Carp qw(fatalsToBrowser);
 
 # create a new empty RelationSet
 #
index a3af4b60a94b538b0944e0c938d2ab306e7c5f3b..f2f822fc4a20759125518d1b76b02c5229939f96 100644 (file)
@@ -38,7 +38,6 @@ use strict;
 #require "globals.pl";
 
 package RelationSet;
-use CGI::Carp qw(fatalsToBrowser);
 
 # create a new empty RelationSet
 #
index 5f05e7c7a609701ece7a8853f209cd413fdaf7f6..eae9e39bc4b1ca970192a18155f9f3a9aac7ab92 100755 (executable)
@@ -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};
     }