aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-12-09 19:51:33 +0000
committerlpsolit%gmail.com <>2006-12-09 19:51:33 +0000
commitaccd734fd5a4ac2d242997c110c1924844219ba7 (patch)
tree2f82a2be166e2aea8bf75cc6aaa17374f0d9534a /checksetup.pl
parentDocumentation patch for bug 355302: Documentation for the "clone bug" feature... (diff)
downloadbugzilla-accd734fd5a4ac2d242997c110c1924844219ba7.tar.gz
bugzilla-accd734fd5a4ac2d242997c110c1924844219ba7.tar.bz2
bugzilla-accd734fd5a4ac2d242997c110c1924844219ba7.zip
Bug 361252: checksetup.pl should get confirmation from the user before causing dataloss in UTF8 conversion - Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit a=myk
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl38
1 files changed, 13 insertions, 25 deletions
diff --git a/checksetup.pl b/checksetup.pl
index d2313c92b..eefff4918 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -58,25 +58,6 @@ use Bugzilla::Install::Requirements;
require 5.008001 if ON_WINDOWS; # for CGI 2.93 or higher
######################################################################
-# Subroutines
-######################################################################
-
-sub read_answers_file {
- my %hash;
- if ($ARGV[0]) {
- my $s = new Safe;
- $s->rdo($ARGV[0]);
-
- die "Error reading $ARGV[0]: $!" if $!;
- die "Error evaluating $ARGV[0]: $@" if $@;
-
- # Now read the param back out from the sandbox
- %hash = %{$s->varglob('answer')};
- }
- return \%hash;
-}
-
-######################################################################
# Live Code
######################################################################
@@ -89,9 +70,8 @@ pod2usage({-verbose => 1, -exitval => 1}) if $switch{'help'};
# Read in the "answers" file if it exists, for running in
# non-interactive mode.
-our %answer = %{read_answers_file()};
-
-my $silent = scalar(keys %answer) && !$switch{'verbose'};
+my $answers_file = $ARGV[0];
+my $silent = $answers_file && !$switch{'verbose'};
display_version_and_os() unless $silent;
# Check required --MODULES--
@@ -132,6 +112,8 @@ require Bugzilla::Field;
require Bugzilla::Install;
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
+Bugzilla->installation_mode(INSTALLATION_MODE_NON_INTERACTIVE) if $answers_file;
+Bugzilla->installation_answers($answers_file);
# When we're running at the command line, we need to pick the right
# language before ever creating a template object.
@@ -142,7 +124,7 @@ $ENV{'HTTP_ACCEPT_LANGUAGE'} ||= setlocale(LC_CTYPE);
###########################################################################
print "Reading " . bz_locations()->{'localconfig'} . "...\n" unless $silent;
-update_localconfig({ output => !$silent, answer => \%answer });
+update_localconfig({ output => !$silent });
my $lc_hash = Bugzilla->localconfig;
###########################################################################
@@ -172,7 +154,7 @@ create_htaccess() if $lc_hash->{'create_htaccess'};
# Remove parameters from the params file that no longer exist in Bugzilla,
# and set the defaults for new ones
-update_params({ answer => \%answer});
+update_params();
###########################################################################
# Pre-compile --TEMPLATE-- code
@@ -229,7 +211,7 @@ Bugzilla::Install::update_settings();
###########################################################################
Bugzilla::Install::make_admin($switch{'make-admin'}) if $switch{'make-admin'};
-Bugzilla::Install::create_admin({ answer => \%answer });
+Bugzilla::Install::create_admin();
###########################################################################
# Create default Product and Classification
@@ -471,6 +453,12 @@ The format of that file is as follows:
$answer{'SMTP_SERVER'} = 'mail.mydomain.net';
+ $answer{'NO_PAUSE'} = 1
+
+C<NO_PAUSE> means "never stop and prompt the user to hit Enter to continue,
+just go ahead and do things, even if they are potentially dangerous."
+Don't set this to 1 unless you know what you are doing.
+
=head1 SEE ALSO
=over