function drush_pm_update

8.0.x pm.drush.inc drush_pm_update()
6.x pm.drush.inc drush_pm_update()
7.x pm.drush.inc drush_pm_update()
3.x pm.drush.inc drush_pm_update()
4.x pm.drush.inc drush_pm_update()
5.x pm.drush.inc drush_pm_update()
master pm.drush.inc drush_pm_update()

Command callback. Execute updatecode.

File

commands/pm/pm.drush.inc, line 904
The drush Package Manager

Code

function drush_pm_update() {
  // Signal that we will update drush core after the drush modules
  // are updated, if an update to core is available.
  drush_set_context('DRUSH_PM_UPDATE_ALL', TRUE);

  // Call pm-updatecode.  updatedb will be called in the post-update process.
  $args = func_get_args();
  array_unshift($args, 'pm-updatecode');
  call_user_func_array('drush_invoke', $args);

  // pm-updatecode will not do a core update of Drupal
  // on the same invocation where non-core modules are
  // updated.  If there is a core update available, then
  // call pm-updatecode a second time to update core
  // (but only if the first run finished successfully).
  if (drush_get_context('DRUSH_PM_CORE_UPDATE_AVAILABLE', FALSE) && (drush_get_error() == DRUSH_SUCCESS)) {
    call_user_func_array('drush_invoke', array('pm-updatecode', 'drupal'));
  }
}