function drush_upgrade_site_upgrade_modules

4.x upgrade.drush.inc drush_upgrade_site_upgrade_modules()

Upgrade all of the contrib modules of the site being upgraded.

This runs bootstrapped to the TARGET site, after the new version of Drupal has been downloaded, and after updatedb has been run for Drupal core.

File

commands/core/upgrade.drush.inc, line 529
Refine your Drupal major version upgrade.

Code

function drush_upgrade_site_upgrade_modules() {
  $extensions_to_enable = func_get_args();
  $project_download_list = drush_get_option('projects', '');

  if (!empty($project_download_list)) {
    // Download our contrib extensions.
    drush_log(dt('Download projects: !projects', array('!projects' => $project_download_list)), 'ok');
    drush_set_option('destination', NULL);
    // User has already been prompted; if there is no recommended release,
    // we will just take the most recent.
    drush_set_option('choice', '1');
    call_user_func_array('drush_pm_download', explode(',', $project_download_list));
  }

  // Run updatedb to update all of the contrib extensions.
  drush_log(dt('About to perform updatedb for extensions'), 'ok');
  $result = drush_invoke_process_args('updatedb', array(), array('yes' => TRUE, '#interactive' => TRUE));
  if ($result === FALSE) {
    return drush_set_error('DRUSH_DRUPAL_CONTRIB_UPGRADE_FAILED', dt("The call to updatedb failed for the enabled contrib modules.  Try running site-upgrade again with '--uninstall={module list}' to remove all contrib extensions prior to upgrade.  Add modules back in until the problematic one is isolated.  Please report problems in the issue queue of the module that is causing problems."));
  }
  drush_log(dt('updatedb complete for extensions'), 'ok');

  // Finally, enable the modules that site-upgrade previously disabled.
  // We will set the option --resolve-dependencies to pick up new modules
  // that may now be required; for example, views-7.x picked up a dependency
  // on ctools that views-6.x did not have.  We also set DRUSH_AFFIRMATIVE,
  // so everything from here on out will be processed with --yes.
  drush_set_option('resolve-dependencies', TRUE);
  drush_set_context('DRUSH_AFFIRMATIVE', TRUE);
  $result = drush_invoke_args('pm-enable', $extensions_to_enable);

  return $result;
}