mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
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 ();
|
||||
|
||||
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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user