X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fcommands%2Fmake%2Fupdate.make.inc;fp=vendor%2Fdrush%2Fdrush%2Fcommands%2Fmake%2Fupdate.make.inc;h=8dba72eb0ef4c6eec06f16b237ef603eec2e125a;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drush/drush/commands/make/update.make.inc b/vendor/drush/drush/commands/make/update.make.inc new file mode 100644 index 000000000..8dba72eb0 --- /dev/null +++ b/vendor/drush/drush/commands/make/update.make.inc @@ -0,0 +1,72 @@ + $project) { + if (($project['download']['type'] == 'git') && !empty($project['download']['url'])) { + // TODO check that tag or branch are valid version strings (with pm_parse_version()). + if (!empty($project['download']['tag'])) { + $version = $project['download']['tag']; + } + elseif (!empty($project['download']['branch'])) { + $version = $project['download']['branch'] . '-dev'; + } + /* + elseif (!empty($project['download']['refspec'])) { + #TODO# Parse refspec. + } + */ + else { + // If no tag or branch, we can't match a d.o version. + continue; + } + $projects[$project_name] = $project + array( + 'path' => '', + 'label' => $project_name, + 'version' => $version, + ); + } + elseif ($project['download']['type'] == 'pm') { + $projects[$project_name] = $project + array( + 'path' => '', + 'label' => $project_name, + ); + } + } + + // Check for updates. + $update_status = drush_get_engine('update_status'); + $update_info = $update_status->getStatus($projects, TRUE); + + $security_only = drush_get_option('security-only', FALSE); + foreach ($update_info as $project_name => $project_update_info) { + if (!$security_only || ($security_only && $project_update_info['status'] == DRUSH_UPDATESTATUS_NOT_SECURE)) { + $make_projects[$project_name]['download']['full_version'] = $project_update_info['recommended']; + } + } + + // Inject back make projects and generate the updated makefile. + drush_set_option('DRUSH_MAKE_PROJECTS', $make_projects); + make_generate_from_makefile(drush_get_option('result-file'), $makefile); +} +