function package_handler_update_project

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

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


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

$release: The release details array from

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


commands/pm/package_handler/, line 136
Drush PM Git extension.


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');

  return TRUE;