core: Drop ot_gfile_new_for_path
Not necessary anymore since we switched to GIO_USE_VFS=local in the binaries.
This commit is contained in:
parent
d5a1f1deda
commit
311493338e
|
|
@ -153,7 +153,7 @@ overlay_dir_thread (gpointer data)
|
||||||
|
|
||||||
context = g_main_context_new ();
|
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);
|
g_main_context_push_thread_default (context);
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ do_op_overlay (OstreeDaemon *self,
|
||||||
OverlayDirThreadData *tdata = g_new0 (OverlayDirThreadData, 1);
|
OverlayDirThreadData *tdata = g_new0 (OverlayDirThreadData, 1);
|
||||||
|
|
||||||
tdata->op = op;
|
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)
|
#if GLIB_CHECK_VERSION(2,32,0) && !defined(OSTREE_GLIB_TARGET_MIN)
|
||||||
g_thread_new ("overlay-dir-thread", overlay_dir_thread, tdata);
|
g_thread_new ("overlay-dir-thread", overlay_dir_thread, tdata);
|
||||||
|
|
@ -316,9 +316,9 @@ ostree_daemon_config (OstreeDaemon *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_dummy)
|
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
|
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,
|
self->name_id = g_bus_own_name (is_dummy ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
|
||||||
OSTREE_DAEMON_NAME,
|
OSTREE_DAEMON_NAME,
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ ostree_repo_set_property(GObject *object,
|
||||||
{
|
{
|
||||||
case PROP_PATH:
|
case PROP_PATH:
|
||||||
/* Canonicalize */
|
/* 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;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
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])
|
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);
|
self->parent_repo = ostree_repo_new (parent_repo_f);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ ostree_run_triggers_in_root (GFile *root,
|
||||||
if (root)
|
if (root)
|
||||||
triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
|
triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
|
||||||
else
|
else
|
||||||
triggerdir = ot_gfile_new_for_path (rel_triggerdir);
|
triggerdir = g_file_new_for_path (rel_triggerdir);
|
||||||
|
|
||||||
if (g_file_query_exists (triggerdir, cancellable))
|
if (g_file_query_exists (triggerdir, cancellable))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -220,13 +220,6 @@ ot_gfile_load_contents_utf8 (GFile *file,
|
||||||
return ret;
|
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 *
|
const char *
|
||||||
ot_gfile_get_path_cached (GFile *file)
|
ot_gfile_get_path_cached (GFile *file)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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_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_path_cached (GFile *file);
|
||||||
|
|
||||||
const char *ot_gfile_get_basename_cached (GFile *file);
|
const char *ot_gfile_get_basename_cached (GFile *file);
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ process_many_checkouts (OstreeRepo *repo,
|
||||||
}
|
}
|
||||||
else
|
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);
|
instream = (GInputStream*)g_file_read (f, cancellable, error);
|
||||||
if (!instream)
|
if (!instream)
|
||||||
|
|
@ -327,7 +327,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
|
||||||
}
|
}
|
||||||
|
|
||||||
destination = argv[1];
|
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))
|
if (!process_many_checkouts (repo, checkout_target, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -354,10 +354,10 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
|
||||||
GError *temp_error = NULL;
|
GError *temp_error = NULL;
|
||||||
|
|
||||||
suffixed_destination = g_strconcat (destination, "-", resolved_commit, 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);
|
tmp_destination = g_strconcat (suffixed_destination, ".tmp", NULL);
|
||||||
checkout_target_tmp = ot_gfile_new_for_path (tmp_destination);
|
checkout_target_tmp = g_file_new_for_path (tmp_destination);
|
||||||
symlink_target = ot_gfile_new_for_path (destination);
|
symlink_target = g_file_new_for_path (destination);
|
||||||
|
|
||||||
if (!parse_commit_from_symlink (symlink_target, &existing_commit,
|
if (!parse_commit_from_symlink (symlink_target, &existing_commit,
|
||||||
cancellable, &temp_error))
|
cancellable, &temp_error))
|
||||||
|
|
@ -380,7 +380,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkout_target = ot_gfile_new_for_path (destination);
|
checkout_target = g_file_new_for_path (destination);
|
||||||
skip_checkout = FALSE;
|
skip_checkout = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GError **
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
f = ot_gfile_new_for_path (argv[1]);
|
f = g_file_new_for_path (argv[1]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ parse_statoverride_file (GHashTable **out_mode_add,
|
||||||
ot_lfree char *contents = NULL;
|
ot_lfree char *contents = NULL;
|
||||||
char **lines = 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,
|
if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
|
||||||
error))
|
error))
|
||||||
|
|
@ -136,7 +136,7 @@ parse_related_objects_file (GVariant **out_related_objects,
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(say)"));
|
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(say)"));
|
||||||
builder_initialized = TRUE;
|
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,
|
if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
|
||||||
error))
|
error))
|
||||||
|
|
@ -262,7 +262,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
|
||||||
}
|
}
|
||||||
else if (metadata_bin_path)
|
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,
|
if (!ot_util_variant_map (metadata_f, G_VARIANT_TYPE ("a{sv}"), TRUE,
|
||||||
&metadata, error))
|
&metadata, error))
|
||||||
goto out;
|
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))
|
if (argc == 1 && (trees == NULL || trees[0] == NULL))
|
||||||
{
|
{
|
||||||
char *current_dir = g_get_current_dir ();
|
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);
|
g_free (current_dir);
|
||||||
|
|
||||||
if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
|
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);
|
g_clear_object (&arg);
|
||||||
if (strcmp (tree_type, "dir") == 0)
|
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,
|
if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else if (strcmp (tree_type, "tar") == 0)
|
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,
|
if (!ostree_repo_stage_archive_to_mtree (repo, arg, mtree, modifier,
|
||||||
tar_autocreate_parents,
|
tar_autocreate_parents,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ parse_file_or_commit (OstreeRepo *repo,
|
||||||
|| g_str_has_prefix (arg, "./")
|
|| g_str_has_prefix (arg, "./")
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ret_file = ot_gfile_new_for_path (arg);
|
ret_file = g_file_new_for_path (arg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -461,7 +461,7 @@ ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GError **error)
|
||||||
target = argv[2];
|
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))
|
if (!parse_file_or_commit (repo, src, &srcf, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **err
|
||||||
}
|
}
|
||||||
|
|
||||||
src_repo_path = argv[1];
|
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);
|
data.src_repo = ostree_repo_new (src_f);
|
||||||
if (!ostree_repo_check (data.src_repo, error))
|
if (!ostree_repo_check (data.src_repo, error))
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ do_print_variant_generic (const GVariantType *type,
|
||||||
ot_lobj GFile *f = NULL;
|
ot_lobj GFile *f = NULL;
|
||||||
ot_lvariant GVariant *variant = 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))
|
if (!ot_util_variant_map (f, type, TRUE, &variant, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ ostree_main (int argc,
|
||||||
repo = NULL;
|
repo = NULL;
|
||||||
|
|
||||||
if (repo)
|
if (repo)
|
||||||
repo_file = ot_gfile_new_for_path (repo);
|
repo_file = g_file_new_for_path (repo);
|
||||||
|
|
||||||
slash = strrchr (argv[0], '/');
|
slash = strrchr (argv[0], '/');
|
||||||
if (slash)
|
if (slash)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue