function _update_do_one

8.0.x _update_do_one($module, $number, &$context)
6.x _update_do_one($module, $number, &$context)
7.x _update_do_one($module, $number, &$context)
3.x _update_do_one($module, $number, &$context)
4.x _update_do_one($module, $number, &$context)
5.x _update_do_one($module, $number, &$context)

A simplified version of the batch_do_one function from update.php

This does not mess with sessions and the like, as it will be used from the command line

1 string reference to '_update_do_one'
update_main in commands/core/drupal/


commands/core/drupal/, line 434
Update.php for provisioned sites. This file is a derivative of the standard drupal update.php, which has been modified to allow being run from the command line.


function _update_do_one($module, $number, &$context) {
  // If updates for this module have been aborted
  // in a previous step, go no further.
  if (!empty($context['results'][$module]['#abort'])) {

  $function = $module . '_update_' . $number;
  drush_log("Executing $function", LogLevel::SUCCESS);

  if (function_exists($function)) {
    $ret = $function($context['sandbox']);
    $context['results'][$module] = $ret;

  if (isset($ret['#finished'])) {
    $context['finished'] = $ret['#finished'];

  if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) {
    drupal_set_installed_schema_version($module, $number);