summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-02-25 05:42:17 +0100
committerByron Jones <bjones@mozilla.com>2011-02-25 05:42:17 +0100
commitc1dcf3b12df00659121bcfb7718297f2a578661f (patch)
treebadf59281068e96a27fd9b582098803f7e70da97 /Bugzilla/Install
parent90062dd4e7d12189ee75bce626aaf4c6d9e3723d (diff)
downloadbugzilla-c1dcf3b12df00659121bcfb7718297f2a578661f.tar.gz
bugzilla-c1dcf3b12df00659121bcfb7718297f2a578661f.tar.xz
Bug 621925: Avoid 'used only once' warning when loading extensions
r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/Util.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm
index ef71f5b75..c8d3d8eb4 100644
--- a/Bugzilla/Install/Util.pm
+++ b/Bugzilla/Install/Util.pm
@@ -222,8 +222,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);
}