[ostree] core: Drop ot_gfile_new_for_path



commit 311493338e89874cc0a1248f77ad1bc22b409541
Author: Colin Walters <walters verbum org>
Date:   Sat Jun 30 13:42:22 2012 -0400

    core: Drop ot_gfile_new_for_path
    
    Not necessary anymore since we switched to GIO_USE_VFS=local in the
    binaries.

 src/daemon/ot-daemon.c             |    8 ++++----
 src/libostree/ostree-repo.c        |    4 ++--
 src/libostree/ostree-sysroot.c     |    2 +-
 src/libotutil/ot-gio-utils.c       |    7 -------
 src/libotutil/ot-gio-utils.h       |    2 --
 src/ostree/ot-builtin-checkout.c   |   12 ++++++------
 src/ostree/ot-builtin-checksum.c   |    2 +-
 src/ostree/ot-builtin-commit.c     |   12 ++++++------
 src/ostree/ot-builtin-diff.c       |    4 ++--
 src/ostree/ot-builtin-pull-local.c |    2 +-
 src/ostree/ot-builtin-show.c       |    2 +-
 src/ostree/ot-main.c               |    2 +-
 12 files changed, 25 insertions(+), 34 deletions(-)
---
diff --git a/src/daemon/ot-daemon.c b/src/daemon/ot-daemon.c
index 7ef1b17..28c7906 100644
--- a/src/daemon/ot-daemon.c
+++ b/src/daemon/ot-daemon.c
@@ -153,7 +153,7 @@ overlay_dir_thread (gpointer data)
 
   context = g_main_context_new ();
 
-  sysroot_f = ot_gfile_new_for_path ("/sysroot/ostree/current");
+  sysroot_f = g_file_new_for_path ("/sysroot/ostree/current");
 
   g_main_context_push_thread_default (context);
 
