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 { ...@@ -316,12 +316,7 @@ sub bz_setup_database {
my ($innodb_on) = @{$self->selectcol_arrayref( my ($innodb_on) = @{$self->selectcol_arrayref(
q{SHOW VARIABLES LIKE '%have_innodb%'}, {Columns=>[2]})}; q{SHOW VARIABLES LIKE '%have_innodb%'}, {Columns=>[2]})};
if ($innodb_on ne 'YES') { if ($innodb_on ne 'YES') {
die <<EOT; die install_string('mysql_innodb_disabled');
InnoDB is disabled in your MySQL installation.
Bugzilla requires InnoDB to be enabled.
Please enable it and then re-run checksetup.pl.
EOT
} }
...@@ -423,17 +418,7 @@ EOT ...@@ -423,17 +418,7 @@ EOT
# We just do the check here since this check is a reliable way # 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. # of telling that we are upgrading from a version pre-2.20.
if (grep($_ eq 'bz_schema', $self->bz_table_list_real())) { if (grep($_ eq 'bz_schema', $self->bz_table_list_real())) {
die("\nYou are upgrading from a version before 2.20, but the" die install_string('bz_schema_exists_before_220');
. " 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");
} }
my $bug_count = $self->selectrow_array("SELECT COUNT(*) FROM bugs"); my $bug_count = $self->selectrow_array("SELECT COUNT(*) FROM bugs");
...@@ -447,12 +432,8 @@ EOT ...@@ -447,12 +432,8 @@ EOT
# If we're going to take longer than 5 minutes, we let the user know # If we're going to take longer than 5 minutes, we let the user know
# and allow them to abort. # and allow them to abort.
if ($rename_time > 5) { if ($rename_time > 5) {
print "\nWe are about to rename old indexes.\n" print "\n", install_string('mysql_index_renaming',
. "The estimated time to complete renaming is " { minutes => $rename_time });
. "$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";
# Wait 45 seconds for them to respond. # Wait 45 seconds for them to respond.
sleep(45) unless Bugzilla->installation_answers->{NO_PAUSE}; sleep(45) unless Bugzilla->installation_answers->{NO_PAUSE};
} }
...@@ -685,36 +666,16 @@ EOT ...@@ -685,36 +666,16 @@ EOT
my @non_utf8_tables = grep(defined($_->{Collation}) && $_->{Collation} !~ /^utf8/, @$utf_table_status); my @non_utf8_tables = grep(defined($_->{Collation}) && $_->{Collation} !~ /^utf8/, @$utf_table_status);
if (Bugzilla->params->{'utf8'} && scalar @non_utf8_tables) { if (Bugzilla->params->{'utf8'} && scalar @non_utf8_tables) {
print <<EOT; print "\n", install_string('mysql_utf8_conversion');
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
if (!Bugzilla->installation_answers->{NO_PAUSE}) { if (!Bugzilla->installation_answers->{NO_PAUSE}) {
if (Bugzilla->installation_mode == if (Bugzilla->installation_mode ==
INSTALLATION_MODE_NON_INTERACTIVE) INSTALLATION_MODE_NON_INTERACTIVE)
{ {
print <<EOT; die install_string('continue_without_answers'), "\n";
Re-run checksetup.pl in interactive mode (without an 'answers' file)
to continue.
EOT
exit;
} }
else { else {
print " Press Enter to continue or Ctrl-C to exit..."; print "\n " . install_string('enter_or_ctrl_c');
getc; getc;
} }
} }
...@@ -1088,4 +1049,5 @@ sub _bz_build_schema_from_disk { ...@@ -1088,4 +1049,5 @@ sub _bz_build_schema_from_disk {
return $schema; return $schema;
} }
1; 1;
...@@ -191,7 +191,7 @@ sub set_cpan_config { ...@@ -191,7 +191,7 @@ sub set_cpan_config {
# If we can't make one, we finally try to use the Bugzilla directory. # If we can't make one, we finally try to use the Bugzilla directory.
if (!-w $dir) { 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"; $dir = "$bzlib/.cpan";
} }
} }
......
...@@ -1279,15 +1279,7 @@ sub _move_quips_into_db { ...@@ -1279,15 +1279,7 @@ sub _move_quips_into_db {
$dbh->do("INSERT INTO quips (quip) VALUES (?)", undef, $_); $dbh->do("INSERT INTO quips (quip) VALUES (?)", undef, $_);
} }
print <<EOT; print "\n", install_string('update_quips', { data => $datadir }), "\n";
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
$comments->close; $comments->close;
rename("$datadir/comments", "$datadir/comments.bak") rename("$datadir/comments", "$datadir/comments.bak")
|| warn "Failed to rename: $!"; || warn "Failed to rename: $!";
...@@ -1861,9 +1853,9 @@ sub _remove_spaces_and_commas_from_flagtypes { ...@@ -1861,9 +1853,9 @@ sub _remove_spaces_and_commas_from_flagtypes {
if (length($tryflagname) > 50) { if (length($tryflagname) > 50) {
my $lastchanceflagname = (substr $tryflagname, 0, 47) . '...'; my $lastchanceflagname = (substr $tryflagname, 0, 47) . '...';
if (defined($flagtypes{$lastchanceflagname})) { if (defined($flagtypes{$lastchanceflagname})) {
print " ... last attempt as \"$lastchanceflagname\" still failed.'\n", print " ... last attempt as \"$lastchanceflagname\" still failed.'\n";
"Rename the flag by hand and run checksetup.pl again.\n"; die install_string('update_flags_bad_name',
die("Bad flag type name $flagname"); { flag => $flagname }), "\n";
} }
$tryflagname = $lastchanceflagname; $tryflagname = $lastchanceflagname;
} }
...@@ -2747,12 +2739,7 @@ sub _change_short_desc_from_mediumtext_to_varchar { ...@@ -2747,12 +2739,7 @@ sub _change_short_desc_from_mediumtext_to_varchar {
FROM bugs WHERE CHAR_LENGTH(short_desc) > 255'); FROM bugs WHERE CHAR_LENGTH(short_desc) > 255');
if (@$long_summary_bugs) { if (@$long_summary_bugs) {
print <<EOT; print "\n", install_string('update_summary_truncated');
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
my $comment_sth = $dbh->prepare( my $comment_sth = $dbh->prepare(
'INSERT INTO longdescs (bug_id, who, thetext, bug_when) 'INSERT INTO longdescs (bug_id, who, thetext, bug_when)
VALUES (?, ?, ?, NOW())'); VALUES (?, ?, ?, NOW())');
...@@ -2761,10 +2748,9 @@ EOT ...@@ -2761,10 +2748,9 @@ EOT
my @affected_bugs; my @affected_bugs;
foreach my $bug (@$long_summary_bugs) { foreach my $bug (@$long_summary_bugs) {
my ($bug_id, $summary, $reporter_id) = @$bug; my ($bug_id, $summary, $reporter_id) = @$bug;
my $summary_comment = "The original summary for this bug" my $summary_comment =
. " was longer than 255 characters, and so it was truncated" install_string('update_summary_truncate_comment',
. " when Bugzilla was upgraded. The original summary was:" { summary => $summary });
. "\n\n$summary";
$comment_sth->execute($bug_id, $reporter_id, $summary_comment); $comment_sth->execute($bug_id, $reporter_id, $summary_comment);
my $short_summary = substr($summary, 0, 252) . "..."; my $short_summary = substr($summary, 0, 252) . "...";
$desc_sth->execute($short_summary, $bug_id); $desc_sth->execute($short_summary, $bug_id);
...@@ -2849,12 +2835,8 @@ sub _move_data_nomail_into_db { ...@@ -2849,12 +2835,8 @@ sub _move_data_nomail_into_db {
# If there are any nomail entries remaining, move them to nomail.bad # If there are any nomail entries remaining, move them to nomail.bad
# and say something to the user. # and say something to the user.
if (scalar(keys %nomail)) { if (scalar(keys %nomail)) {
print <<EOT; print "\n", install_string('update_nomail_bad',
{ data => $datadir }), "\n";
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
my $nomail_bad = new IO::File("$datadir/nomail.bad", '>>'); my $nomail_bad = new IO::File("$datadir/nomail.bad", '>>');
foreach my $unknown_user (keys %nomail) { foreach my $unknown_user (keys %nomail) {
print "\t$unknown_user\n"; print "\t$unknown_user\n";
...@@ -3281,9 +3263,10 @@ sub _fix_invalid_custom_field_names { ...@@ -3281,9 +3263,10 @@ sub _fix_invalid_custom_field_names {
next if $field->name =~ /^[a-zA-Z0-9_]+$/; next if $field->name =~ /^[a-zA-Z0-9_]+$/;
# The field name is illegal and can break the DB. Kill the field! # The field name is illegal and can break the DB. Kill the field!
$field->set_obsolete(1); $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(); }; eval { $field->remove_from_db(); };
print $@ ? "failed:\n$@\n" : "succeeded\n"; warn $@ if $@;
} }
} }
......
...@@ -501,16 +501,19 @@ sub _translate_feature { ...@@ -501,16 +501,19 @@ sub _translate_feature {
sub check_graphviz { sub check_graphviz {
my ($output) = @_; 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; my $return = 0;
if(-x Bugzilla->params->{'webdotbase'}) { if(-x $webdotbase) {
print "ok: found\n" if $output; print install_string('module_ok'), "\n" if $output;
$return = 1; $return = 1;
} else { } else {
print "not a valid executable: " . Bugzilla->params->{'webdotbase'} . "\n"; print install_string('bad_executable', { bin => $webdotbase }), "\n";
} }
my $webdotdir = bz_locations()->{'webdotdir'}; my $webdotdir = bz_locations()->{'webdotdir'};
...@@ -519,8 +522,8 @@ sub check_graphviz { ...@@ -519,8 +522,8 @@ sub check_graphviz {
my $htaccess = new IO::File("$webdotdir/.htaccess", 'r') my $htaccess = new IO::File("$webdotdir/.htaccess", 'r')
|| die "$webdotdir/.htaccess: " . $!; || die "$webdotdir/.htaccess: " . $!;
if (!grep(/png/, $htaccess->getlines)) { if (!grep(/png/, $htaccess->getlines)) {
print "Dependency graph images are not accessible.\n"; print STDERR install_string('webdot_bad_htaccess',
print "delete $webdotdir/.htaccess and re-run checksetup.pl to fix.\n"; { dir => $webdotdir }), "\n";
} }
$htaccess->close; $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