Skip to content

Commit

Permalink
Fix for issue #25.
Browse files Browse the repository at this point in the history
- Adds an 'ignore' option to `release_info_fetch` that is used by drush
  make when only project type is needed from release info.
  • Loading branch information
jhedstrom committed Dec 14, 2013
1 parent bd805cf commit 4af3f54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion commands/make/make.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function make_projects($recursion, $contrib_destination, $info, $build_path, $ma
if (!drush_get_option('no-cache', FALSE)) {
drush_set_option('cache', TRUE);
}
$release = release_info_fetch($request);
$release = release_info_fetch($request, '', 'ignore');
if ($release === FALSE) {
return FALSE;
}
Expand Down
9 changes: 7 additions & 2 deletions commands/pm/release_info/updatexml.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define('RELEASE_INFO_DEFAULT_URL', 'http://updates.drupal.org/release-history');
* to choose.
* - always: Force the user to choose a release.
* - never: Try to select the latest release, if none found then fail.
* - ignore: Ignore and return NULL.
* If no supported release is found, allow to ask the user to choose one.
* @param Boolean $all
* In case $select = TRUE this indicates that all available releases will be
Expand All @@ -37,8 +38,8 @@ define('RELEASE_INFO_DEFAULT_URL', 'http://updates.drupal.org/release-history');
* The selected release xml object.
*/
function release_info_fetch(&$request, $restrict_to = '', $select = 'never', $all = FALSE) {
if (!in_array($select, array('auto', 'never', 'always'))) {
return drush_set_error('DRUSH_PM_UNKNOWN_SELECT_STRATEGY', dt("Error: select strategy must be one of: auto, never, always", array()));
if (!in_array($select, array('auto', 'never', 'always', 'ignore'))) {
return drush_set_error('DRUSH_PM_UNKNOWN_SELECT_STRATEGY', dt("Error: select strategy must be one of: auto, never, always, ignore", array()));
}

$xml = updatexml_get_release_history_xml($request);
Expand Down Expand Up @@ -70,9 +71,13 @@ function release_info_fetch(&$request, $restrict_to = '', $select = 'never', $al
}
else {
if ($select == 'never') {
drush_log(dt('There are no stable releases for project !project.', array('!project' => $request['name'])), 'error');
return drush_user_abort();
}
drush_log(dt('There are no stable releases for project !project.', array('!project' => $request['name'])), 'warning');
if ($select == 'ignore') {
return;
}
}
}

Expand Down

0 comments on commit 4af3f54

Please sign in to comment.