? 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.210
diff -u -p -r1.210 pm.drush.inc
--- commands/pm/pm.drush.inc	2 Feb 2011 04:42:22 -0000	1.210
+++ commands/pm/pm.drush.inc	4 Feb 2011 12:57:59 -0000
@@ -558,6 +558,7 @@ function drush_pm_find_project_from_exte
  * Command callback. Enable one or more extensions from downloaded projects.
  */
 function drush_pm_enable() {
+  require_once DRUPAL_ROOT . '/includes/update.inc';
   $args = _convert_csv_to_array(func_get_args());
 
   $recheck = TRUE;
@@ -577,8 +578,8 @@ function drush_pm_enable() {
       drush_log(dt('!extension was not found and will not be enabled.', array('!extension' => $name)), 'warning');
     }
 
-    // Discard already enabled extensions.
     foreach ($extensions as $name) {
+      // Discard already enabled extensions.
       if ($extension_info[$name]->status) {
         if ($extension_info[$name]->type == 'module') {
           unset($modules[$name]);
@@ -588,6 +589,18 @@ function drush_pm_enable() {
         }
         drush_log(dt('!extension is already enabled.', array('!extension' => $name)), 'ok');
       }
+      // Check extension is compatible with Drupal core.
+      if (update_check_incompatibility($name, $extension_info[$name]->type)) {
+        if ($extension_info[$name]->type == 'module') {
+          unset($modules[$name]);
+        }
+        else {
+          unset($themes[$name]);
+        }
+        drush_set_error('DRUSH_PM_ENABLE_EXTENSION_INCOMPATIBLE', dt('!name is incompatible with the Drupal version.', array('!name' => $name)));
+        _drush_log_drupal_messages();
+        return FALSE;
+      }
     }
 
     if (!empty($modules)) {
