function package_handler_update_project

8.0.x wget.inc package_handler_update_project(&$request, $release)
8.0.x git_drupalorg.inc package_handler_update_project($request, $release)
6.x wget.inc package_handler_update_project(&$request, $release)
6.x git_drupalorg.inc package_handler_update_project($request, $release)
7.x wget.inc package_handler_update_project(&$request, $release)
7.x git_drupalorg.inc package_handler_update_project($request, $release)
3.x wget.inc package_handler_update_project(&$project, $release)
3.x cvs.inc package_handler_update_project($project, $release)
4.x wget.inc package_handler_update_project(&$request, $release)
4.x git_drupalorg.inc package_handler_update_project($request, $release)
4.x cvs.inc package_handler_update_project(&$project, $release)
5.x wget.inc package_handler_update_project(&$request, $release)
5.x git_drupalorg.inc package_handler_update_project($request, $release)
master wget.inc package_handler_update_project(&$request, $release)
master git_drupalorg.inc package_handler_update_project($request, $release)

Update a project (so far, only modules are supported).

Parameters

$request: The project array with name, base and full (final) paths.

$release: The release details array from drupal.org.

1 call to package_handler_update_project()
pm_update_project in commands/pm/updatecode.pm.inc
Update one project -- a module, theme or Drupal core.

File

commands/pm/package_handler/git_drupalorg.inc, line 147
Drush PM drupal.org Git extension.

Code

function package_handler_update_project($request, $release) {
  drush_log('Updating project ' . $request['name'] . ' ...');

  $commands = array();
  if ($release['version_extra'] == 'dev') {
    // Update the branch of the development repository.
    $commands[] = 'git pull';
    $commands[] = drush_get_option('gitpullparams');
  }
  else {
    // Use a stable repository.
    $commands[] = 'git fetch';
    $commands[] = drush_get_option('gitfetchparams');
    $commands[] = ';';
    $commands[] = 'git checkout';
    $commands[] = drush_get_option('gitcheckoutparams');
    $commands[] = $release['version'];
  }

  if (!drush_shell_cd_and_exec($request['full_project_path'], implode(' ', $commands))) {
    return drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', 'Unable to update ' . $request['name'] . ' from git.drupal.org.');
  }

  return TRUE;
}