summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-01 07:15:55 +0200
committermkanat%bugzilla.org <>2006-08-01 07:15:55 +0200
commit18c57070565d1218935168b437f4adcfe9b38ce4 (patch)
treecd5b3166102f888321e5a8823c9ad80fb5bd5000 /checksetup.pl
parentec147c3f721ff20d6fa61fea42627b9acb7b0ea3 (diff)
downloadbugzilla-18c57070565d1218935168b437f4adcfe9b38ce4.tar.gz
bugzilla-18c57070565d1218935168b437f4adcfe9b38ce4.tar.xz
Bug 346483: Fix up param-updating code in checksetup.pl to all be in a module.
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=myk
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl73
1 files changed, 16 insertions, 57 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 485173fb2..00230e5c5 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -187,7 +187,9 @@ The format of that file is as follows:
$answer{'db_user'} = 'mydbuser';
$answer{'db_pass'} = 'mydbpass';
- (Any localconfig variable can be specified as above.)
+ $answer{'urlbase'} = 'http://bugzilla.mydomain.com/';
+
+ (Any localconfig variable or parameter can be specified as above.)
$answer{'ADMIN_OK'} = 'Y';
$answer{'ADMIN_EMAIL'} = 'myadmin@mydomain.net';
@@ -203,6 +205,14 @@ function calls needs to be specified in this file.
L<Bugzilla::Install::Requirements>
+L<Bugzilla::Install::Localconfig>
+
+L<Bugzilla::Install::Filesystem>
+
+L<Bugzilla::Config/update_params>
+
+L<Bugzilla::DB/CONNECTION>
+
=cut
######################################################################
@@ -222,9 +232,7 @@ use lib ".";
use Bugzilla::Constants;
use Bugzilla::Install::Requirements;
-if ($^O =~ /MSWin32/i) {
- require 5.008001; # for CGI 2.93 or higher
-}
+require 5.008001 if ON_WINDOWS; # for CGI 2.93 or higher
######################################################################
# Subroutines
@@ -356,62 +364,13 @@ create_htaccess() if $lc_hash->{'create_htaccess'};
my $datadir = bz_locations()->{'datadir'};
my $webdotdir = bz_locations()->{'webdotdir'};
-# Check for a new install
-my $newinstall = !-e "$datadir/params";
-
# Remove parameters from the params file that no longer exist in Bugzilla,
# and set the defaults for new ones
+update_params({ answer => \%answer});
-my @oldparams = UpdateParams();
-
-if (@oldparams) {
- open(PARAMFILE, '>>', 'old-params.txt')
- || die "$0: Can't open old-params.txt for writing: $!\n";
-
- print "The following parameters are no longer used in Bugzilla, " .
- "and so have been\nmoved from your parameters file " .
- "into old-params.txt:\n";
-
- foreach my $p (@oldparams) {
- my ($item, $value) = @{$p};
-
- print PARAMFILE "\n\n$item:\n$value\n";
-
- print $item;
- print ", " unless $item eq $oldparams[$#oldparams]->[0];
- }
- print "\n";
- close PARAMFILE;
-}
-
-# Set mail_delivery_method to SMTP and prompt for SMTP server
-# if running on Windows and no third party sendmail wrapper
-# is available
-if ($^O =~ /MSWin32/i
- && Bugzilla->params->{'mail_delivery_method'} eq 'sendmail'
- && !-e SENDMAIL_EXE)
-{
- print "\nBugzilla requires an SMTP server to function on Windows.\n" .
- "Please enter your SMTP server's hostname: ";
- my $smtp = $answer{'SMTP_SERVER'}
- || ($silent && die("cant preload SMTP_SERVER"))
- || <STDIN>;
- chomp $smtp;
- if (!$smtp) {
- print "\nWarning: No SMTP Server provided, defaulting to localhost\n";
- $smtp = 'localhost';
- }
- SetParam('mail_delivery_method', 'smtp');
- SetParam('smtpserver', $smtp);
-}
-
-# Enable UTF-8 on new installs
-if ($newinstall) {
- SetParam('utf8', 1);
-}
-
-# WriteParams will only write out still-valid entries
-WriteParams();
+###########################################################################
+# Pre-compile --TEMPLATE-- code
+###########################################################################
my $templatedir = bz_locations()->{'templatedir'};
unless ($switch{'no-templates'}) {