Index: modules/update/update.compare.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.compare.inc,v
retrieving revision 1.2
diff -u -p -r1.2 update.compare.inc
--- modules/update/update.compare.inc	10 Jan 2008 14:14:54 -0000	1.2
+++ modules/update/update.compare.inc	15 Jan 2008 07:21:42 -0000
@@ -284,31 +284,36 @@ function update_calculate_project_data($
         $supported_majors = explode(',', $available[$project]['supported_majors']);
       }
       elseif (isset($available[$project]['default_major'])) {
-        // Older release history XML file without supported or recommended.
+        // Older release history XML file without supported_majors list.
         $supported_majors[] = $available[$project]['default_major'];
       }
 
-      if (in_array($existing_major, $supported_majors)) {
-        // Still supported, stay at the current major version.
-        $target_major = $existing_major;
-      }
-      elseif (isset($available[$project]['recommended_major'])) {
-        // Since 'recommended_major' is defined, we know this is the new XML
-        // format. Therefore, we know the current release is unsupported since
-        // its major version was not in the 'supported_majors' list. We should
-        // find the best release from the recommended major version.
-        $target_major = $available[$project]['recommended_major'];
-        $projects[$project]['status'] = UPDATE_NOT_SUPPORTED;
+      // See what the maintainer recommends.
+      if (isset($available[$project]['recommended_major'])) {
+        $recommended_major = $available[$project]['recommended_major'];
       }
       elseif (isset($available[$project]['default_major'])) {
-        // Older release history XML file without recommended, so recommend
-        // the currently defined "default_major" version.
-        $target_major = $available[$project]['default_major'];
+        // Older XML file, use the deprecated attribute.
+        $recommended_major = $available[$project]['default_major'];
       }
       else {
         // Malformed XML file? Stick with the current version.
+        $recommended_major = $existing_major;
+      }
+
+      if (in_array($existing_major, $supported_majors)) {
+        // Still supported, stay at the current major version.
         $target_major = $existing_major;
       }
+      else {
+        if (isset($available[$project]['supported_majors'])) {
+          // We know this is the new XML format. Therefore, we know the
+          // current release is unsupported since its major version was not in
+          // the 'supported_majors' list.
+          $projects[$project]['status'] = UPDATE_NOT_SUPPORTED;
+        }
+        $target_major = $recommended_major;
+      }
 
       // Make sure we never tell the admin to downgrade. If we recommended an
       // earlier version than the one they're running, they'd face an
@@ -372,19 +377,32 @@ function update_calculate_project_data($
         // supported. If so, record it as an "Also available" release.
         if ($release['version_major'] > $target_major &&
             in_array($release['version_major'], $supported_majors)) {
-          if (!isset($available[$project]['also'])) {
-            $available[$project]['also'] = array();
+          if (!isset($available[$project]['maintainer_recommended'])
+              && $release['version_major'] == $recommended_major
+              && isset($release['version_patch'])) {
+            if ($patch != $release['version_patch']) {
+              $patch = $release['version_patch'];
+              $version_patch_changed = $release['version'];
+            }
+            if (empty($release['version_extra']) && $patch == $release['version_patch']) {
+              $available[$project]['maintainer_recommended'] = $version_patch_changed;
+            }
           }
-          if (!isset($available[$project]['also'][$release['version_major']])) {
-            $available[$project]['also'][$release['version_major']] = $version;
+          elseif ($release['version_major'] != $recommended_major) {
+            if (!isset($available[$project]['also'])) {
+              $available[$project]['also'] = array();
+            }
+            if (!isset($available[$project]['also'][$release['version_major']])) {
+              $available[$project]['also'][$release['version_major']] = $version;
+            }
           }
           // Otherwise, this release can't matter to us, since it's neither
           // from the release series we're currently using nor the recommended
           // release. We don't even care about security updates for this
           // branch, since if a project maintainer puts out a security release
           // at a higher major version and not at the lower major version,
-          // they must change the default major release at the same time, in
-          // which case we won't hit this code.
+          // they must remove the lower version from the supported major
+          // releases at the same time, in which case we won't hit this code.
           continue;
         }
 
Index: modules/update/update.report.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.report.inc,v
retrieving revision 1.8
diff -u -p -r1.8 update.report.inc
--- modules/update/update.report.inc	10 Jan 2008 14:14:54 -0000	1.8
+++ modules/update/update.report.inc	15 Jan 2008 07:21:42 -0000
@@ -156,6 +156,9 @@ function theme_update_report($data) {
       }
     }
 
+    if (isset($project['maintainer_recommended'])) {
+      $row .= theme('update_version', $project['releases'][$project['maintainer_recommended']], t('Recommended version:'), 'version-recommended');
+    }
     if (isset($project['also'])) {
       foreach ($project['also'] as $also) {
         $row .= theme('update_version', $project['releases'][$also], t('Also available:'), 'version-also-available');
