Commit 6715b4db authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 586210: Make every important string printed by checksetup.pl localizable,

including the localconfig parameter descriptions r=mkanat, a=mkanat (module owner)
parent aec17c9f
......@@ -316,12 +316,7 @@ sub bz_setup_database {
my ($innodb_on) = @{$self->selectcol_arrayref(
q{SHOW VARIABLES LIKE '%have_innodb%'}, {Columns=>[2]})};
if ($innodb_on ne 'YES') {
die <<EOT;
InnoDB is disabled in your MySQL installation.
Bugzilla requires InnoDB to be enabled.
Please enable it and then re-run checksetup.pl.
EOT
die install_string('mysql_innodb_disabled');
}
......@@ -423,17 +418,7 @@ EOT
# We just do the check here since this check is a reliable way
# of telling that we are upgrading from a version pre-2.20.
if (grep($_ eq 'bz_schema', $self->bz_table_list_real())) {
die("\nYou are upgrading from a version before 2.20, but the"
. " bz_schema\ntable already exists. This means that you"
. " restored a mysqldump into\nthe Bugzilla database without"
. " first dropping the already-existing\nBugzilla database,"
. " at some point. Whenever you restore a Bugzilla\ndatabase"
. " backup, you must always drop the entire database first.\n\n"
. "Please drop your Bugzilla database and restore it from a"
. " backup that\ndoes not contain the bz_schema table. If for"
. " some reason you cannot\ndo this, you can connect to your"
. " MySQL database and drop the bz_schema\ntable, as a last"
. " resort.\n");
die install_string('bz_schema_exists_before_220');
}
my $bug_count = $self->selectrow_array("SELECT COUNT(*) FROM bugs");
......@@ -447,12 +432,8 @@ EOT
# If we're going to take longer than 5 minutes, we let the user know
# and allow them to abort.
if ($rename_time > 5) {
print "\nWe are about to rename old indexes.\n"
. "The estimated time to complete renaming is "
. "$rename_time minutes.\n"
. "You cannot interrupt this action once it has begun.\n"
. "If you would like to cancel, press Ctrl-C now..."
. " (Waiting 45 seconds...)\n\n";
print "\n", install_string('mysql_index_renaming',
{ minutes => $rename_time });
# Wait 45 seconds for them to respond.
sleep(45) unless Bugzilla->installation_answers->{NO_PAUSE};
}
......@@ -685,36 +666,16 @@ EOT
my @non_utf8_tables = grep(defined($_->{Collation}) && $_->{Collation} !~ /^utf8/, @$utf_table_status);
if (Bugzilla->params->{'utf8'} && scalar @non_utf8_tables) {
print <<EOT;
WARNING: We are about to convert your table storage format to UTF8. This
allows Bugzilla to correctly store and sort international characters.
However, if you have any non-UTF-8 data in your database,
it ***WILL BE DELETED*** by this process. So, before
you continue with checksetup.pl, if you have any non-UTF-8
data (or even if you're not sure) you should press Ctrl-C now
to interrupt checksetup.pl, and run contrib/recode.pl to make all
the data in your database into UTF-8. You should also back up your
database before continuing. This will affect every single table
in the database, even non-Bugzilla tables.
If you ever used a version of Bugzilla before 2.22, we STRONGLY
recommend that you stop checksetup.pl NOW and run contrib/recode.pl.
EOT
print "\n", install_string('mysql_utf8_conversion');
if (!Bugzilla->installation_answers->{NO_PAUSE}) {
if (Bugzilla->installation_mode ==
INSTALLATION_MODE_NON_INTERACTIVE)
{
print <<EOT;
Re-run checksetup.pl in interactive mode (without an 'answers' file)
to continue.
EOT
exit;
die install_string('continue_without_answers'), "\n";
}
else {
print " Press Enter to continue or Ctrl-C to exit...";
print "\n " . install_string('enter_or_ctrl_c');
getc;
}
}
......@@ -1088,4 +1049,5 @@ sub _bz_build_schema_from_disk {
return $schema;
}
1;
......@@ -191,7 +191,7 @@ sub set_cpan_config {
# If we can't make one, we finally try to use the Bugzilla directory.
if (!-w $dir) {
print "WARNING: Using the Bugzilla directory as the CPAN home.\n";
print STDERR install_string('cpan_bugzilla_home'), "\n";
$dir = "$bzlib/.cpan";
}
}
......
......@@ -1279,15 +1279,7 @@ sub _move_quips_into_db {
$dbh->do("INSERT INTO quips (quip) VALUES (?)", undef, $_);
}
print <<EOT;
Quips are now stored in the database, rather than in an external file.
The quips previously stored in $datadir/comments have been copied into
the database, and that file has been renamed to $datadir/comments.bak
You may delete the renamed file once you have confirmed that all your
quips were moved successfully.
EOT
print "\n", install_string('update_quips', { data => $datadir }), "\n";
$comments->close;
rename("$datadir/comments", "$datadir/comments.bak")
|| warn "Failed to rename: $!";
......@@ -1861,9 +1853,9 @@ sub _remove_spaces_and_commas_from_flagtypes {
if (length($tryflagname) > 50) {
my $lastchanceflagname = (substr $tryflagname, 0, 47) . '...';
if (defined($flagtypes{$lastchanceflagname})) {
print " ... last attempt as \"$lastchanceflagname\" still failed.'\n",
"Rename the flag by hand and run checksetup.pl again.\n";
die("Bad flag type name $flagname");
print " ... last attempt as \"$lastchanceflagname\" still failed.'\n";
die install_string('update_flags_bad_name',
{ flag => $flagname }), "\n";
}
$tryflagname = $lastchanceflagname;
}
......@@ -2747,12 +2739,7 @@ sub _change_short_desc_from_mediumtext_to_varchar {
FROM bugs WHERE CHAR_LENGTH(short_desc) > 255');
if (@$long_summary_bugs) {
print <<EOT;
WARNING: Some of your bugs had summaries longer than 255 characters.
They have had their original summary copied into a comment, and then
the summary was truncated to 255 characters. The affected bug numbers were:
EOT
print "\n", install_string('update_summary_truncated');
my $comment_sth = $dbh->prepare(
'INSERT INTO longdescs (bug_id, who, thetext, bug_when)
VALUES (?, ?, ?, NOW())');
......@@ -2761,10 +2748,9 @@ EOT
my @affected_bugs;
foreach my $bug (@$long_summary_bugs) {
my ($bug_id, $summary, $reporter_id) = @$bug;
my $summary_comment = "The original summary for this bug"
. " was longer than 255 characters, and so it was truncated"
. " when Bugzilla was upgraded. The original summary was:"
. "\n\n$summary";
my $summary_comment =
install_string('update_summary_truncate_comment',
{ summary => $summary });
$comment_sth->execute($bug_id, $reporter_id, $summary_comment);
my $short_summary = substr($summary, 0, 252) . "...";
$desc_sth->execute($short_summary, $bug_id);
......@@ -2849,12 +2835,8 @@ sub _move_data_nomail_into_db {
# If there are any nomail entries remaining, move them to nomail.bad
# and say something to the user.
if (scalar(keys %nomail)) {
print <<EOT;
WARNING: The following users were listed in data/nomail, but do not
have an account here. The unmatched entries have been moved
to $datadir/nomail.bad:
EOT
print "\n", install_string('update_nomail_bad',
{ data => $datadir }), "\n";
my $nomail_bad = new IO::File("$datadir/nomail.bad", '>>');
foreach my $unknown_user (keys %nomail) {
print "\t$unknown_user\n";
......@@ -3281,9 +3263,10 @@ sub _fix_invalid_custom_field_names {
next if $field->name =~ /^[a-zA-Z0-9_]+$/;
# The field name is illegal and can break the DB. Kill the field!
$field->set_obsolete(1);
print "Removing custom field '" . $field->name . "' (illegal name)... ";
print install_string('update_cf_invalid_name',
{ field => $field->name }), "\n";
eval { $field->remove_from_db(); };
print $@ ? "failed:\n$@\n" : "succeeded\n";
warn $@ if $@;
}
}
......
......@@ -501,16 +501,19 @@ sub _translate_feature {
sub check_graphviz {
my ($output) = @_;
return 1 if (Bugzilla->params->{'webdotbase'} =~ /^https?:/);
my $webdotbase = Bugzilla->params->{'webdotbase'};
return 1 if $webdotbase =~ /^https?:/;
printf("Checking for %15s %-9s ", "GraphViz", "(any)") if $output;
my $checking_for = install_string('checking_for');
my $any = install_string('any');
printf("%s %15s %-9s ", $checking_for, "GraphViz", "($any)") if $output;
my $return = 0;
if(-x Bugzilla->params->{'webdotbase'}) {
print "ok: found\n" if $output;
if(-x $webdotbase) {
print install_string('module_ok'), "\n" if $output;
$return = 1;
} else {
print "not a valid executable: " . Bugzilla->params->{'webdotbase'} . "\n";
print install_string('bad_executable', { bin => $webdotbase }), "\n";
}
my $webdotdir = bz_locations()->{'webdotdir'};
......@@ -519,8 +522,8 @@ sub check_graphviz {
my $htaccess = new IO::File("$webdotdir/.htaccess", 'r')
|| die "$webdotdir/.htaccess: " . $!;
if (!grep(/png/, $htaccess->getlines)) {
print "Dependency graph images are not accessible.\n";
print "delete $webdotdir/.htaccess and re-run checksetup.pl to fix.\n";
print STDERR install_string('webdot_bad_htaccess',
{ dir => $webdotdir }), "\n";
}
$htaccess->close;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment