diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/core/core.drush.inc ../drush-dev/commands/core/core.drush.inc
--- ../drush-HEAD/commands/core/core.drush.inc	2009-06-02 20:48:31.000000000 -0300
+++ ../drush-dev/commands/core/core.drush.inc	2009-08-03 22:07:34.000000000 -0300
@@ -106,6 +106,7 @@ function core_drush_command() {
 function core_drush_engine_drupal() {
   $engines = array();
   $engines['update'] = array();
+  $engines['environment'] = array();
   return $engines;
 }
 
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/core/drupal/environment.inc ../drush-dev/commands/core/drupal/environment.inc
--- ../drush-HEAD/commands/core/drupal/environment.inc	1969-12-31 21:00:00.000000000 -0300
+++ ../drush-dev/commands/core/drupal/environment.inc	2009-08-03 20:51:21.000000000 -0300
@@ -0,0 +1,20 @@
+<?php
+// $Id:
+
+/**
+ * Get module information for all installed modules.
+ *
+ * @return An array containing module info for all installed modules
+ */
+function _drush_get_modules() {
+    return module_rebuild_cache();
+}
+
+/**
+ * Get theme information for all installed themes.
+ *
+ * @return An array containing theme info for all installed themes
+ */
+function _drush_get_themes() {
+  return _system_theme_data();
+}
\ No newline at end of file
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/core/drupal/environment_7.inc ../drush-dev/commands/core/drupal/environment_7.inc
--- ../drush-HEAD/commands/core/drupal/environment_7.inc	1969-12-31 21:00:00.000000000 -0300
+++ ../drush-dev/commands/core/drupal/environment_7.inc	2009-08-03 20:52:05.000000000 -0300
@@ -0,0 +1,25 @@
+<?php
+// $Id:
+
+/**
+ * Get module information for all installed modules.
+ *
+ * @return An array containing module info for all installed modules
+ */
+function _drush_get_modules() {
+    $module_info = drupal_system_listing('/\.module$/', 'modules', 'name', 0);
+    system_get_files_database($module_info, 'module');
+    foreach($module_info as $module_name => $module){
+      $module_info[$module_name]->info = drupal_parse_info_file(dirname($module->filename) .'/'. $module->name .'.info');
+    }
+    return $module_info;
+}
+
+/**
+ * Get theme information for all installed themes.
+ *
+ * @return An array containing theme info for all installed themes
+ */
+function _drush_get_themes() {
+  return _system_get_theme_data();
+}
\ No newline at end of file
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/core/drupal/update_6.inc ../drush-dev/commands/core/drupal/update_6.inc
--- ../drush-HEAD/commands/core/drupal/update_6.inc	2009-05-26 21:40:59.000000000 -0300
+++ ../drush-dev/commands/core/drupal/update_6.inc	2009-08-02 02:21:00.000000000 -0300
@@ -149,8 +149,8 @@ function update_check_incompatibility($n
 
   // Store values of expensive functions for future use.
   if (empty($themes) || empty($modules)) {
-    $themes = _system_theme_data();
-    $modules = module_rebuild_cache();
+    $themes = drush_get_themes();
+    $modules = drush_get_modules();
   }
 
   if ($type == 'module' && isset($modules[$name])) {
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/core/drupal/update_7.inc ../drush-dev/commands/core/drupal/update_7.inc
--- ../drush-HEAD/commands/core/drupal/update_7.inc	2009-05-26 21:40:59.000000000 -0300
+++ ../drush-dev/commands/core/drupal/update_7.inc	2009-08-02 02:11:43.000000000 -0300
@@ -246,8 +246,8 @@ function update_check_incompatibility($n
 
   // Store values of expensive functions for future use.
   if (empty($themes) || empty($modules)) {
-    $themes = _system_theme_data();
-    $modules = module_rebuild_cache();
+    $themes = drush_get_themes();
+    $modules = drush_get_modules();
   }
 
   if ($type == 'module' && isset($modules[$name])) {
@@ -418,7 +418,7 @@ function update_main() {
   drupal_load('module', 'filter');
 
   // Set up $language, since the installer components require it.
-  drupal_init_language();
+  drupal_language_initialize();
 
   // Set up theme system for the maintenance page.
   drupal_maintenance_theme();
@@ -430,7 +430,7 @@ function update_main() {
   // been created yet.
   drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_DATABASE);
   include_once DRUPAL_ROOT . '/includes/install.inc';
-  drupal_install_init_database();
+  drupal_install_initialize_database();
   spl_autoload_unregister('drupal_autoload_class');
   spl_autoload_unregister('drupal_autoload_interface');
   // The new {blocked_ips} table is used in Drupal 7 to store a list of
@@ -451,13 +451,8 @@ function update_main() {
 
   // Updates only run reliably if user ID #1 is logged in. For example, node_delete() requires elevated perms in D5/6.
   if (!drush_get_context('DRUSH_USER')) {
-    // Remove after http://drupal.org/node/439236 lands.
-    require(DRUPAL_ROOT . '/modules/field/field.crud.inc');
-    require(DRUPAL_ROOT . '/modules/field/field.autoload.inc');
-
     drush_set_option('user', 1);
     drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_LOGIN);
-
   }
 
   drupal_maintenance_theme();
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/commands/pm/pm.drush.inc ../drush-dev/commands/pm/pm.drush.inc
--- ../drush-HEAD/commands/pm/pm.drush.inc	2009-07-29 01:42:52.000000000 -0300
+++ ../drush-dev/commands/pm/pm.drush.inc	2009-08-01 21:19:10.000000000 -0300
@@ -213,7 +213,7 @@ function pm_module_manage($modules = arr
     require_once('./'. drupal_get_path('module', 'system') .'/system.module');
   }
 
-  $module_info = module_rebuild_cache();
+  $module_info = drush_get_modules();
   $enabled = array();
   foreach ($module_info as $module_name => $module) {
     // In Drupal 5, system_modules() returns NULL for the dependency list of the module if there are no dependencies. 
@@ -274,7 +274,7 @@ function pm_module_manage($modules = arr
       drupal_form_submit('system_modules', $form_state);
     }
 
-    $module_info = module_rebuild_cache();
+    $module_info = drush_get_modules();
     foreach ($modules as $module_name) {
       if ($enable) { 
         if ($module_info[$module_name]->status) {
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/includes/command.inc ../drush-dev/includes/command.inc
--- ../drush-HEAD/includes/command.inc	2009-05-27 16:38:12.000000000 -0300
+++ ../drush-dev/includes/command.inc	2009-08-05 03:12:10.000000000 -0300
@@ -395,16 +395,22 @@ function _drush_find_commandfiles($phase
       }
       break;
     case DRUSH_BOOTSTRAP_DRUPAL_SITE:
-      // Add all module paths, even disabled modules. Prefer speed over accuracy.
+      // Add all theme & module paths, even disabled modules. Prefer speed over accuracy.
+      $searchpath[] = 'modules';
+      $searchpath[] = 'themes';
       $searchpath[] = 'sites/all/modules';
+      $searchpath[] = 'sites/all/themes';
       $searchpath[] = conf_path() . '/modules';
+      $searchpath[] = conf_path() . '/themes';
       // Too early for variable_get('install_profile', 'default'); Just use default.
       $searchpath[] = "profiles/default/modules";
+      $searchpath[] = "profiles/default/themes";
+      
       break;
     case DRUSH_BOOTSTRAP_DRUPAL_FULL:
       // Add enabled module paths. Since we are bootstrapped,
       // we can use the Drupal API.
-      $files = module_rebuild_cache();
+      $files = drush_get_modules() + drush_get_themes();
       foreach ($files as $file) {
         if ($file->status) {
           $searchpath[] = dirname($file->filename);
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/includes/drush.inc ../drush-dev/includes/drush.inc
--- ../drush-HEAD/includes/drush.inc	2009-05-26 21:47:38.000000000 -0300
+++ ../drush-dev/includes/drush.inc	2009-08-04 00:27:35.000000000 -0300
@@ -264,7 +264,7 @@ function drush_op($function) {
  *
  * @see t()
  */
-function dt($string, $args = NULL) {
+function dt($string, $args = array()) {
   if (function_exists('t')) {
     return t($string, $args);
   }
diff --exclude-from=/Users/jasonpkirst/.diffignore -N -urp ../drush-HEAD/includes/environment.inc ../drush-dev/includes/environment.inc
--- ../drush-HEAD/includes/environment.inc	2009-07-07 20:34:53.000000000 -0300
+++ ../drush-dev/includes/environment.inc	2009-08-03 22:07:57.000000000 -0300
@@ -814,3 +814,27 @@ function drush_valid_db_credentials() {
     return TRUE;
   }
 }
+
+/**
+ * Fetch info on all installed modules
+ */
+function drush_get_modules() {
+  if(drush_include_engine('drupal', 'environment')){
+    return _drush_get_modules();
+  }
+  else {
+    return drush_set_error('DRUSH_CORE', dt('Drush was unable to load module information.'));
+  }
+}
+
+/**
+ * Fetch info on all installed themes
+ */
+function drush_get_themes() {
+  if(drush_include_engine('drupal', 'environment')){
+    return _drush_get_themes();
+  }
+  else {
+    return drush_set_error('DRUSH_CORE', dt('Drush was unable to load theme information.'));
+  }
+}
\ No newline at end of file
