[ostree] deltas: Stub out a few more opcodes



commit 7aea18cf0db9f488f9d9bd71d7b11206df0c388c
Author: Colin Walters <walters verbum org>
Date:   Thu Jan 29 17:54:59 2015 -0500

    deltas: Stub out a few more opcodes

 src/libostree/ostree-repo-static-delta-private.h   |    1 +
 .../ostree-repo-static-delta-processing.c          |   89 ++++++++++++++++++++
 2 files changed, 90 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-private.h 
b/src/libostree/ostree-repo-static-delta-private.h
index 0661787..09d4898 100644
--- a/src/libostree/ostree-repo-static-delta-private.h
+++ b/src/libostree/ostree-repo-static-delta-private.h
@@ -135,6 +135,7 @@ typedef enum {
   OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE = 'S',
   OSTREE_STATIC_DELTA_OP_OPEN = 'o',
   OSTREE_STATIC_DELTA_OP_WRITE = 'w',
+  OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE = 'R',
   OSTREE_STATIC_DELTA_OP_CLOSE = 'c'
 } OstreeStaticDeltaOpCode;
 
diff --git a/src/libostree/ostree-repo-static-delta-processing.c 
b/src/libostree/ostree-repo-static-delta-processing.c
index 4ca4002..cdbd617 100644
--- a/src/libostree/ostree-repo-static-delta-processing.c
+++ b/src/libostree/ostree-repo-static-delta-processing.c
@@ -83,6 +83,10 @@ typedef struct  {
                                    GError                    **error);
 
 OPPROTO(open_splice_and_close)
+OPPROTO(open)
+OPPROTO(write)
+OPPROTO(set_read_source)
+OPPROTO(close)
 #undef OPPROTO
 
 static gboolean
@@ -223,6 +227,22 @@ _ostree_static_delta_part_execute_raw (OstreeRepo      *repo,
           if (!dispatch_open_splice_and_close (repo, state, cancellable, error))
             goto out;
           break;
+        case OSTREE_STATIC_DELTA_OP_OPEN:
+          if (!dispatch_open (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_WRITE:
+          if (!dispatch_write (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE:
+          if (!dispatch_set_read_source (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_CLOSE:
+          if (!dispatch_close (repo, state, cancellable, error))
+            goto out;
+          break;
         default:
           g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                        "Unknown opcode %u at offset %u", opcode, n_executed);
@@ -533,3 +553,72 @@ dispatch_open_splice_and_close (OstreeRepo                 *repo,
     g_prefix_error (error, "opcode open-splice-and-close: ");
   return ret;
 }
+
+static gboolean
+dispatch_open (OstreeRepo                 *repo,
+               StaticDeltaExecutionState  *state,
+               GCancellable               *cancellable,  
+               GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  if (!open_output_target (state, cancellable, error))
+    goto out;
+
+  ret = TRUE;
+ out:
+  if (!ret)
+    g_prefix_error (error, "opcode open: ");
+  return ret;
+}
+
+static gboolean
+dispatch_write (OstreeRepo                 *repo,
+               StaticDeltaExecutionState  *state,
+               GCancellable               *cancellable,  
+               GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}
+
+static gboolean
+dispatch_set_read_source (OstreeRepo                 *repo,
+                          StaticDeltaExecutionState  *state,
+                          GCancellable               *cancellable,  
+                          GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}
+
+static gboolean
+dispatch_close (OstreeRepo                 *repo,
+                StaticDeltaExecutionState  *state,
+                GCancellable               *cancellable,  
+                GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]