[ostree] repo: Rename ostree_repo_check to ostree_repo_open



commit 02adfc8c03e414e47093e28be814348b00af74b8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Sep 5 13:41:46 2013 -0400

    repo: Rename ostree_repo_check to ostree_repo_open
    
    As it more clearly describes what the function does: load the
    repo from disk and initialize it.
    
    At the same time, add a cancellable parameter.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707582

 src/libostree/ostree-repo.c           |   12 +++++++-----
 src/libostree/ostree-repo.h           |    4 +++-
 src/ostree/ot-admin-builtin-upgrade.c |    2 +-
 src/ostree/ot-admin-functions.c       |    2 +-
 src/ostree/ot-builtin-pull-local.c    |    2 +-
 src/ostree/ot-main.c                  |    4 ++--
 6 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 3ee48c8..814babe 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -54,7 +54,7 @@
  *
  * Creating an #OstreeRepo does not invoke any file I/O, and thus needs
  * to be initialized, either from an existing contents or with a new
- * repository. If you have an existing repo, use ostree_repo_check()
+ * repository. If you have an existing repo, use ostree_repo_open()
  * to load it from disk and check its validity. To initialize a new
  * repository in the given filepath, use ostree_repo_create() instead.
  *
@@ -434,7 +434,7 @@ ostree_repo_create (OstreeRepo     *self,
   if (!g_file_make_directory (grandchild, cancellable, error))
     goto out;
 
-  if (!ostree_repo_check (self, error))
+  if (!ostree_repo_open (self, cancellable, error))
     goto out;
 
   ret = TRUE;
@@ -446,7 +446,9 @@ ostree_repo_create (OstreeRepo     *self,
 }
 
 gboolean
-ostree_repo_check (OstreeRepo *self, GError **error)
+ostree_repo_open (OstreeRepo    *self,
+                  GCancellable  *cancellable,
+                  GError       **error)
 {
   gboolean ret = FALSE;
   gboolean is_archive;
@@ -467,7 +469,7 @@ ostree_repo_check (OstreeRepo *self, GError **error)
       goto out;
     }
 
-  if (!gs_file_ensure_directory (self->pending_dir, FALSE, NULL, error))
+  if (!gs_file_ensure_directory (self->pending_dir, FALSE, cancellable, error))
     goto out;
   
   self->config = g_key_file_new ();
@@ -514,7 +516,7 @@ ostree_repo_check (OstreeRepo *self, GError **error)
 
       self->parent_repo = ostree_repo_new (parent_repo_f);
 
-      if (!ostree_repo_check (self->parent_repo, error))
+      if (!ostree_repo_open (self->parent_repo, cancellable, error))
         {
           g_prefix_error (error, "While checking parent repository '%s': ",
                           gs_file_get_path_cached (parent_repo_f));
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index 1aea784..94e11e9 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -56,7 +56,9 @@ OstreeRepo* ostree_repo_new (GFile *path);
 
 OstreeRepo* ostree_repo_new_default (void);
 
-gboolean      ostree_repo_check (OstreeRepo  *self, GError **error);
+gboolean      ostree_repo_open   (OstreeRepo     *self,
+                                  GCancellable   *cancellable,
+                                  GError        **error);
 
 gboolean      ostree_repo_create (OstreeRepo     *self,
                                   OstreeRepoMode  mode,
diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c
index f16edd3..882c41a 100644
--- a/src/ostree/ot-admin-builtin-upgrade.c
+++ b/src/ostree/ot-admin-builtin-upgrade.c
@@ -93,7 +93,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, GFile *sysroot, GCancellable *c
 
   repo_path = g_file_resolve_relative_path (sysroot, "ostree/repo");
   repo = ostree_repo_new (repo_path);
-  if (!ostree_repo_check (repo, error))
+  if (!ostree_repo_open (repo, cancellable, error))
     goto out;
 
   origin = ot_deployment_get_origin (merge_deployment);
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index 8aca881..a3f3902 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -829,7 +829,7 @@ ot_admin_get_repo (GFile         *sysroot,
   gs_unref_object GFile *repo_path = g_file_resolve_relative_path (sysroot, "ostree/repo");
 
   ret_repo = ostree_repo_new (repo_path);
-  if (!ostree_repo_check (ret_repo, error))
+  if (!ostree_repo_open (ret_repo, cancellable, error))
     goto out;
     
   ret = TRUE;
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
index 2406594..090b9b5 100644
--- a/src/ostree/ot-builtin-pull-local.c
+++ b/src/ostree/ot-builtin-pull-local.c
@@ -192,7 +192,7 @@ ostree_builtin_pull_local (int argc, char **argv, OstreeRepo *repo, GCancellable
   src_f = g_file_new_for_path (src_repo_path);
 
   data->src_repo = ostree_repo_new (src_f);
-  if (!ostree_repo_check (data->src_repo, error))
+  if (!ostree_repo_open (data->src_repo, cancellable, error))
     goto out;
 
   data->threadpool = ot_thread_pool_new_nproc (import_one_object_thread, data);
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index 9e1b4fa..1138f86 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -224,7 +224,7 @@ ostree_run (int    argc,
     {
       GError *temp_error = NULL;
       repo = ostree_repo_new_default ();
-      if (!ostree_repo_check (repo, &temp_error))
+      if (!ostree_repo_open (repo, cancellable, &temp_error))
         {
           if (g_error_matches (temp_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
             {
@@ -246,7 +246,7 @@ ostree_run (int    argc,
       repo = ostree_repo_new (repo_file);
       if (!(command->flags & OSTREE_BUILTIN_FLAG_NO_CHECK))
         {
-          if (!ostree_repo_check (repo, &error))
+          if (!ostree_repo_open (repo, cancellable, &error))
             goto out;
         }
     }


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