@@ -181,7 +181,7 @@ do_op_overlay (OstreeDaemon            *self,
   OverlayDirThreadData *tdata = g_new0 (OverlayDirThreadData, 1);
   
   tdata->op = op;
-  tdata->dir = ot_gfile_new_for_path (dir);
+  tdata->dir = g_file_new_for_path (dir);
 
 #if GLIB_CHECK_VERSION(2,32,0) && !defined(OSTREE_GLIB_TARGET_MIN)
   g_thread_new ("overlay-dir-thread", overlay_dir_thread, tdata);
@@ -316,9 +316,9 @@ ostree_daemon_config (OstreeDaemon *self,
     }
 
   if (is_dummy)
-    self->prefix = ot_gfile_new_for_path (config->dummy_test_path);
+    self->prefix = g_file_new_for_path (config->dummy_test_path);
   else
-    self->prefix = ot_gfile_new_for_path ("/sysroot/ostree");
+    self->prefix = g_file_new_for_path ("/sysroot/ostree");
       
   self->name_id = g_bus_own_name (is_dummy ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
                                   OSTREE_DAEMON_NAME,
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 6fee20a..c62614e 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -137,7 +137,7 @@ ostree_repo_set_property(GObject         *object,
     {
     case PROP_PATH:
       /* Canonicalize */
-      self->repodir = ot_gfile_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
+      self->repodir = g_file_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -724,7 +724,7 @@ ostree_repo_check (OstreeRepo *self, GError **error)
 
   if (parent_repo_path && parent_repo_path[0])
     {
-      ot_lobj GFile *parent_repo_f = ot_gfile_new_for_path (parent_repo_path);
+      ot_lobj GFile *parent_repo_f = g_file_new_for_path (parent_repo_path);
 
       self->parent_repo = ostree_repo_new (parent_repo_f);
 
diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c
index 43b513b..cd1d686 100644
--- a/src/libostree/ostree-sysroot.c
+++ b/src/libostree/ostree-sysroot.c
@@ -68,7 +68,7 @@ ostree_run_triggers_in_root (GFile                  *root,
   if (root)
     triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
   else
-    triggerdir = ot_gfile_new_for_path (rel_triggerdir);
+    triggerdir = g_file_new_for_path (rel_triggerdir);
 
   if (g_file_query_exists (triggerdir, cancellable))
     {
diff --git a/src/libotutil/ot-gio-utils.c b/src/libotutil/ot-gio-utils.c
index b27507d..86b7c94 100644
--- a/src/libotutil/ot-gio-utils.c
+++ b/src/libotutil/ot-gio-utils.c
@@ -220,13 +220,6 @@ ot_gfile_load_contents_utf8 (GFile         *file,
   return ret;
 }
 
-/* Like g_file_new_for_path, but only do local stuff, not GVFS */
-GFile *
-ot_gfile_new_for_path (const char *path)
-{
-  return g_vfs_get_file_for_path (g_vfs_get_local (), path);
-}
-
 const char *
 ot_gfile_get_path_cached (GFile *file)
 {
diff --git a/src/libotutil/ot-gio-utils.h b/src/libotutil/ot-gio-utils.h
index 9299a44..65d3c88 100644
--- a/src/libotutil/ot-gio-utils.h
+++ b/src/libotutil/ot-gio-utils.h
@@ -40,8 +40,6 @@ GFile *ot_gfile_from_build_path (const char *first, ...) G_GNUC_NULL_TERMINATED;
 
 GFile *ot_gfile_get_child_strconcat (GFile *parent, const char *first, ...) G_GNUC_NULL_TERMINATED;
 
-GFile *ot_gfile_new_for_path (const char *path);
-
 const char *ot_gfile_get_path_cached (GFile *file);
 
 const char *ot_gfile_get_basename_cached (GFile *file);
diff --git a/src/ostree/ot-builtin-checkout.c b/src/ostree/ot-builtin-checkout.c
index ab6eb80..12a8f39 100644
--- a/src/ostree/ot-builtin-checkout.c
+++ b/src/ostree/ot-builtin-checkout.c
@@ -229,7 +229,7 @@ process_many_checkouts (OstreeRepo         *repo,
     }
   else
     {
-      ot_lobj GFile *f = ot_gfile_new_for_path (opt_from_file);
+      ot_lobj GFile *f = g_file_new_for_path (opt_from_file);
 
       instream = (GInputStream*)g_file_read (f, cancellable, error);
       if (!instream)
@@ -327,7 +327,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
         }
 
       destination = argv[1];
-      checkout_target = ot_gfile_new_for_path (destination);
+      checkout_target = g_file_new_for_path (destination);
 
       if (!process_many_checkouts (repo, checkout_target, cancellable, error))
         goto out;
@@ -354,10 +354,10 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
           GError *temp_error = NULL;
 
           suffixed_destination = g_strconcat (destination, "-", resolved_commit, NULL);
-          checkout_target = ot_gfile_new_for_path (suffixed_destination);
+          checkout_target = g_file_new_for_path (suffixed_destination);
           tmp_destination = g_strconcat (suffixed_destination, ".tmp", NULL);
-          checkout_target_tmp = ot_gfile_new_for_path (tmp_destination);
-          symlink_target = ot_gfile_new_for_path (destination);
+          checkout_target_tmp = g_file_new_for_path (tmp_destination);
+          symlink_target = g_file_new_for_path (destination);
 
           if (!parse_commit_from_symlink (symlink_target, &existing_commit,
                                           cancellable, &temp_error))
@@ -380,7 +380,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
         }
       else
         {
-          checkout_target = ot_gfile_new_for_path (destination);
+          checkout_target = g_file_new_for_path (destination);
           skip_checkout = FALSE;
         }
 
diff --git a/src/ostree/ot-builtin-checksum.c b/src/ostree/ot-builtin-checksum.c
index 3ef3579..64f35ca 100644
--- a/src/ostree/ot-builtin-checksum.c
+++ b/src/ostree/ot-builtin-checksum.c
@@ -69,7 +69,7 @@ ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GError **
     goto out;
 
   if (argc > 1)
-    f = ot_gfile_new_for_path (argv[1]);
+    f = g_file_new_for_path (argv[1]);
   else
     {
       g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c
index a00c602..730e321 100644
--- a/src/ostree/ot-builtin-commit.c
+++ b/src/ostree/ot-builtin-commit.c
@@ -77,7 +77,7 @@ parse_statoverride_file (GHashTable   **out_mode_add,
   ot_lfree char *contents = NULL;
   char **lines = NULL;
 
-  path = ot_gfile_new_for_path (statoverride_file);
+  path = g_file_new_for_path (statoverride_file);
 
   if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
                              error))
@@ -136,7 +136,7 @@ parse_related_objects_file (GVariant     **out_related_objects,
   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(say)"));
   builder_initialized = TRUE;
 
-  path = ot_gfile_new_for_path (opt_related_objects_file);
+  path = g_file_new_for_path (opt_related_objects_file);
 
   if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
                              error))
@@ -262,7 +262,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
         }
       else if (metadata_bin_path)
         {
-          metadata_f = ot_gfile_new_for_path (metadata_bin_path);
+          metadata_f = g_file_new_for_path (metadata_bin_path);
           if (!ot_util_variant_map (metadata_f, G_VARIANT_TYPE ("a{sv}"), TRUE,
                                     &metadata, error))
             goto out;
@@ -361,7 +361,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
   if (argc == 1 && (trees == NULL || trees[0] == NULL))
     {
       char *current_dir = g_get_current_dir ();
-      arg = ot_gfile_new_for_path (current_dir);
+      arg = g_file_new_for_path (current_dir);
       g_free (current_dir);
 
       if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
@@ -392,14 +392,14 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
           g_clear_object (&arg);
           if (strcmp (tree_type, "dir") == 0)
             {
-              arg = ot_gfile_new_for_path (tree);
+              arg = g_file_new_for_path (tree);
               if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
                                                          cancellable, error))
                 goto out;
             }
           else if (strcmp (tree_type, "tar") == 0)
             {
-              arg = ot_gfile_new_for_path (tree);
+              arg = g_file_new_for_path (tree);
               if (!ostree_repo_stage_archive_to_mtree (repo, arg, mtree, modifier,
                                                        tar_autocreate_parents,
                                                        cancellable, error))
diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c
index 335096a..b18efe7 100644
--- a/src/ostree/ot-builtin-diff.c
+++ b/src/ostree/ot-builtin-diff.c
@@ -45,7 +45,7 @@ parse_file_or_commit (OstreeRepo  *repo,
       || g_str_has_prefix (arg, "./")
       )
     {
-      ret_file = ot_gfile_new_for_path (arg);
+      ret_file = g_file_new_for_path (arg);
     }
   else
     {
@@ -461,7 +461,7 @@ ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GError **error)
       target = argv[2];
     }
 
-  cwd = ot_gfile_new_for_path (".");
+  cwd = g_file_new_for_path (".");
 
   if (!parse_file_or_commit (repo, src, &srcf, cancellable, error))
     goto out;
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
index 5650b30..2dec762 100644
--- a/src/ostree/ot-builtin-pull-local.c
+++ b/src/ostree/ot-builtin-pull-local.c
@@ -135,7 +135,7 @@ ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **err
     }
 
   src_repo_path = argv[1];
-  src_f = ot_gfile_new_for_path (src_repo_path);
+  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))
diff --git a/src/ostree/ot-builtin-show.c b/src/ostree/ot-builtin-show.c
index 8edc4c7..72b8878 100644
--- a/src/ostree/ot-builtin-show.c
+++ b/src/ostree/ot-builtin-show.c
@@ -65,7 +65,7 @@ do_print_variant_generic (const GVariantType *type,
   ot_lobj GFile *f = NULL;
   ot_lvariant GVariant *variant = NULL;
 
-  f = ot_gfile_new_for_path (filename);
+  f = g_file_new_for_path (filename);
 
   if (!ot_util_variant_map (f, type, TRUE, &variant, error))
     goto out;
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index d9e2601..85f39ab 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -118,7 +118,7 @@ ostree_main (int    argc,
     repo = NULL;
 
   if (repo)
-    repo_file = ot_gfile_new_for_path (repo);
+    repo_file = g_file_new_for_path (repo);
 
   slash = strrchr (argv[0], '/');
   if (slash)



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