cvs diff: Diffing modules/update Index: modules/update/update.compare.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.compare.inc,v retrieving revision 1.27 diff -u -p -r1.27 update.compare.inc --- modules/update/update.compare.inc 17 Aug 2009 19:14:41 -0000 1.27 +++ modules/update/update.compare.inc 21 Aug 2009 08:53:35 -0000 @@ -36,8 +36,14 @@ function update_get_projects() { $projects = update_project_cache('update_project_projects'); if (empty($projects)) { // Still empty, so we have to rebuild the cache. - _update_process_info_list($projects, system_get_module_data(), 'module'); - _update_process_info_list($projects, system_get_theme_data(), 'theme'); + $module_data = system_get_module_data(); + $theme_data = system_get_theme_data(); + _update_process_info_list($projects, $module_data, 'module'); + _update_process_info_list($projects, $theme_data, 'theme'); + if (variable_get('update_check_disabled', FALSE)) { + _update_process_info_list($projects, $module_data, 'disabled-module'); + _update_process_info_list($projects, $theme_data, 'disabled-theme'); + } // Allow other modules to alter projects before fetching and comparing. drupal_alter('update_projects', $projects); // Cache the site's project data for at most 1 hour. @@ -51,9 +57,10 @@ function update_get_projects() { * Populate an array of project data. */ function _update_process_info_list(&$projects, $list, $project_type) { + // Based on the project_type, select the project status we should consider. + $project_status = strpos($project_type, 'disabled') === FALSE ? 1 : 0; foreach ($list as $file) { - if (empty($file->status)) { - // Skip disabled modules or themes. + if ($file->status != $project_status) { continue; } @@ -62,6 +69,11 @@ function _update_process_info_list(&$pro continue; } + // Skip if it's a hidden module. + if (!empty($file->info['hidden'])) { + continue; + } + // If the .info doesn't define the 'project', try to figure it out. if (!isset($file->info['project'])) { $file->info['project'] = update_get_project_name($file); @@ -85,6 +97,15 @@ function _update_process_info_list(&$pro } $project_name = $file->info['project']; + if ($project_name == 'drupal') { + $project_display_type = 'core'; + if ($project_status == 0) { + $project_display_type .= '-disabled'; + } + } + else { + $project_display_type = $project_type; + } if (!isset($projects[$project_name])) { // Only process this if we haven't done this project, since a single // project can have multiple modules or themes. @@ -93,13 +114,23 @@ function _update_process_info_list(&$pro 'info' => $file->info, 'datestamp' => isset($file->info['datestamp']) ? $file->info['datestamp'] : 0, 'includes' => array($file->name => $file->info['name']), - 'project_type' => $project_name == 'drupal' ? 'core' : $project_type, + 'project_type' => $project_display_type, ); } - else { + // Only record include data if the project is of the same type. This + // prevents listing all the disabled modules included with an enabled + // project if we happen to be checking for disabled modules, too. + elseif ($projects[$project_name]['project_type'] == $project_display_type) { $projects[$project_name]['includes'][$file->name] = $file->info['name']; $projects[$project_name]['info']['_info_file_ctime'] = max($projects[$project_name]['info']['_info_file_ctime'], $file->info['_info_file_ctime']); } + elseif ($project_status == 0) { + // If we have a project_name that matches, but the project_display_type + // does not, it means we're processing a disabled module or theme that + // belongs to a project that has some enabled code. In this case, we add + // the disabled thing into a separate array for separate display. + $projects[$project_name]['disabled'][$file->name] = $file->info['name']; + } } } Index: modules/update/update.report.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.report.inc,v retrieving revision 1.18 diff -u -p -r1.18 update.report.inc --- modules/update/update.report.inc 6 Jun 2009 06:26:13 -0000 1.18 +++ modules/update/update.report.inc 21 Aug 2009 08:53:35 -0000 @@ -180,7 +180,17 @@ function theme_update_report($data) { $row .= '