Index: system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.505
diff -u -r1.505 system.install
--- system.install	7 Sep 2010 21:59:01 -0000	1.505
+++ system.install	12 Sep 2010 12:31:34 -0000
@@ -1695,6 +1695,37 @@
  */
 
 /**
+ * Run module updates pre - Drupal7 upgrade
+ */
+function system_update_6999(&$sandbox) {
+  if (!isset($sandbox['progress'])) {
+    $sandbox['progress'] = 0;
+    $sandbox['modules'] = array();
+    $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
+    foreach ($modules as $module => $schema_version) {
+      // Skip uninstalled and incompatible modules.
+      if ($schema_version == SCHEMA_UNINSTALLED) {
+        continue;
+      }
+      else {
+        module_load_include('upgrade.drupal7.inc', $module);
+        if (function_exists($module . '_upgrade_drupal7')) {
+          $sandbox['modules'][] = $module;
+        }      
+      }
+    }
+    $sandbox['max'] = count($sandbox['modules']);
+  }
+  if ($module = array_shift($sandbox['modules'])) {
+    module_load_include('upgrade.drupal7.inc', $module);
+    $function = $module . '_upgrade_drupal7';
+    $function($sandbox);
+  }
+  $sandbox['progress'] = $sandbox['max'] - count($sandbox['modules']);
+  $sandbox['#finished'] = empty($sandbox['modules']);
+}
+
+/**
  * Rename blog and forum permissions to be consistent with other content types.
  */
 function system_update_7000() {
