function drush_upgrade_download_drupal

4.x drush_upgrade_download_drupal($target_version, $destination_core)

Download the upgraded version of Drupal for site-upgrade.

1 call to drush_upgrade_download_drupal()
drush_upgrade_site_upgrade in commands/core/
Main command hook for site-upgrade.


commands/core/, line 566
Refine your Drupal major version upgrade.


function drush_upgrade_download_drupal($target_version, $destination_core) {
  // Fetch target core and place as per target alias root.
  drush_set_option('destination', dirname($destination_core));
  drush_set_option('drupal-project-rename', basename($destination_core));

  // No need for version control in this command.
  drush_set_option('version-control', 'backup');

  if (drush_get_context('DRUSH_SIMULATE')) {
    drush_log(dt("Simulated download of drupal-!version", array('!version' => $target_version)));
  else {
    drush_pm_download('drupal-' . $target_version);
    if (drush_get_error()) {
      return FALSE; // Early exit if we see an error.

    // Check and see if there is a Drupal site at the target.
    if (!file_exists($destination_core . '/includes/')) {
      return drush_set_error('DRUSH_UPGRADE_NO_DRUPAL', dt('Drupal could not be downloaded to the target directory, @root.  Move existing content out of the way first.', array('@root' => $target_alias['root'])));