MDL-31832 CLI upgrade checks if the upgrade is actually needed

This commit is contained in:
David Mudrak 2012-03-01 01:56:53 +01:00 committed by Eloy Lafuente (stronk7)
parent a1ef8c6d3c
commit 91c038f932
2 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,10 @@ if ($version < $CFG->version) {
$oldversion = "$CFG->release ($CFG->version)";
$newversion = "$release ($version)";
if (!moodle_needs_upgrading()) {
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 63);
}
// Test environment first.
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {

View File

@ -106,6 +106,7 @@ $string['cliunknowoption'] = 'Unrecognised options:
{$a}
Please use --help option.';
$string['cliupgradefinished'] = 'Command line upgrade completed successfully.';
$string['cliupgradenoneed'] = 'No upgrade needed for the installed version {$a}. Thanks for coming anyway!';
$string['cliyesnoprompt'] = 'type y (means yes) or n (means no)';
$string['commentsperpage'] = 'Comments displayed per page';
$string['commonfiltersettings'] = 'Common filter settings';