]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 621925: Avoid 'used only once' warning when loading extensions
authorByron Jones <bjones@mozilla.com>
Fri, 25 Feb 2011 04:45:57 +0000 (12:45 +0800)
committerByron Jones <bjones@mozilla.com>
Fri, 25 Feb 2011 04:45:57 +0000 (12:45 +0800)
r=mkanat, a=mkanat

Bugzilla/Install/Util.pm

index 2c651988b386608298a2ff437f680b414688dbd5..69da508fb19dad7741eac680c65f16f44f38794a 100644 (file)
@@ -221,8 +221,14 @@ sub extension_package_directory {
     my ($invocant, $file) = @_;
     my $class = ref($invocant) || $invocant;
 
+    # $file is set on the first invocation, store the value in the extension's
+    # package for retrieval on subsequent calls
     my $var;
-    { no strict 'refs'; $var = \${"${class}::EXTENSION_PACKAGE_DIR"}; }
+    {
+        no warnings 'once';
+        no strict 'refs';
+        $var = \${"${class}::EXTENSION_PACKAGE_DIR"};
+    }
     if ($file) {
         $$var = dirname($file);
     }