core: Clean up staging API and internals

Cleanly separate metadata/content APIs, rather than defaulting to
raw streams.  This helps most use cases.

Also, drop support for staging content without knowing the total
length.  This complicated the code, and for things like streaming
HTTP, we should be able to figure this out from Content-Length.
This commit is contained in:
Colin Walters committed 2012-09-23 16:44:12 -04:00
1 parent 2a0601efc7
commit 34c49f0411
4 files changed
+177 -202

No files matched your search

+26 -24
View File
@@ -94,33 +94,35 @@ gboolean ostree_repo_has_object (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_object (OstreeRepo *self,
OstreeObjectType objtype,
const char *expected_checksum,
GInputStream *content,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_metadata (OstreeRepo *self,
OstreeObjectType objtype,
const char *expected_checksum,
GVariant *object,
guchar **out_csum,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_file_object (OstreeRepo *self,
const char *expected_checksum,
GInputStream *content,
guint64 content_length,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_content (OstreeRepo *self,
const char *expected_checksum,
GInputStream *content,
guint64 content_length,
guchar **out_csum,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_object_trusted (OstreeRepo *self,
OstreeObjectType objtype,
const char *checksum,
GInputStream *content,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_metadata_trusted (OstreeRepo *self,
OstreeObjectType objtype,
const char *checksum,
GVariant *object,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_file_object_trusted (OstreeRepo *self,
const char *checksum,
GInputStream *content,
guint64 content_length,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_content_trusted (OstreeRepo *self,
const char *checksum,
GInputStream *content,
guint64 content_length,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_resolve_rev (OstreeRepo *self,
const char *rev,