? drush-977048.patch
? includes/table.inc
Index: commands/pm/pm.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/pm/pm.drush.inc,v
retrieving revision 1.162
diff -u -r1.162 pm.drush.inc
--- commands/pm/pm.drush.inc	8 Dec 2010 09:30:34 -0000	1.162
+++ commands/pm/pm.drush.inc	8 Dec 2010 10:32:36 -0000
@@ -24,14 +24,25 @@
 define('DRUSH_PM_REQUESTED_CURRENT', 102);
 
 /**
- * User requested version already installed.
+ * User requested project was not packaged by drupal.org.
  */
-define('DRUSH_PM_NO_VERSION', 103);
+define('DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED', 103);
 
 /**
  * User requested version not found.
  */
-define('DRUSH_PM_REQUESTED_NOT_FOUND', 104);
+define('DRUSH_PM_REQUESTED_VERSION_NOT_FOUND', 104);
+
+/**
+ * User requested project not found.
+ */
+define('DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND', 105);
+
+/**
+ * User requested project not updateable.
+ */
+define('DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE', 106);
+
 
 /**
  * Implementation of hook_drush_help().
Index: commands/pm/updatecode.pm.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/pm/updatecode.pm.inc,v
retrieving revision 1.29
diff -u -r1.29 updatecode.pm.inc
--- commands/pm/updatecode.pm.inc	7 Dec 2010 16:37:06 -0000	1.29
+++ commands/pm/updatecode.pm.inc	8 Dec 2010 10:32:36 -0000
@@ -33,21 +33,60 @@
   if (!empty($requests)) {
     // Check requests are installed and enabled projects and force
     // update projects where a specific version is requested.
+    $extensions = drush_get_extensions();
+    $projects = drush_get_projects($extensions);
     foreach ($requests as $name => $request) {
+      // If no update information it is impossible to update this request. In
+      // that case we will create a fake entry in $update_info in order to add
+      // the project to the table for informative purpose.
       if (!isset($update_info[$name])) {
-        // Catch projects with no version data (common for CVS checkouts
-        // if you don't have CVS deploy installed).
-        $update_info[$name] = array(
-          'title' => $name,
-          'existing_version' => 'Unknown',
-          'status'=> DRUSH_PM_NO_VERSION,
-        );
+        unset($requests[$name]);
+        // There're some reasons why we don't have update information.
+        // 1. project is installed but disabled.
+        if ((isset($projects[$name])) && ($projects[$name]['status'] == 0)) {
+          $update_info[$name] = array(
+            'title' => $name,
+            'existing_version' => $projects[$name]['version'],
+            'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE
+          );
+        }
+        else {
+          // 2. project is installed and enabled but is a cvs/git checkout and
+          // cvs_deploy (or git_deploy) is not installed. We don't have the
+          // project information. We have two options here: check a coincident
+          // extension or TODO: search for a matching project directory.
+          $vcs = FALSE;
+          if (isset($extensions[$name], $extensions[$name]->vcs)) {
+            $vcs = $extensions[$name]->vcs;
+          }
+          else {
+            //TODO: search for a matching project directory.
+            $vcs = FALSE;
+          }
+          if ($vcs !== FALSE) {
+            $update_info[$name] = array(
+              'title' => $name,
+              'existing_version' => 'Unknown',
+              'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED,
+              'status_msg' => dt('Project was not packaged by drupal.org but obtained from !vcs. You need to install !vcs_deploy module', array('!vcs' => $vcs))
+            );
+          }
+          // 3. we are unable to find matching installed project.
+          // It does not exist at all or it is mispelled,...
+          else {
+            $update_info[$name] = array(
+              'title' => $name,
+              'existing_version' => 'Unknown',
+              'status'=> DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND,
+            );        
+          }
+        }
       }
       else if (!empty($request['version'])) {
         // Match the requested release
         $release = pm_get_release($request, $update_info[$name]);
         if (!$release) {
-          $update_info[$name]['status'] = DRUSH_PM_REQUESTED_NOT_FOUND;
+          $update_info[$name]['status'] = DRUSH_PM_REQUESTED_VERSION_NOT_FOUND;
         }
         else if ($release['version'] == $update_info[$name]['existing_version']) {
           $update_info[$name]['status'] = DRUSH_PM_REQUESTED_CURRENT;
@@ -457,12 +496,18 @@
       case DRUSH_PM_REQUESTED_CURRENT:
         $status = dt('Specified version already installed');
         break;
-      case DRUSH_PM_NO_VERSION:
-        $status = dt('No version information found (if you have a CVS checkout you should install CVS Deploy module)');
+      case DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED:
+        $status = $project['status_msg'];
         break;
-      case DRUSH_PM_REQUESTED_NOT_FOUND:
+      case DRUSH_PM_REQUESTED_VERSION_NOT_FOUND:
         $status = dt('Specified version not found');
         break;
+      case DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND:
+        $status = dt('Specified project not found');
+        break;
+      case DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE:
+        $status = dt('Project has no enabled extensions and can\'t be updated.');
+        break;
       default:
         $status = pm_update_filter($project);
         break;
