Index: cvs_deploy.module =================================================================== RCS file: /Users/wright/drupal/local_repo/contributions/modules/cvs_deploy/cvs_deploy.module,v retrieving revision 1.27 diff -u -p -r1.27 cvs_deploy.module --- cvs_deploy.module 26 Sep 2009 07:00:19 -0000 1.27 +++ cvs_deploy.module 11 Oct 2009 17:08:10 -0000 @@ -188,3 +188,33 @@ function _cvs_deploy_find_latest_update( } return $timestamp; } + +/** + * Implement hook_update_status_alter(). + * + * If we're viewing the available updates report, and any of the projects on + * the page still think their version is just 'HEAD', but the project has + * release data for a release node using 'HEAD' as the tag, we're in the edge + * case of viewing the report when there was initially no available update + * data. In that case, when hook_system_info_alter() was first invoked, we + * didn't have any cached data, and we therefore couldn't convert the version + * from HEAD into something else. So, Update status is going to think this + * version is not supported, since it doesn't know what version you're + * actually running and couldn't find any release information that matched + * what you've got. So, if we hit a case like this, redirect to the available + * updates report so that there are no bogus results displayed. + */ +function cvs_deploy_update_status_alter($projects) { + if ($_GET['q'] == 'admin/reports/updates') { + foreach ($projects as $key => $project) { + if (isset($project['existing_version']) && $project['existing_version'] == 'HEAD' && !empty($project['releases'])) { + foreach ($project['releases'] as $version => $release) { + if ($release['tag'] == 'HEAD') { + return drupal_goto('admin/reports/updates'); + } + } + } + } + } +} +