[ostree] core: Add public API to get the path for an object
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] core: Add public API to get the path for an object
- Date: Wed, 9 Nov 2011 11:32:50 +0000 (UTC)
commit d14568dd2a904a4029d1e42c78b09243b5d3f3f1
Author: Colin Walters <walters verbum org>
Date: Tue Nov 8 19:38:42 2011 -0500
core: Add public API to get the path for an object
libostree/ostree-repo.c | 19 +++++++------------
libostree/ostree-repo.h | 6 +++++-
2 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/libostree/ostree-repo.c b/libostree/ostree-repo.c
index d630e4c..0f5fb88 100644
--- a/libostree/ostree-repo.c
+++ b/libostree/ostree-repo.c
@@ -29,11 +29,6 @@
#include <gio/gunixoutputstream.h>
#include <gio/gunixinputstream.h>
-static char *
-get_object_path (OstreeRepo *self,
- const char *checksum,
- OstreeObjectType type);
-
enum {
PROP_0,
@@ -731,10 +726,10 @@ import_directory_meta (OstreeRepo *self,
return ret;
}
-static char *
-get_object_path (OstreeRepo *self,
- const char *checksum,
- OstreeObjectType type)
+char *
+ostree_repo_get_object_path (OstreeRepo *self,
+ const char *checksum,
+ OstreeObjectType type)
{
OstreeRepoPrivate *priv = GET_PRIVATE (self);
char *ret;
@@ -756,7 +751,7 @@ prepare_dir_for_checksum_get_object_path (OstreeRepo *self,
char *checksum_dir = NULL;
char *object_path = NULL;
- object_path = get_object_path (self, checksum, type);
+ object_path = ostree_repo_get_object_path (self, checksum, type);
checksum_dir = g_path_get_dirname (object_path);
if (!ot_util_ensure_directory (checksum_dir, FALSE, error))
@@ -1795,7 +1790,7 @@ ostree_repo_load_variant (OstreeRepo *self,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- path = get_object_path (self, sha256, OSTREE_OBJECT_TYPE_META);
+ path = ostree_repo_get_object_path (self, sha256, OSTREE_OBJECT_TYPE_META);
if (!ostree_parse_metadata_file (path, &ret_type, &ret_variant, error))
goto out;
@@ -1878,7 +1873,7 @@ checkout_tree (OstreeRepo *self,
char *object_path;
char *dest_path;
- object_path = get_object_path (self, checksum, OSTREE_OBJECT_TYPE_FILE);
+ object_path = ostree_repo_get_object_path (self, checksum, OSTREE_OBJECT_TYPE_FILE);
dest_path = g_build_filename (destination, filename, NULL);
if (priv->archive)
diff --git a/libostree/ostree-repo.h b/libostree/ostree-repo.h
index ef66fef..17ec48f 100644
--- a/libostree/ostree-repo.h
+++ b/libostree/ostree-repo.h
@@ -23,7 +23,7 @@
#ifndef _OSTREE_REPO
#define _OSTREE_REPO
-#include <glib-object.h>
+#include "ostree-core.h"
G_BEGIN_DECLS
@@ -65,6 +65,10 @@ gboolean ostree_repo_write_config (OstreeRepo *self,
GKeyFile *new_config,
GError **error);
+char * ostree_repo_get_object_path (OstreeRepo *self,
+ const char *object,
+ OstreeObjectType type);
+
gboolean ostree_repo_store_packfile (OstreeRepo *self,
const char *expected_checksum,
const char *path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]