From 235df97e971f15f4d1d41c8b7d83d4374b41fd4a Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Sat, 4 Sep 2010 01:31:48 +0000 Subject: [PATCH] Bug 559549: Make checksetup.pl print out a "checksetup.pl complete" message when it finishes. r=mkanat, a=mkanat (module owner) git-svn-id: svn://10.0.0.236/trunk@261180 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Constants.pm | 2 ++ mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm | 6 ++++++ mozilla/webtools/bugzilla/checksetup.pl | 11 +++++++++-- .../template/en/default/global/messages.html.tmpl | 3 +++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 56ecd7e5c0b..846686de6f7 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7461 \ No newline at end of file +7462 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm index 72f4d4512ce..06bdaade052 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm @@ -149,6 +149,7 @@ use Memoize; ERROR_MODE_TEST COLOR_ERROR + COLOR_SUCCESS INSTALLATION_MODE_INTERACTIVE INSTALLATION_MODE_NON_INTERACTIVE @@ -470,6 +471,7 @@ use constant ERROR_MODE_TEST => 4; # The ANSI colors of messages that command-line scripts use use constant COLOR_ERROR => 'red'; +use constant COLOR_SUCCESS => 'green'; # The various modes that checksetup.pl can run in. use constant INSTALLATION_MODE_INTERACTIVE => 0; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm index 41f608abfe6..d65d2f5921f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm @@ -47,6 +47,7 @@ our @EXPORT_OK = qw( indicate_progress install_string include_languages + success template_include_path vers_cmp init_console @@ -627,6 +628,11 @@ sub _console_die { die colored("$message", COLOR_ERROR) . "\n"; } +sub success { + my ($message) = @_; + print colored($message, COLOR_SUCCESS), "\n"; +} + sub prevent_windows_dialog_boxes { # This code comes from http://bugs.activestate.com/show_bug.cgi?id=82183 # and prevents Perl modules from popping up dialog boxes, particularly diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index 0e89447fe36..b6b4fc19c97 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -53,7 +53,8 @@ BEGIN { chdir dirname($0); } use lib qw(. lib); use Bugzilla::Constants; use Bugzilla::Install::Requirements; -use Bugzilla::Install::Util qw(install_string get_version_and_os init_console); +use Bugzilla::Install::Util qw(install_string get_version_and_os + init_console success); ###################################################################### # Live Code @@ -98,6 +99,9 @@ exit if $switch{'check-modules'}; require Bugzilla; require Bugzilla::User; +require Bugzilla::Util; +import Bugzilla::Util qw(get_text); + require Bugzilla::Config; import Bugzilla::Config qw(:admin); @@ -232,9 +236,12 @@ Bugzilla::Hook::process('install_before_final_checks', { silent => $silent }); # Check if the default parameter for urlbase is still set, and if so, give # notification that they should go and visit editparams.cgi if (Bugzilla->params->{'urlbase'} eq '') { - print "\n" . Bugzilla::Install::get_text('install_urlbase_default') . "\n" + print "\n" . get_text('install_urlbase_default') . "\n" unless $silent; } +if (!$silent) { + success(get_text('install_success')); +} __END__ diff --git a/mozilla/webtools/bugzilla/template/en/default/global/messages.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/messages.html.tmpl index 8747c56bf43..5ffec408124 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/messages.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/global/messages.html.tmpl @@ -683,6 +683,9 @@ [% ELSIF message_tag == "install_setting_setup" %] Setting up user preferences... + [% ELSIF message_tag == "install_success" %] + checksetup.pl complete. + [% ELSIF message_tag == "install_table_drop" %] Dropping the '[% name FILTER html %]' table...