Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.247
diff -u -r1.247 update.php
--- update.php	7 Jan 2008 19:43:28 -0000	1.247
+++ update.php	11 Jan 2008 11:31:05 -0000
@@ -158,9 +158,16 @@
   if (!isset($context['results'][$module][$number])) {
     $context['results'][$module][$number] = array();
   }
-  $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);;
+  $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);
 
-  if ($context['finished'] == 1) {
+  // To abort the update so the schema version is not incremented, and also display
+  // a message, an update function should return an array with a value like:
+  // $ret['#abort'] = array('success' => FALSE, 'query' => "Why I failed").
+  // Note that this will not prevent later updates from running and updating
+  // the schema version, so if you have critical updates that must keep
+  // later updates from happening, you will need to add code to check the
+  // schema version in later updates and abort them, too.
+  if ($context['finished'] == 1 && empty($ret['#abort'])) {
     // Update the installed version
     drupal_set_installed_schema_version($module, $number);
   }
