diff options
Diffstat (limited to 'Bugzilla/Install/Util.pm')
-rw-r--r-- | Bugzilla/Install/Util.pm | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index 231ef8efc..5f6c8bceb 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -1,9 +1,22 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# -*- Mode: perl; indent-tabs-mode: nil -*- # -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is the Bugzilla Bug Tracking System. +# +# The Initial Developer of the Original Code is Everything Solved. +# Portions created by Everything Solved are Copyright (C) 2006 +# Everything Solved. All Rights Reserved. +# +# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org> package Bugzilla::Install::Util; @@ -11,16 +24,16 @@ package Bugzilla::Install::Util; # module may require *only* Bugzilla::Constants and built-in # perl modules. -use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Encode; +use ExtUtils::MM (); use File::Basename; use File::Spec; use POSIX qw(setlocale LC_CTYPE); +use Safe; use Scalar::Util qw(tainted); use Term::ANSIColor qw(colored); use PerlIO; @@ -34,20 +47,17 @@ our @EXPORT_OK = qw( extension_requirement_packages extension_template_directory extension_web_directory - i_am_persistent indicate_progress install_string include_languages success template_include_path + vers_cmp init_console ); sub bin_loc { my ($bin, $path) = @_; - # This module is not needed most of the time and is a bit slow, - # so we only load it when calling bin_loc(). - require ExtUtils::MM; # If the binary is a full path... if ($bin =~ m{[/\\]}) { @@ -265,15 +275,6 @@ sub indicate_progress { } } -sub feature_description { - my ($feature_name) = @_; - eval { - my $meta = _cache()->{cpan_meta} //= Bugzilla::Install::Requirements::load_cpan_meta(); - - return $meta->feature($feature_name)->description - } or warn $@; -} - sub install_string { my ($string_id, $vars) = @_; _cache()->{install_string_path} ||= template_include_path(); @@ -542,20 +543,11 @@ sub no_checksetup_from_cgi { # Used by install_string sub _get_string_from_file { my ($string_id, $file) = @_; - # If we already loaded the file, then use its copy from the cache. - if (my $strings = _cache()->{strings_from_file}->{$file}) { - return $strings->{$string_id}; - } - - # This module is only needed by checksetup.pl, - # so only load it when needed. - require Safe; - + return undef if !-e $file; my $safe = new Safe; $safe->rdo($file); my %strings = %{$safe->varglob('strings')}; - _cache()->{strings_from_file}->{$file} = \%strings; return $strings{$string_id}; } |