Author: glen                         Date: Wed Jan 11 16:58:37 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated

---- Files affected:
SOURCES:
   drupal-update-cli.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/drupal-update-cli.patch
diff -u SOURCES/drupal-update-cli.patch:1.1 SOURCES/drupal-update-cli.patch:1.2
--- SOURCES/drupal-update-cli.patch:1.1 Tue Dec 20 17:34:52 2005
+++ SOURCES/drupal-update-cli.patch     Wed Jan 11 17:58:31 2006
@@ -1,29 +1,54 @@
 --- drupal-4.6.5/update.php    2005-12-20 17:30:16.000000000 +0200
 +++ drupal-4.6.5/update.php    2005-12-20 18:26:23.000000000 +0200
-@@ -206,6 +206,40 @@
+@@ -206,6 +206,65 @@
    print update_page_footer();
  }
  
 +if (php_sapi_name() == 'cli') {
-+      # get index from $sql_updates
-+      $hash = array_flip(array_keys($sql_updates));
-+      if (!isset($hash[$argv[2]])) {
-+              die("Can't find requested update: $argv[2]\n");
++      $_SERVER['REMOTE_ADDR'] = '0.0.0.0';
++
++      include_once "includes/bootstrap.inc";
++      include_once "includes/common.inc";
++
++      function get_update_index($date) {
++              global $sql_updates;
++
++              $hash = array_flip(array_keys($sql_updates));
++              if (!isset($hash[$date])) {
++                      return null;
++              }
++              return $hash[$date];
 +      }
++
++      if (isset($argv[2])) {
++              # user specified the date
++              $start = get_update_index($argv[2]);
++              if (is_null($start)) {
++                      die("Can't find requested update: $argv[2]\n");
++              }
++
++      } else {
++              # lookup update date from database
++              $date = variable_get("update_start", 0);
++
++              $start = get_update_index($date);
++              if (is_null($start)) {
++                      die("No updates available\n");
++              }
++              # but we need next entry instead
++              $start++;
++      }
++
 +      # "0" reserved for "All"
-+      $start = 1 + $hash[$argv[2]];
++      $start++;
 +
 +      $_POST['op'] = $argv[1];
 +      $_POST['edit'] = array(
 +              'start' => $start,
 +      );
-+      $_SERVER['REMOTE_ADDR'] = '0.0.0.0';
-+
-+      include_once "includes/bootstrap.inc";
-+      include_once "includes/common.inc";
 +
 +      ob_start();
-+    update_page();
++      update_page();
 +      $page = ob_get_contents();
 +      ob_end_clean();
 +
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/drupal-update-cli.patch?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to