diff options
Diffstat (limited to 'app')
24 files changed, 409 insertions, 409 deletions
diff --git a/app/xdg-app-builtins-add-remote.c b/app/xdg-app-builtins-add-remote.c index 799ee7f..5627adb 100644 --- a/app/xdg-app-builtins-add-remote.c +++ b/app/xdg-app-builtins-add-remote.c @@ -112,7 +112,7 @@ open_source_stream (GInputStream **out_source_stream, } /* Chain together all the --keyring options as one long stream. */ - source_stream = (GInputStream *) xdg_app_chain_input_stream_new (streams); + source_stream = (GInputStream *) flatpak_chain_input_stream_new (streams); *out_source_stream = g_steal_pointer (&source_stream); @@ -120,7 +120,7 @@ open_source_stream (GInputStream **out_source_stream, } gboolean -import_keys (XdgAppDir *dir, +import_keys (FlatpakDir *dir, const char *remote_name, GCancellable *cancellable, GError **error) @@ -133,7 +133,7 @@ import_keys (XdgAppDir *dir, if (!open_source_stream (&input_stream, cancellable, error)) return FALSE; - if (!ostree_repo_remote_gpg_import (xdg_app_dir_get_repo (dir), remote_name, input_stream, + if (!ostree_repo_remote_gpg_import (flatpak_dir_get_repo (dir), remote_name, input_stream, NULL, &imported, cancellable, error)) return FALSE; @@ -146,11 +146,11 @@ import_keys (XdgAppDir *dir, } gboolean -xdg_app_builtin_add_remote (int argc, char **argv, +flatpak_builtin_add_remote (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GVariantBuilder) optbuilder = NULL; g_autoptr(GFile) file = NULL; g_autofree char *title = NULL; @@ -163,7 +163,7 @@ xdg_app_builtin_add_remote (int argc, char **argv, g_option_context_add_main_entries (context, common_options, NULL); - if (!xdg_app_option_context_parse (context, add_options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, add_options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 3) @@ -228,7 +228,7 @@ xdg_app_builtin_add_remote (int argc, char **argv, "xa.title", g_variant_new_variant (g_variant_new_string (title))); - if (!ostree_repo_remote_change (xdg_app_dir_get_repo (dir), NULL, + if (!ostree_repo_remote_change (flatpak_dir_get_repo (dir), NULL, opt_if_not_exists ? OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS : OSTREE_REPO_REMOTE_CHANGE_ADD, remote_name, remote_url, @@ -238,7 +238,7 @@ xdg_app_builtin_add_remote (int argc, char **argv, if (title == NULL) { - title = xdg_app_dir_fetch_remote_title (dir, + title = flatpak_dir_fetch_remote_title (dir, remote_name, NULL, NULL); @@ -247,10 +247,10 @@ xdg_app_builtin_add_remote (int argc, char **argv, g_autoptr(GKeyFile) config = NULL; g_autofree char *group = g_strdup_printf ("remote \"%s\"", remote_name); - config = ostree_repo_copy_config (xdg_app_dir_get_repo (dir)); + config = ostree_repo_copy_config (flatpak_dir_get_repo (dir)); g_key_file_set_string (config, group, "xa.title", title); - if (!ostree_repo_write_config (xdg_app_dir_get_repo (dir), config, error)) + if (!ostree_repo_write_config (flatpak_dir_get_repo (dir), config, error)) return FALSE; } } @@ -258,17 +258,17 @@ xdg_app_builtin_add_remote (int argc, char **argv, if (!import_keys (dir, remote_name, cancellable, error)) return FALSE; - if (!xdg_app_dir_mark_changed (dir, error)) + if (!flatpak_dir_mark_changed (dir, error)) return FALSE; return TRUE; } gboolean -xdg_app_builtin_modify_remote (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_modify_remote (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GVariantBuilder) optbuilder = NULL; g_autoptr(GKeyFile) config = NULL; const char *remote_name; @@ -278,7 +278,7 @@ xdg_app_builtin_modify_remote (int argc, char **argv, GCancellable *cancellable, g_option_context_add_main_entries (context, common_options, NULL); - if (!xdg_app_option_context_parse (context, modify_options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, modify_options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 2) @@ -290,10 +290,10 @@ xdg_app_builtin_modify_remote (int argc, char **argv, GCancellable *cancellable, group = g_strdup_printf ("remote \"%s\"", remote_name); - if (!ostree_repo_remote_get_url (xdg_app_dir_get_repo (dir), remote_name, NULL, NULL)) - return xdg_app_fail (error, "No remote %s", remote_name); + if (!ostree_repo_remote_get_url (flatpak_dir_get_repo (dir), remote_name, NULL, NULL)) + return flatpak_fail (error, "No remote %s", remote_name); - config = ostree_repo_copy_config (xdg_app_dir_get_repo (dir)); + config = ostree_repo_copy_config (flatpak_dir_get_repo (dir)); if (opt_no_gpg_verify) { @@ -330,13 +330,13 @@ xdg_app_builtin_modify_remote (int argc, char **argv, GCancellable *cancellable, g_key_file_set_string (config, group, "xa.prio", prio_as_string); } - if (!ostree_repo_write_config (xdg_app_dir_get_repo (dir), config, error)) + if (!ostree_repo_write_config (flatpak_dir_get_repo (dir), config, error)) return FALSE; if (!import_keys (dir, remote_name, cancellable, error)) return FALSE; - if (!xdg_app_dir_mark_changed (dir, error)) + if (!flatpak_dir_mark_changed (dir, error)) return FALSE; return TRUE; diff --git a/app/xdg-app-builtins-build-bundle.c b/app/xdg-app-builtins-build-bundle.c index 7d11757..9f7270d 100644 --- a/app/xdg-app-builtins-build-bundle.c +++ b/app/xdg-app-builtins-build-bundle.c @@ -92,9 +92,9 @@ read_gpg_data (GCancellable *cancellable, } /* Chain together all the --keyring options as one long stream. */ - source_stream = (GInputStream *) xdg_app_chain_input_stream_new (streams); + source_stream = (GInputStream *) flatpak_chain_input_stream_new (streams); - return xdg_app_read_stream (source_stream, FALSE, error); + return flatpak_read_stream (source_stream, FALSE, error); } static gboolean @@ -144,7 +144,7 @@ build_bundle (OstreeRepo *repo, GFile *file, in = (GInputStream *) g_file_read (metadata_file, cancellable, NULL); if (in != NULL) { - g_autoptr(GBytes) bytes = xdg_app_read_stream (in, TRUE, error); + g_autoptr(GBytes) bytes = flatpak_read_stream (in, TRUE, error); if (bytes == NULL) return FALSE; @@ -166,17 +166,17 @@ build_bundle (OstreeRepo *repo, GFile *file, xml_in = (GInputStream *) g_file_read (appstream_file, cancellable, NULL); if (xml_in) { - g_autoptr(XdgAppXml) appstream_root = NULL; - g_autoptr(XdgAppXml) xml_root = xdg_app_xml_parse (xml_in, TRUE, - cancellable, error); + g_autoptr(FlatpakXml) appstream_root = NULL; + g_autoptr(FlatpakXml) xml_root = flatpak_xml_parse (xml_in, TRUE, + cancellable, error); if (xml_root == NULL) return FALSE; - appstream_root = xdg_app_appstream_xml_new (); - if (xdg_app_appstream_xml_migrate (xml_root, appstream_root, + appstream_root = flatpak_appstream_xml_new (); + if (flatpak_appstream_xml_migrate (xml_root, appstream_root, full_branch, name, keyfile)) { - g_autoptr(GBytes) xml_data = xdg_app_appstream_xml_root_to_data (appstream_root, error); + g_autoptr(GBytes) xml_data = flatpak_appstream_xml_root_to_data (appstream_root, error); int i; g_autoptr(GFile) icons_dir = g_file_resolve_relative_path (root, @@ -201,7 +201,7 @@ build_bundle (OstreeRepo *repo, GFile *file, png_in = (GInputStream *) g_file_read (icon_file, cancellable, NULL); if (png_in != NULL) { - g_autoptr(GBytes) png_data = xdg_app_read_stream (png_in, FALSE, error); + g_autoptr(GBytes) png_data = flatpak_read_stream (png_in, FALSE, error); if (png_data == NULL) return FALSE; @@ -256,14 +256,14 @@ build_bundle (OstreeRepo *repo, GFile *file, #if defined(HAVE_LIBARCHIVE) && defined(HAVE_OSTREE_EXPORT_PATH_PREFIX) -GLNX_DEFINE_CLEANUP_FUNCTION (void *, xdg_app_local_free_read_archive, archive_read_free) -#define free_read_archive __attribute__((cleanup (xdg_app_local_free_read_archive))) +GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_read_archive, archive_read_free) +#define free_read_archive __attribute__((cleanup (flatpak_local_free_read_archive))) -GLNX_DEFINE_CLEANUP_FUNCTION (void *, xdg_app_local_free_write_archive, archive_write_free) -#define free_write_archive __attribute__((cleanup (xdg_app_local_free_write_archive))) +GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_write_archive, archive_write_free) +#define free_write_archive __attribute__((cleanup (flatpak_local_free_write_archive))) -GLNX_DEFINE_CLEANUP_FUNCTION (void *, xdg_app_local_free_archive_entry, archive_entry_free) -#define free_archive_entry __attribute__((cleanup (xdg_app_local_free_archive_entry))) +GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_archive_entry, archive_entry_free) +#define free_archive_entry __attribute__((cleanup (flatpak_local_free_archive_entry))) typedef struct @@ -884,7 +884,7 @@ build_oci (OstreeRepo *repo, GFile *file, } gboolean -xdg_app_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(GFile) file = NULL; @@ -898,7 +898,7 @@ xdg_app_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable, context = g_option_context_new ("LOCATION FILENAME NAME [BRANCH] - Create a single file bundle from a local repository"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 4) @@ -917,20 +917,20 @@ xdg_app_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable, repo = ostree_repo_new (repofile); if (!g_file_query_exists (repofile, cancellable)) - return xdg_app_fail (error, "'%s' is not a valid repository", location); + return flatpak_fail (error, "'%s' is not a valid repository", location); file = g_file_new_for_commandline_arg (filename); - if (!xdg_app_is_valid_name (name)) - return xdg_app_fail (error, "'%s' is not a valid name", name); + if (!flatpak_is_valid_name (name)) + return flatpak_fail (error, "'%s' is not a valid name", name); - if (!xdg_app_is_valid_branch (branch)) - return xdg_app_fail (error, "'%s' is not a valid branch name", branch); + if (!flatpak_is_valid_branch (branch)) + return flatpak_fail (error, "'%s' is not a valid branch name", branch); if (opt_runtime) - full_branch = xdg_app_build_runtime_ref (name, branch, opt_arch); + full_branch = flatpak_build_runtime_ref (name, branch, opt_arch); else - full_branch = xdg_app_build_app_ref (name, branch, opt_arch); + full_branch = flatpak_build_app_ref (name, branch, opt_arch); if (!ostree_repo_open (repo, cancellable, error)) return FALSE; diff --git a/app/xdg-app-builtins-build-export.c b/app/xdg-app-builtins-build-export.c index a1bb18d..a6f7899 100644 --- a/app/xdg-app-builtins-build-export.c +++ b/app/xdg-app-builtins-build-export.c @@ -84,13 +84,13 @@ metadata_get_arch (GFile *file, char **out_arch, GError **error) "runtime", NULL); if (runtime == NULL) { - *out_arch = g_strdup (xdg_app_get_arch ()); + *out_arch = g_strdup (flatpak_get_arch ()); return TRUE; } parts = g_strsplit (runtime, "/", 0); if (g_strv_length (parts) != 3) - return xdg_app_fail (error, "Failed to determine arch from metadata runtime key: %s", runtime); + return flatpak_fail (error, "Failed to determine arch from metadata runtime key: %s", runtime); *out_arch = g_strdup (parts[1]); @@ -132,7 +132,7 @@ matches_patterns (const char **patterns, const char *path) for (i = 0; patterns[i] != NULL; i++) { - if (xdg_app_path_match_prefix (patterns[i], path) != NULL) + if (flatpak_path_match_prefix (patterns[i], path) != NULL) return TRUE; } @@ -217,7 +217,7 @@ add_file_to_mtree (GFile *file, } gboolean -xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; @@ -253,7 +253,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, context = g_option_context_new ("LOCATION DIRECTORY [BRANCH] - Create a repository from a build directory"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) goto out; if (argc < 3) @@ -270,9 +270,9 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, else branch = "master"; - if (!xdg_app_is_valid_branch (branch)) + if (!flatpak_is_valid_branch (branch)) { - xdg_app_fail (error, "'%s' is not a valid branch name", branch); + flatpak_fail (error, "'%s' is not a valid branch name", branch); goto out; } @@ -294,7 +294,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, if (!g_file_query_exists (files, cancellable) || !g_file_query_exists (metadata, cancellable)) { - xdg_app_fail (error, "Build directory %s not initialized", directory); + flatpak_fail (error, "Build directory %s not initialized", directory); goto out; } @@ -311,7 +311,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, if (!opt_runtime && !g_file_query_exists (export, cancellable)) { - xdg_app_fail (error, "Build directory %s not finalized", directory); + flatpak_fail (error, "Build directory %s not finalized", directory); goto out; } @@ -352,7 +352,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, mtree = ostree_mutable_tree_new (); - if (!xdg_app_mtree_create_root (repo, mtree, cancellable, error)) + if (!flatpak_mtree_create_root (repo, mtree, cancellable, error)) goto out; if (!ostree_mutable_tree_ensure_dir (mtree, "files", &files_mtree, error)) @@ -424,7 +424,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, { g_autoptr(GError) my_error = NULL; - if (!xdg_app_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, &my_error)) + if (!flatpak_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, &my_error)) { if (g_error_matches (my_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)) { @@ -438,7 +438,7 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable, } } - if (!xdg_app_repo_update (repo, + if (!flatpak_repo_update (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, diff --git a/app/xdg-app-builtins-build-finish.c b/app/xdg-app-builtins-build-finish.c index 71a3971..a46eecd 100644 --- a/app/xdg-app-builtins-build-finish.c +++ b/app/xdg-app-builtins-build-finish.c @@ -120,7 +120,7 @@ export_dir (int source_parent_fd, source_printable = g_build_filename (source_relpath, dent->d_name, NULL); - if (!xdg_app_has_name_prefix (dent->d_name, required_prefix)) + if (!flatpak_has_name_prefix (dent->d_name, required_prefix)) { g_print ("Not exporting %s, wrong prefix\n", source_printable); continue; @@ -241,14 +241,14 @@ collect_exports (GFile *base, const char *app_id, gboolean is_runtime, GCancella } static gboolean -update_metadata (GFile *base, XdgAppContext *arg_context, GCancellable *cancellable, GError **error) +update_metadata (GFile *base, FlatpakContext *arg_context, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; g_autoptr(GFile) metadata = NULL; g_autofree char *path = NULL; g_autoptr(GKeyFile) keyfile = NULL; - g_autoptr(XdgAppContext) app_context = NULL; + g_autoptr(FlatpakContext) app_context = NULL; GError *temp_error = NULL; metadata = g_file_get_child (base, "metadata"); @@ -315,11 +315,11 @@ update_metadata (GFile *base, XdgAppContext *arg_context, GCancellable *cancella } } - app_context = xdg_app_context_new (); - if (!xdg_app_context_load_metadata (app_context, keyfile, error)) + app_context = flatpak_context_new (); + if (!flatpak_context_load_metadata (app_context, keyfile, error)) goto out; - xdg_app_context_merge (app_context, arg_context); - xdg_app_context_save_metadata (app_context, keyfile); + flatpak_context_merge (app_context, arg_context); + flatpak_context_save_metadata (app_context, keyfile); if (!g_key_file_save_to_file (keyfile, path, error)) goto out; @@ -334,7 +334,7 @@ out: } gboolean -xdg_app_builtin_build_finish (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_finish (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(GFile) base = NULL; @@ -347,14 +347,14 @@ xdg_app_builtin_build_finish (int argc, char **argv, GCancellable *cancellable, gsize metadata_size; const char *directory; g_autoptr(GKeyFile) metakey = NULL; - g_autoptr(XdgAppContext) arg_context = NULL; + g_autoptr(FlatpakContext) arg_context = NULL; context = g_option_context_new ("DIRECTORY - Convert a directory to a bundle"); - arg_context = xdg_app_context_new (); - g_option_context_add_group (context, xdg_app_context_get_options (arg_context)); + arg_context = flatpak_context_new (); + g_option_context_add_group (context, flatpak_context_get_options (arg_context)); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 2) @@ -370,7 +370,7 @@ xdg_app_builtin_build_finish (int argc, char **argv, GCancellable *cancellable, if (!g_file_query_exists (files_dir, cancellable) || !g_file_query_exists (metadata_file, cancellable)) - return xdg_app_fail (error, "Build directory %s not initialized", directory); + return flatpak_fail (error, "Build directory %s not initialized", directory); if (!g_file_load_contents (metadata_file, cancellable, &metadata_contents, &metadata_size, NULL, error)) return FALSE; @@ -384,12 +384,12 @@ xdg_app_builtin_build_finish (int argc, char **argv, GCancellable *cancellable, { id = g_key_file_get_string (metakey, "Runtime", "name", NULL); if (id == NULL) - return xdg_app_fail (error, "No name specified in the metadata"); + return flatpak_fail (error, "No name specified in the metadata"); is_runtime = TRUE; } if (g_file_query_exists (export_dir, cancellable)) - return xdg_app_fail (error, "Build directory %s already finalized", directory); + return flatpak_fail (error, "Build directory %s already finalized", directory); g_debug ("Collecting exports"); if (!collect_exports (base, id, is_runtime, cancellable, error)) diff --git a/app/xdg-app-builtins-build-import-bundle.c b/app/xdg-app-builtins-build-import-bundle.c index 4d035e3..ac0a939 100644 --- a/app/xdg-app-builtins-build-import-bundle.c +++ b/app/xdg-app-builtins-build-import-bundle.c @@ -105,11 +105,11 @@ import_oci (OstreeRepo *repo, GFile *file, commitmeta = g_file_resolve_relative_path (archive_root, "rootfs/commitmeta"); if (!g_file_query_exists (ref, NULL)) - return xdg_app_fail (error, "Required file ref not in tarfile"); + return flatpak_fail (error, "Required file ref not in tarfile"); if (!g_file_query_exists (metadata, NULL)) - return xdg_app_fail (error, "Required file metadata not in tarfile"); + return flatpak_fail (error, "Required file metadata not in tarfile"); if (!g_file_query_exists (commit, NULL)) - return xdg_app_fail (error, "Required file commit not in tarfile"); + return flatpak_fail (error, "Required file commit not in tarfile"); if (!g_file_load_contents (ref, cancellable, &ref_data, NULL, @@ -123,7 +123,7 @@ import_oci (OstreeRepo *repo, GFile *file, files = g_file_resolve_relative_path (archive_root, files_source); if (!g_file_query_exists (files, NULL)) - return xdg_app_fail (error, "Required directory %s not in tarfile", files_source); + return flatpak_fail (error, "Required directory %s not in tarfile", files_source); export = g_file_resolve_relative_path (archive_root, "rootfs/export"); @@ -151,7 +151,7 @@ import_oci (OstreeRepo *repo, GFile *file, mtree = ostree_mutable_tree_new (); - if (!xdg_app_mtree_create_root (repo, mtree, cancellable, error)) + if (!flatpak_mtree_create_root (repo, mtree, cancellable, error)) return FALSE; if (!ostree_mutable_tree_ensure_dir (mtree, "files", &files_mtree, error)) @@ -191,11 +191,11 @@ import_oci (OstreeRepo *repo, GFile *file, tree_metadata_checksum = ostree_checksum_from_bytes_v (tree_metadata_bytes); if (strcmp (tree_contents_checksum, ostree_repo_file_tree_get_contents_checksum ((OstreeRepoFile *) root))) - return xdg_app_fail (error, "Imported content checksum (%s) does not match original checksum (%s)", + return flatpak_fail (error, "Imported content checksum (%s) does not match original checksum (%s)", tree_contents_checksum, ostree_repo_file_tree_get_contents_checksum ((OstreeRepoFile *) root)); if (strcmp (tree_metadata_checksum, ostree_repo_file_tree_get_metadata_checksum ((OstreeRepoFile *) root))) - return xdg_app_fail (error, "Imported metadata checksum (%s) does not match original checksum (%s)", + return flatpak_fail (error, "Imported metadata checksum (%s) does not match original checksum (%s)", tree_metadata_checksum, ostree_repo_file_tree_get_metadata_checksum ((OstreeRepoFile *) root)); } @@ -245,7 +245,7 @@ import_bundle (OstreeRepo *repo, GFile *file, g_autofree char *to_checksum = NULL; const char *ref; - metadata = xdg_app_bundle_load (file, &to_checksum, + metadata = flatpak_bundle_load (file, &to_checksum, &bundle_ref, NULL, NULL, @@ -260,7 +260,7 @@ import_bundle (OstreeRepo *repo, GFile *file, ref = bundle_ref; g_print ("Importing %s (%s)\n", ref, to_checksum); - if (!xdg_app_pull_from_bundle (repo, file, + if (!flatpak_pull_from_bundle (repo, file, NULL, ref, FALSE, cancellable, error)) @@ -270,7 +270,7 @@ import_bundle (OstreeRepo *repo, GFile *file, } gboolean -xdg_app_builtin_build_import (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_import (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(GFile) file = NULL; @@ -282,7 +282,7 @@ xdg_app_builtin_build_import (int argc, char **argv, GCancellable *cancellable, context = g_option_context_new ("LOCATION FILENAME - Import a file bundle into a local repository"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 3) @@ -295,7 +295,7 @@ xdg_app_builtin_build_import (int argc, char **argv, GCancellable *cancellable, repo = ostree_repo_new (repofile); if (!g_file_query_exists (repofile, cancellable)) - return xdg_app_fail (error, "'%s' is not a valid repository", location); + return flatpak_fail (error, "'%s' is not a valid repository", location); file = g_file_new_for_commandline_arg (filename); diff --git a/app/xdg-app-builtins-build-init.c b/app/xdg-app-builtins-build-init.c index 52714c8..c100d33 100644 --- a/app/xdg-app-builtins-build-init.c +++ b/app/xdg-app-builtins-build-init.c @@ -51,7 +51,7 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(GFile) var_deploy_base = NULL; @@ -76,7 +76,7 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE context = g_option_context_new ("DIRECTORY APPNAME SDK RUNTIME [BRANCH] - Initialize a directory for building"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 5) @@ -89,20 +89,20 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE if (argc >= 6) branch = argv[5]; - if (!xdg_app_is_valid_name (app_id)) - return xdg_app_fail (error, "'%s' is not a valid application name", app_id); + if (!flatpak_is_valid_name (app_id)) + return flatpak_fail (error, "'%s' is not a valid application name", app_id); - if (!xdg_app_is_valid_name (runtime)) - return xdg_app_fail (error, "'%s' is not a valid runtime name", runtime); + if (!flatpak_is_valid_name (runtime)) + return flatpak_fail (error, "'%s' is not a valid runtime name", runtime); - if (!xdg_app_is_valid_name (sdk)) - return xdg_app_fail (error, "'%s' is not a valid sdk name", sdk); + if (!flatpak_is_valid_name (sdk)) + return flatpak_fail (error, "'%s' is not a valid sdk name", sdk); - if (!xdg_app_is_valid_branch (branch)) - return xdg_app_fail (error, "'%s' is not a valid branch name", branch); + if (!flatpak_is_valid_branch (branch)) + return flatpak_fail (error, "'%s' is not a valid branch name", branch); - runtime_ref = xdg_app_build_untyped_ref (runtime, branch, opt_arch); - sdk_ref = xdg_app_build_untyped_ref (sdk, branch, opt_arch); + runtime_ref = flatpak_build_untyped_ref (runtime, branch, opt_arch); + sdk_ref = flatpak_build_untyped_ref (sdk, branch, opt_arch); base = g_file_new_for_commandline_arg (directory); @@ -121,16 +121,16 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE if (!opt_update && g_file_query_exists (files_dir, cancellable)) - return xdg_app_fail (error, "Build directory %s already initialized", directory); + return flatpak_fail (error, "Build directory %s already initialized", directory); if (opt_writable_sdk) { g_autofree char *full_sdk_ref = g_strconcat ("runtime/", sdk_ref, NULL); g_autoptr(GError) my_error = NULL; g_autoptr(GFile) sdk_deploy_files = NULL; - g_autoptr(XdgAppDeploy) sdk_deploy = NULL; + g_autoptr(FlatpakDeploy) sdk_deploy = NULL; - sdk_deploy = xdg_app_find_deploy_for_ref (full_sdk_ref, cancellable, error); + sdk_deploy = flatpak_find_deploy_for_ref (full_sdk_ref, cancellable, error); if (sdk_deploy == NULL) return FALSE; @@ -145,17 +145,17 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE g_clear_error (&my_error); } - sdk_deploy_files = xdg_app_deploy_get_files (sdk_deploy); - if (!xdg_app_cp_a (sdk_deploy_files, usr_dir, XDG_APP_CP_FLAGS_NO_CHOWN, cancellable, error)) + sdk_deploy_files = flatpak_deploy_get_files (sdk_deploy); + if (!flatpak_cp_a (sdk_deploy_files, usr_dir, FLATPAK_CP_FLAGS_NO_CHOWN, cancellable, error)) return FALSE; if (opt_sdk_extensions) { - g_autoptr(GKeyFile) metakey = xdg_app_deploy_get_metadata (sdk_deploy); + g_autoptr(GKeyFile) metakey = flatpak_deploy_get_metadata (sdk_deploy); GList *extensions = NULL, *l; /* We leak this on failure, as we have no autoptr for deep lists.. */ - extensions = xdg_app_list_extensions (metakey, + extensions = flatpak_list_extensions (metakey, opt_arch, branch); @@ -166,12 +166,12 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE for (l = extensions; l != NULL; l = l->next) { - XdgAppExtension *ext = l->data; + FlatpakExtension *ext = l->data; if (strcmp (ext->installed_id, requested_extension) == 0 || strcmp (ext->id, requested_extension) == 0) { - g_autoptr(GFile) ext_deploy_dir = xdg_app_find_deploy_dir_for_ref (ext->ref, cancellable, NULL); + g_autoptr(GFile) ext_deploy_dir = flatpak_find_deploy_dir_for_ref (ext->ref, cancellable, NULL); if (ext_deploy_dir != NULL) { g_autoptr(GFile) ext_deploy_files = g_file_get_child (ext_deploy_dir, "files"); @@ -185,31 +185,31 @@ xdg_app_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE if (!gs_shutil_rm_rf (target, cancellable, error)) return FALSE; - if (!xdg_app_cp_a (ext_deploy_files, target, XDG_APP_CP_FLAGS_NO_CHOWN, cancellable, error)) + if (!flatpak_cp_a (ext_deploy_files, target, FLATPAK_CP_FLAGS_NO_CHOWN, cancellable, error)) return FALSE; found = TRUE; } else { - g_list_free_full (extensions, (GDestroyNotify) xdg_app_extension_free); - return xdg_app_fail (error, "Requested extension %s not installed\n", requested_extension); + g_list_free_full (extensions, (GDestroyNotify) flatpak_extension_free); + return flatpak_fail (error, "Requested extension %s not installed\n", requested_extension); } } } if (!found) - return xdg_app_fail (error, "No extension %s in sdk\n", requested_extension); + return flatpak_fail (error, "No extension %s in sdk\n", requested_extension); } - g_list_free_full (extensions, (GDestroyNotify) xdg_app_extension_free); + g_list_free_full (extensions, (GDestroyNotify) flatpak_extension_free); } } if (opt_var) { - var_ref = xdg_app_build_runtime_ref (opt_var, branch, opt_arch); + var_ref = flatpak_build_runtime_ref (opt_var, branch, opt_arch); - var_deploy_base = xdg_app_find_deploy_dir_for_ref (var_ref, cancellable, error); + var_deploy_base = flatpak_find_deploy_dir_for_ref (var_ref, cancellable, error); if (var_deploy_base == NULL) return FALSE; diff --git a/app/xdg-app-builtins-build-sign.c b/app/xdg-app-builtins-build-sign.c index e748e44..4c8c887 100644 --- a/app/xdg-app-builtins-build-sign.c +++ b/app/xdg-app-builtins-build-sign.c @@ -46,7 +46,7 @@ static GOptionEntry options[] = { gboolean -xdg_app_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(GFile) repofile = NULL; @@ -60,7 +60,7 @@ xdg_app_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GE context = g_option_context_new ("LOCATION ID [BRANCH] - Create a repository from a build directory"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 3) @@ -77,19 +77,19 @@ xdg_app_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GE else branch = "master"; - if (!xdg_app_is_valid_name (id)) - return xdg_app_fail (error, "'%s' is not a valid name", id); + if (!flatpak_is_valid_name (id)) + return flatpak_fail (error, "'%s' is not a valid name", id); - if (!xdg_app_is_valid_branch (branch)) - return xdg_app_fail (error, "'%s' is not a valid branch name", branch); + if (!flatpak_is_valid_branch (branch)) + return flatpak_fail (error, "'%s' is not a valid branch name", branch); if (opt_gpg_key_ids == NULL) - return xdg_app_fail (error, "No gpg key ids specified"); + return flatpak_fail (error, "No gpg key ids specified"); if (opt_runtime) - ref = xdg_app_build_runtime_ref (id, branch, opt_arch); + ref = flatpak_build_runtime_ref (id, branch, opt_arch); else - ref = xdg_app_build_app_ref (id, branch, opt_arch); + ref = flatpak_build_app_ref (id, branch, opt_arch); repofile = g_file_new_for_commandline_arg (location); repo = ostree_repo_new (repofile); diff --git a/app/xdg-app-builtins-build.c b/app/xdg-app-builtins-build.c index a07183d..82416e2 100644 --- a/app/xdg-app-builtins-build.c +++ b/app/xdg-app-builtins-build.c @@ -57,10 +57,10 @@ add_args (GPtrArray *argv_array, ...) } gboolean -xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDeploy) runtime_deploy = NULL; + g_autoptr(FlatpakDeploy) runtime_deploy = NULL; g_autoptr(GFile) var = NULL; g_autoptr(GFile) usr = NULL; g_autoptr(GFile) app_deploy = NULL; @@ -80,8 +80,8 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError g_autofree char *app_id = NULL; int i; int rest_argv_start, rest_argc; - g_autoptr(XdgAppContext) arg_context = NULL; - g_autoptr(XdgAppContext) app_context = NULL; + g_autoptr(FlatpakContext) arg_context = NULL; + g_autoptr(FlatpakContext) app_context = NULL; gboolean custom_usr; g_auto(GStrv) runtime_ref_parts = NULL; @@ -100,10 +100,10 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError } } - arg_context = xdg_app_context_new (); - g_option_context_add_group (context, xdg_app_context_get_options (arg_context)); + arg_context = flatpak_context_new (); + g_option_context_add_group (context, flatpak_context_get_options (arg_context)); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (rest_argc == 0) @@ -133,15 +133,15 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError runtime_ref = g_build_filename ("runtime", runtime, NULL); - runtime_ref_parts = xdg_app_decompose_ref (runtime_ref, error); + runtime_ref_parts = flatpak_decompose_ref (runtime_ref, error); if (runtime_ref_parts == NULL) return FALSE; - runtime_deploy = xdg_app_find_deploy_for_ref (runtime_ref, cancellable, error); + runtime_deploy = flatpak_find_deploy_for_ref (runtime_ref, cancellable, error); if (runtime_deploy == NULL) return FALSE; - runtime_metakey = xdg_app_deploy_get_metadata (runtime_deploy); + runtime_metakey = flatpak_deploy_get_metadata (runtime_deploy); var = g_file_get_child (app_deploy, "var"); if (!gs_file_ensure_directory (var, TRUE, cancellable, error)) @@ -150,7 +150,7 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError app_files = g_file_get_child (app_deploy, "files"); argv_array = g_ptr_array_new_with_free_func (g_free); - g_ptr_array_add (argv_array, g_strdup (xdg_app_get_bwrap ())); + g_ptr_array_add (argv_array, g_strdup (flatpak_get_bwrap ())); custom_usr = FALSE; usr = g_file_get_child (app_deploy, "usr"); @@ -161,7 +161,7 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError } else { - runtime_files = xdg_app_deploy_get_files (runtime_deploy); + runtime_files = flatpak_deploy_get_files (runtime_deploy); } add_args (argv_array, @@ -169,7 +169,7 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError "--bind", gs_file_get_path_cached (app_files), "/app", NULL); - if (!xdg_app_run_setup_base_argv (argv_array, runtime_files, NULL, runtime_ref_parts[2], XDG_APP_RUN_FLAG_DEVEL, error)) + if (!flatpak_run_setup_base_argv (argv_array, runtime_files, NULL, runtime_ref_parts[2], FLATPAK_RUN_FLAG_DEVEL, error)) return FALSE; /* After setup_base to avoid conflicts with /var symlinks */ @@ -177,21 +177,21 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError "--bind", gs_file_get_path_cached (var), "/var", NULL); - app_context = xdg_app_context_new (); - if (!xdg_app_context_load_metadata (app_context, runtime_metakey, error)) + app_context = flatpak_context_new (); + if (!flatpak_context_load_metadata (app_context, runtime_metakey, error)) return FALSE; - if (!xdg_app_context_load_metadata (app_context, metakey, error)) + if (!flatpak_context_load_metadata (app_context, metakey, error)) return FALSE; - xdg_app_context_allow_host_fs (app_context); - xdg_app_context_merge (app_context, arg_context); + flatpak_context_allow_host_fs (app_context); + flatpak_context_merge (app_context, arg_context); - envp = xdg_app_run_get_minimal_env (TRUE); - envp = xdg_app_run_apply_env_vars (envp, app_context); - xdg_app_run_add_environment_args (argv_array, &envp, NULL, NULL, app_id, + envp = flatpak_run_get_minimal_env (TRUE); + envp = flatpak_run_apply_env_vars (envp, app_context); + flatpak_run_add_environment_args (argv_array, &envp, NULL, NULL, app_id, app_context, NULL); if (!custom_usr && - !xdg_app_run_add_extension_args (argv_array, runtime_metakey, runtime_ref, cancellable, error)) + !flatpak_run_add_extension_args (argv_array, runtime_metakey, runtime_ref, cancellable, error)) return FALSE; for (i = 0; opt_bind_mounts != NULL && opt_bind_mounts[i] != NULL; i++) @@ -222,7 +222,7 @@ xdg_app_builtin_build (int argc, char **argv, GCancellable *cancellable, GError g_ptr_array_add (argv_array, NULL); - if (!execve (xdg_app_get_bwrap (), (char **) argv_array->pdata, envp)) + if (!execve (flatpak_get_bwrap (), (char **) argv_array->pdata, envp)) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Unable to start app"); return FALSE; diff --git a/app/xdg-app-builtins-delete-remote.c b/app/xdg-app-builtins-delete-remote.c index f32a2ac..2f24b48 100644 --- a/app/xdg-app-builtins-delete-remote.c +++ b/app/xdg-app-builtins-delete-remote.c @@ -31,15 +31,15 @@ #include "xdg-app-builtins.h" gboolean -xdg_app_builtin_delete_remote (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_delete_remote (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; const char *remote_name; context = g_option_context_new ("NAME - Delete a remote repository"); - if (!xdg_app_option_context_parse (context, NULL, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, NULL, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 2) @@ -47,22 +47,22 @@ xdg_app_builtin_delete_remote (int argc, char **argv, GCancellable *cancellable, remote_name = argv[1]; - if (!xdg_app_dir_remove_all_refs (dir, remote_name, + if (!flatpak_dir_remove_all_refs (dir, remote_name, cancellable, error)) return FALSE; - if (!xdg_app_dir_remove_appstream (dir, remote_name, + if (!flatpak_dir_remove_appstream (dir, remote_name, cancellable, error)) return FALSE; - if (!ostree_repo_remote_change (xdg_app_dir_get_repo (dir), NULL, + if (!ostree_repo_remote_change (flatpak_dir_get_repo (dir), NULL, OSTREE_REPO_REMOTE_CHANGE_DELETE, remote_name, NULL, NULL, cancellable, error)) return FALSE; - if (!xdg_app_dir_mark_changed (dir, error)) + if (!flatpak_dir_mark_changed (dir, error)) return FALSE; return TRUE; diff --git a/app/xdg-app-builtins-document.c b/app/xdg-app-builtins-document.c index 58c8f82..893adee 100644 --- a/app/xdg-app-builtins-document.c +++ b/app/xdg-app-builtins-document.c @@ -56,7 +56,7 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_export_file (int argc, char **argv, +flatpak_builtin_export_file (int argc, char **argv, GCancellable *cancellable, GError **error) { @@ -77,8 +77,8 @@ xdg_app_builtin_export_file (int argc, char **argv, context = g_option_context_new ("FILE - Export a file to apps"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, - XDG_APP_BUILTIN_FLAG_NO_DIR, + if (!flatpak_option_context_parse (context, options, &argc, &argv, + FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; diff --git a/app/xdg-app-builtins-enter.c b/app/xdg-app-builtins-enter.c index 43b0308..162195e 100644 --- a/app/xdg-app-builtins-enter.c +++ b/app/xdg-app-builtins-enter.c @@ -117,14 +117,14 @@ child_setup (gpointer user_data) } gboolean -xdg_app_builtin_enter (int argc, +flatpak_builtin_enter (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; int rest_argv_start, rest_argc; - g_autoptr(XdgAppContext) arg_context = NULL; + g_autoptr(FlatpakContext) arg_context = NULL; const char *ns_name[5] = { "user", "ipc", "net", "pid", "mnt" }; int ns_fd[G_N_ELEMENTS (ns_name)]; char pid_ns[256]; @@ -162,10 +162,10 @@ xdg_app_builtin_enter (int argc, } } - arg_context = xdg_app_context_new (); - g_option_context_add_group (context, xdg_app_context_get_options (arg_context)); + arg_context = flatpak_context_new (); + g_option_context_add_group (context, flatpak_context_get_options (arg_context)); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (rest_argc < 2) @@ -178,7 +178,7 @@ xdg_app_builtin_enter (int argc, pid = atoi (pid_s); if (pid <= 0) - return xdg_app_fail (error, "Invalid pid %s\n", pid_s); + return flatpak_fail (error, "Invalid pid %s\n", pid_s); environment_path = g_strdup_printf ("/proc/%d/environ", pid); if (!g_file_get_contents (environment_path, &environment, &environment_len, error)) @@ -191,12 +191,12 @@ xdg_app_builtin_enter (int argc, pid_ns_len = readlink (path, pid_ns, sizeof (pid_ns) - 1); if (pid_ns_len <= 0) - return xdg_app_fail (error, "Invalid %s namespace for pid %d\n", ns_name[i], pid); + return flatpak_fail (error, "Invalid %s namespace for pid %d\n", ns_name[i], pid); pid_ns[pid_ns_len] = 0; self_ns_len = readlink (self_path, self_ns, sizeof (self_ns) - 1); if (self_ns_len <= 0) - return xdg_app_fail (error, "Invalid %s namespace for self\n", ns_name[i]); + return flatpak_fail (error, "Invalid %s namespace for self\n", ns_name[i]); self_ns[self_ns_len] = 0; if (strcmp (self_ns, pid_ns) == 0) @@ -208,7 +208,7 @@ xdg_app_builtin_enter (int argc, { ns_fd[i] = open (path, O_RDONLY); if (ns_fd[i] == -1) - return xdg_app_fail (error, "Can't open %s namespace: %s", ns_name[i], strerror (errno)); + return flatpak_fail (error, "Can't open %s namespace: %s", ns_name[i], strerror (errno)); } } @@ -217,7 +217,7 @@ xdg_app_builtin_enter (int argc, if (ns_fd[i] != -1) { if (setns (ns_fd[i], 0) == -1) - return xdg_app_fail (error, "Can't enter %s namespace: %s", ns_name[i], strerror (errno)); + return flatpak_fail (error, "Can't enter %s namespace: %s", ns_name[i], strerror (errno)); close (ns_fd[i]); } } diff --git a/app/xdg-app-builtins-info.c b/app/xdg-app-builtins-info.c index 954ef6d..2b60ebf 100644 --- a/app/xdg-app-builtins-info.c +++ b/app/xdg-app-builtins-info.c @@ -53,13 +53,13 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_info (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autofree char *ref = NULL; - g_autoptr(XdgAppDir) user_dir = NULL; - g_autoptr(XdgAppDir) system_dir = NULL; - XdgAppDir *dir = NULL; + g_autoptr(FlatpakDir) user_dir = NULL; + g_autoptr(FlatpakDir) system_dir = NULL; + FlatpakDir *dir = NULL; g_autoptr(GError) lookup_error = NULL; g_autoptr(GVariant) deploy_data = NULL; const char *name; @@ -71,7 +71,7 @@ xdg_app_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * context = g_option_context_new ("NAME [BRANCH] - Get info about installed app and/or runtime"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 2) @@ -89,9 +89,9 @@ xdg_app_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * if (opt_user) { - user_dir = xdg_app_dir_get_user (); + user_dir = flatpak_dir_get_user (); - ref = xdg_app_dir_find_installed_ref (user_dir, + ref = flatpak_dir_find_installed_ref (user_dir, name, branch, opt_arch, @@ -103,9 +103,9 @@ xdg_app_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * if (ref == NULL && opt_system) { - system_dir = xdg_app_dir_get_system (); + system_dir = flatpak_dir_get_system (); - ref = xdg_app_dir_find_installed_ref (system_dir, + ref = flatpak_dir_find_installed_ref (system_dir, name, branch, opt_arch, @@ -121,12 +121,12 @@ xdg_app_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * return FALSE; } - deploy_data = xdg_app_dir_get_deploy_data (dir, ref, cancellable, error); + deploy_data = flatpak_dir_get_deploy_data (dir, ref, cancellable, error); if (deploy_data == NULL) return FALSE; - commit = xdg_app_deploy_data_get_commit (deploy_data); - origin = xdg_app_deploy_data_get_origin (deploy_data); + commit = flatpak_deploy_data_get_commit (deploy_data); + origin = flatpak_deploy_data_get_origin (deploy_data); if (!opt_show_ref && !opt_show_origin && !opt_show_commit) opt_show_ref = opt_show_origin = opt_show_commit = TRUE; diff --git a/app/xdg-app-builtins-install.c b/app/xdg-app-builtins-install.c index c642419..57b29ca 100644 --- a/app/xdg-app-builtins-install.c +++ b/app/xdg-app-builtins-install.c @@ -92,13 +92,13 @@ read_gpg_data (GCancellable *cancellable, } /* Chain together all the --keyring options as one long stream. */ - source_stream = (GInputStream *) xdg_app_chain_input_stream_new (streams); + source_stream = (GInputStream *) flatpak_chain_input_stream_new (streams); - return xdg_app_read_stream (source_stream, FALSE, error); + return flatpak_read_stream (source_stream, FALSE, error); } gboolean -install_bundle (XdgAppDir *dir, +install_bundle (FlatpakDir *dir, GOptionContext *context, int argc, char **argv, GCancellable *cancellable, @@ -125,11 +125,11 @@ install_bundle (XdgAppDir *dir, filename = argv[1]; - repo = xdg_app_dir_get_repo (dir); + repo = flatpak_dir_get_repo (dir); file = g_file_new_for_commandline_arg (filename); - metadata = xdg_app_bundle_load (file, &to_checksum, + metadata = flatpak_bundle_load (file, &to_checksum, &ref, &origin, NULL, @@ -146,18 +146,18 @@ install_bundle (XdgAppDir *dir, return FALSE; } - parts = xdg_app_decompose_ref (ref, error); + parts = flatpak_decompose_ref (ref, error); if (parts == NULL) return FALSE; - deploy_base = xdg_app_dir_get_deploy_dir (dir, ref); + deploy_base = flatpak_dir_get_deploy_dir (dir, ref); if (g_file_query_exists (deploy_base, cancellable)) - return xdg_app_fail (error, "%s branch %s already installed", parts[1], parts[3]); + return flatpak_fail (error, "%s branch %s already installed", parts[1], parts[3]); /* Add a remote for later updates */ basename = g_file_get_basename (file); - remote = xdg_app_dir_create_origin_remote (dir, + remote = flatpak_dir_create_origin_remote (dir, origin, parts[1], basename, @@ -170,10 +170,10 @@ install_bundle (XdgAppDir *dir, /* From here we need to goto out on error, to clean up */ added_remote = TRUE; - if (!xdg_app_dir_ensure_repo (dir, cancellable, error)) + if (!flatpak_dir_ensure_repo (dir, cancellable, error)) goto out; - if (!xdg_app_pull_from_bundle (xdg_app_dir_get_repo (dir), + if (!flatpak_pull_from_bundle (flatpak_dir_get_repo (dir), file, remote, ref, @@ -182,7 +182,7 @@ install_bundle (XdgAppDir *dir, error)) goto out; - if (!xdg_app_dir_deploy_install (dir, ref, remote, NULL, cancellable, error)) + if (!flatpak_dir_deploy_install (dir, ref, remote, NULL, cancellable, error)) goto out; ret = TRUE; @@ -195,10 +195,10 @@ out: } gboolean -xdg_app_builtin_install (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GFile) deploy_base = NULL; const char *repository; const char *name; @@ -210,7 +210,7 @@ xdg_app_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro context = g_option_context_new ("REPOSITORY NAME [BRANCH] - Install an application or runtime"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (opt_bundle) @@ -227,14 +227,14 @@ xdg_app_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro if (!opt_app && !opt_runtime) opt_app = opt_runtime = TRUE; - installed_ref = xdg_app_dir_find_installed_ref (dir, + installed_ref = flatpak_dir_find_installed_ref (dir, name, branch, opt_arch, opt_app, opt_runtime, &is_app, &my_error); if (installed_ref != NULL) - return xdg_app_fail (error, "%s %s, branch %s is already installed", + return flatpak_fail (error, "%s %s, branch %s is already installed", is_app ? "App" : "Runtime", name, branch ? branch : "master"); if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) @@ -243,16 +243,16 @@ xdg_app_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro return FALSE; } - ref = xdg_app_dir_find_remote_ref (dir, repository, name, branch, opt_arch, + ref = flatpak_dir_find_remote_ref (dir, repository, name, branch, opt_arch, opt_app, opt_runtime, &is_app, cancellable, error); if (ref == NULL) return FALSE; - deploy_base = xdg_app_dir_get_deploy_dir (dir, ref); + deploy_base = flatpak_dir_get_deploy_dir (dir, ref); if (g_file_query_exists (deploy_base, cancellable)) - return xdg_app_fail (error, "Ref %s already deployed", ref); + return flatpak_fail (error, "Ref %s already deployed", ref); - if (!xdg_app_dir_install (dir, + if (!flatpak_dir_install (dir, opt_no_pull, opt_no_deploy, ref, repository, opt_subpaths, diff --git a/app/xdg-app-builtins-list-remotes.c b/app/xdg-app-builtins-list-remotes.c index 7d1b6a4..3040e0d 100644 --- a/app/xdg-app-builtins-list-remotes.c +++ b/app/xdg-app-builtins-list-remotes.c @@ -45,18 +45,18 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) user_dir = NULL; - g_autoptr(XdgAppDir) system_dir = NULL; - XdgAppDir *dirs[2] = { 0 }; + g_autoptr(FlatpakDir) user_dir = NULL; + g_autoptr(FlatpakDir) system_dir = NULL; + FlatpakDir *dirs[2] = { 0 }; guint i = 0, n_dirs = 0, j; - XdgAppTablePrinter *printer; + FlatpakTablePrinter *printer; context = g_option_context_new (" - List remote repositories"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (!opt_user && !opt_system) @@ -64,24 +64,24 @@ xdg_app_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable, if (opt_user) { - user_dir = xdg_app_dir_get_user (); + user_dir = flatpak_dir_get_user (); dirs[n_dirs++] = user_dir; } if (opt_system) { - system_dir = xdg_app_dir_get_system (); + system_dir = flatpak_dir_get_system (); dirs[n_dirs++] = system_dir; } - printer = xdg_app_table_printer_new (); + printer = flatpak_table_printer_new (); for (j = 0; j < n_dirs; j++) { - XdgAppDir *dir = dirs[j]; + FlatpakDir *dir = dirs[j]; g_auto(GStrv) remotes = NULL; - remotes = xdg_app_dir_list_remotes (dir, cancellable, error); + remotes = flatpak_dir_list_remotes (dir, cancellable, error); if (remotes == NULL) return FALSE; @@ -90,7 +90,7 @@ xdg_app_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable, char *remote_name = remotes[i]; gboolean disabled; - disabled = xdg_app_dir_get_remote_disabled (dir, remote_name); + disabled = flatpak_dir_get_remote_disabled (dir, remote_name); if (disabled && !opt_show_disabled) continue; @@ -102,48 +102,48 @@ xdg_app_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable, g_autofree char *prio_as_string = NULL; gboolean gpg_verify = TRUE; - xdg_app_table_printer_add_column (printer, remote_name); + flatpak_table_printer_add_column (printer, remote_name); - title = xdg_app_dir_get_remote_title (dir, remote_name); + title = flatpak_dir_get_remote_title (dir, remote_name); if (title) - xdg_app_table_printer_add_column (printer, title); + flatpak_table_printer_add_column (printer, title); else - xdg_app_table_printer_add_column (printer, "-"); + flatpak_table_printer_add_column (printer, "-"); - ostree_repo_remote_get_url (xdg_app_dir_get_repo (dir), remote_name, &remote_url, NULL); + ostree_repo_remote_get_url (flatpak_dir_get_repo (dir), remote_name, &remote_url, NULL); - xdg_app_table_printer_add_column (printer, remote_url); + flatpak_table_printer_add_column (printer, remote_url); - prio = xdg_app_dir_get_remote_prio (dir, remote_name); + prio = flatpak_dir_get_remote_prio (dir, remote_name); prio_as_string = g_strdup_printf ("%d", prio); - xdg_app_table_printer_add_column (printer, prio_as_string); + flatpak_table_printer_add_column (printer, prio_as_string); - xdg_app_table_printer_add_column (printer, ""); /* Options */ + flatpak_table_printer_add_column (printer, ""); /* Options */ - ostree_repo_remote_get_gpg_verify (xdg_app_dir_get_repo (dir), remote_name, + ostree_repo_remote_get_gpg_verify (flatpak_dir_get_repo (dir), remote_name, &gpg_verify, NULL); if (!gpg_verify) - xdg_app_table_printer_append_with_comma (printer, "no-gpg-verify"); + flatpak_table_printer_append_with_comma (printer, "no-gpg-verify"); if (disabled) - xdg_app_table_printer_append_with_comma (printer, "disabled"); + flatpak_table_printer_append_with_comma (printer, "disabled"); - if (xdg_app_dir_get_remote_noenumerate (dir, remote_name)) - xdg_app_table_printer_append_with_comma (printer, "no-enumerate"); + if (flatpak_dir_get_remote_noenumerate (dir, remote_name)) + flatpak_table_printer_append_with_comma (printer, "no-enumerate"); if (opt_user && opt_system) - xdg_app_table_printer_append_with_comma (printer, dir == user_dir ? "user" : "system"); + flatpak_table_printer_append_with_comma (printer, dir == user_dir ? "user" : "system"); } else { - xdg_app_table_printer_add_column (printer, remote_name); + flatpak_table_printer_add_column (printer, remote_name); } - xdg_app_table_printer_finish_row (printer); + flatpak_table_printer_finish_row (printer); } } - xdg_app_table_printer_print (printer); - xdg_app_table_printer_free (printer); + flatpak_table_printer_print (printer); + flatpak_table_printer_free (printer); return TRUE; } diff --git a/app/xdg-app-builtins-list.c b/app/xdg-app-builtins-list.c index 5832d61..3d5c6a5 100644 --- a/app/xdg-app-builtins-list.c +++ b/app/xdg-app-builtins-list.c @@ -82,36 +82,36 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo g_auto(GStrv) user = NULL; g_auto(GStrv) user_app = NULL; g_auto(GStrv) user_runtime = NULL; - g_autoptr(XdgAppDir) user_dir = NULL; - g_autoptr(XdgAppDir) system_dir = NULL; + g_autoptr(FlatpakDir) user_dir = NULL; + g_autoptr(FlatpakDir) system_dir = NULL; int s, u; if (print_user) { - user_dir = xdg_app_dir_get (TRUE); + user_dir = flatpak_dir_get (TRUE); - if (xdg_app_dir_ensure_repo (user_dir, cancellable, NULL)) + if (flatpak_dir_ensure_repo (user_dir, cancellable, NULL)) { - if (app && !xdg_app_dir_list_refs (user_dir, "app", &user_app, cancellable, error)) + if (app && !flatpak_dir_list_refs (user_dir, "app", &user_app, cancellable, error)) return FALSE; - if (runtime && !xdg_app_dir_list_refs (user_dir, "runtime", &user_runtime, cancellable, error)) + if (runtime && !flatpak_dir_list_refs (user_dir, "runtime", &user_runtime, cancellable, error)) return FALSE; } } if (print_system) { - system_dir = xdg_app_dir_get (FALSE); - if (xdg_app_dir_ensure_repo (system_dir, cancellable, NULL)) + system_dir = flatpak_dir_get (FALSE); + if (flatpak_dir_ensure_repo (system_dir, cancellable, NULL)) { - if (app && !xdg_app_dir_list_refs (system_dir, "app", &system_app, cancellable, error)) + if (app && !flatpak_dir_list_refs (system_dir, "app", &system_app, cancellable, error)) return FALSE; - if (runtime && !xdg_app_dir_list_refs (system_dir, "runtime", &system_runtime, cancellable, error)) + if (runtime && !flatpak_dir_list_refs (system_dir, "runtime", &system_runtime, cancellable, error)) return FALSE; } } - XdgAppTablePrinter *printer = xdg_app_table_printer_new (); + FlatpakTablePrinter *printer = flatpak_table_printer_new (); user = join_strv (user_app, user_runtime); system = join_strv (system_app, system_runtime); @@ -122,7 +122,7 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo g_auto(GStrv) parts = NULL; const char *repo = NULL; gboolean is_user; - XdgAppDir *dir = NULL; + FlatpakDir *dir = NULL; g_autoptr(GVariant) deploy_data = NULL; if (system[s] == NULL) @@ -148,21 +148,21 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo parts = g_strsplit (ref, "/", -1); partial_ref = strchr (ref, '/') + 1; - deploy_data = xdg_app_dir_get_deploy_data (dir, ref, cancellable, error); + deploy_data = flatpak_dir_get_deploy_data (dir, ref, cancellable, error); if (deploy_data == NULL) return FALSE; - repo = xdg_app_deploy_data_get_origin (deploy_data); + repo = flatpak_deploy_data_get_origin (deploy_data); if (opt_show_details) { - g_autofree char *active = xdg_app_dir_read_active (dir, ref, NULL); + g_autofree char *active = flatpak_dir_read_active (dir, ref, NULL); g_autofree char *latest = NULL; g_autofree char *size_s = NULL; guint64 size = 0; g_autofree const char **subpaths = NULL; - latest = xdg_app_dir_read_latest (dir, repo, ref, NULL, NULL); + latest = flatpak_dir_read_latest (dir, repo, ref, NULL, NULL); if (latest) { if (strcmp (active, latest) == 0) @@ -180,75 +180,75 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo latest = g_strdup ("?"); } - xdg_app_table_printer_add_column (printer, partial_ref); - xdg_app_table_printer_add_column (printer, repo); + flatpak_table_printer_add_column (printer, partial_ref); + flatpak_table_printer_add_column (printer, repo); active[MIN (strlen (active), 12)] = 0; - xdg_app_table_printer_add_column (printer, active); - xdg_app_table_printer_add_column (printer, latest); + flatpak_table_printer_add_column (printer, active); + flatpak_table_printer_add_column (printer, latest); - size = xdg_app_deploy_data_get_installed_size (deploy_data); + size = flatpak_deploy_data_get_installed_size (deploy_data); size_s = g_format_size (size); - xdg_app_table_printer_add_column (printer, size_s); + flatpak_table_printer_add_column (printer, size_s); - xdg_app_table_printer_add_column (printer, ""); /* Options */ + flatpak_table_printer_add_column (printer, ""); /* Options */ if (print_user && print_system) - xdg_app_table_printer_append_with_comma (printer, is_user ? "user" : "system"); + flatpak_table_printer_append_with_comma (printer, is_user ? "user" : "system"); if (strcmp (parts[0], "app") == 0) { g_autofree char *current; - current = xdg_app_dir_current_ref (dir, parts[1], cancellable); + current = flatpak_dir_current_ref (dir, parts[1], cancellable); if (current && strcmp (ref, current) == 0) - xdg_app_table_printer_append_with_comma (printer, "current"); + flatpak_table_printer_append_with_comma (printer, "current"); } else { if (app) - xdg_app_table_printer_append_with_comma (printer, "runtime"); + flatpak_table_printer_append_with_comma (printer, "runtime"); } - subpaths = xdg_app_deploy_data_get_subpaths (deploy_data); + subpaths = flatpak_deploy_data_get_subpaths (deploy_data); if (subpaths[0] == NULL) { - xdg_app_table_printer_add_column (printer, ""); + flatpak_table_printer_add_column (printer, ""); } else { int i; - xdg_app_table_printer_add_column (printer, ""); /* subpaths */ + flatpak_table_printer_add_column (printer, ""); /* subpaths */ for (i = 0; subpaths[i] != NULL; i++) - xdg_app_table_printer_append_with_comma (printer, subpaths[i]); + flatpak_table_printer_append_with_comma (printer, subpaths[i]); } } else { if (last == NULL || strcmp (last, parts[1]) != 0) { - xdg_app_table_printer_add_column (printer, parts[1]); + flatpak_table_printer_add_column (printer, parts[1]); g_clear_pointer (&last, g_free); last = g_strdup (parts[1]); } } - xdg_app_table_printer_finish_row (printer); + flatpak_table_printer_finish_row (printer); } - xdg_app_table_printer_print (printer); - xdg_app_table_printer_free (printer); + flatpak_table_printer_print (printer); + flatpak_table_printer_free (printer); return TRUE; } gboolean -xdg_app_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; context = g_option_context_new (" - List installed apps and/or runtimes"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (!opt_app && !opt_runtime) diff --git a/app/xdg-app-builtins-ls-remote.c b/app/xdg-app-builtins-ls-remote.c index 9be0b81..4e186f0 100644 --- a/app/xdg-app-builtins-ls-remote.c +++ b/app/xdg-app-builtins-ls-remote.c @@ -45,10 +45,10 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GHashTable) refs = NULL; GHashTableIter iter; gpointer key; @@ -62,7 +62,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr context = g_option_context_new (" REMOTE - Show available runtimes and applications"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (!opt_app && !opt_runtime) @@ -74,7 +74,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr repository = argv[1]; - if (!xdg_app_dir_list_remote_refs (dir, + if (!flatpak_dir_list_remote_refs (dir, repository, &refs, cancellable, error)) @@ -82,7 +82,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - arch = xdg_app_get_arch (); + arch = flatpak_get_arch (); g_hash_table_iter_init (&iter, refs); while (g_hash_table_iter_next (&iter, &key, &value)) @@ -92,7 +92,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr const char *name = NULL; g_auto(GStrv) parts = NULL; - parts = xdg_app_decompose_ref (ref, NULL); + parts = flatpak_decompose_ref (ref, NULL); if (parts == NULL) { g_debug ("Invalid remote ref %s\n", ref); @@ -103,7 +103,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr { g_autofree char *deployed = NULL; - deployed = xdg_app_dir_read_active (dir, ref, cancellable); + deployed = flatpak_dir_read_active (dir, ref, cancellable); if (deployed == NULL) continue; @@ -133,7 +133,7 @@ xdg_app_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr } keys = (const char **) g_hash_table_get_keys_as_array (names, &n_keys); - g_qsort_with_data (keys, n_keys, sizeof (char *), (GCompareDataFunc) xdg_app_strcmp0_ptr, NULL); + g_qsort_with_data (keys, n_keys, sizeof (char *), (GCompareDataFunc) flatpak_strcmp0_ptr, NULL); for (i = 0; i < n_keys; i++) { diff --git a/app/xdg-app-builtins-make-current.c b/app/xdg-app-builtins-make-current.c index e434812..14c86a3 100644 --- a/app/xdg-app-builtins-make-current.c +++ b/app/xdg-app-builtins-make-current.c @@ -39,10 +39,10 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_make_current_app (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_make_current_app (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GFile) deploy_base = NULL; const char *app; const char *branch = "master"; @@ -51,7 +51,7 @@ xdg_app_builtin_make_current_app (int argc, char **argv, GCancellable *cancellab context = g_option_context_new ("APP BRANCH - Make branch of application current"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 3) @@ -60,27 +60,27 @@ xdg_app_builtin_make_current_app (int argc, char **argv, GCancellable *cancellab app = argv[1]; branch = argv[2]; - ref = xdg_app_compose_ref (TRUE, app, branch, opt_arch, error); + ref = flatpak_compose_ref (TRUE, app, branch, opt_arch, error); if (ref == NULL) return FALSE; - if (!xdg_app_dir_lock (dir, &lock, + if (!flatpak_dir_lock (dir, &lock, cancellable, error)) return FALSE; - deploy_base = xdg_app_dir_get_deploy_dir (dir, ref); + deploy_base = flatpak_dir_get_deploy_dir (dir, ref); if (!g_file_query_exists (deploy_base, cancellable)) - return xdg_app_fail (error, "App %s branch %s is not installed", app, branch); + return flatpak_fail (error, "App %s branch %s is not installed", app, branch); - if (!xdg_app_dir_make_current_ref (dir, ref, cancellable, error)) + if (!flatpak_dir_make_current_ref (dir, ref, cancellable, error)) return FALSE; - if (!xdg_app_dir_update_exports (dir, app, cancellable, error)) + if (!flatpak_dir_update_exports (dir, app, cancellable, error)) return FALSE; glnx_release_lock_file (&lock); - if (!xdg_app_dir_mark_changed (dir, error)) + if (!flatpak_dir_mark_changed (dir, error)) return FALSE; return TRUE; diff --git a/app/xdg-app-builtins-override.c b/app/xdg-app-builtins-override.c index eeff575..e707af2 100644 --- a/app/xdg-app-builtins-override.c +++ b/app/xdg-app-builtins-override.c @@ -39,22 +39,22 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_override (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_override (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; const char *app; - g_autoptr(XdgAppContext) arg_context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakContext) arg_context = NULL; + g_autoptr(FlatpakDir) dir = NULL; g_autoptr(GKeyFile) metakey = NULL; - g_autoptr(XdgAppContext) overrides = NULL; + g_autoptr(FlatpakContext) overrides = NULL; g_autoptr(GError) my_error = NULL; context = g_option_context_new ("APP - Override settings for application"); - arg_context = xdg_app_context_new (); - g_option_context_add_group (context, xdg_app_context_get_options (arg_context)); + arg_context = flatpak_context_new (); + g_option_context_add_group (context, flatpak_context_get_options (arg_context)); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 2) @@ -65,10 +65,10 @@ xdg_app_builtin_override (int argc, char **argv, GCancellable *cancellable, GErr app = argv[1]; - if (!xdg_app_is_valid_name (app)) - return xdg_app_fail (error, "'%s' is not a valid application name", app); + if (!flatpak_is_valid_name (app)) + return flatpak_fail (error, "'%s' is not a valid application name", app); - metakey = xdg_app_load_override_keyfile (app, xdg_app_dir_is_user (dir), &my_error); + metakey = flatpak_load_override_keyfile (app, flatpak_dir_is_user (dir), &my_error); if (metakey == NULL) { if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) @@ -79,15 +79,15 @@ xdg_app_builtin_override (int argc, char **argv, GCancellable *cancellable, GErr metakey = g_key_file_new (); } - overrides = xdg_app_context_new (); - if (!xdg_app_context_load_metadata (overrides, metakey, error)) + overrides = flatpak_context_new (); + if (!flatpak_context_load_metadata (overrides, metakey, error)) return FALSE; - xdg_app_context_merge (overrides, arg_context); + flatpak_context_merge (overrides, arg_context); - xdg_app_context_save_metadata (overrides, metakey); + flatpak_context_save_metadata (overrides, metakey); - if (!xdg_app_save_override_keyfile (metakey, app, xdg_app_dir_is_user (dir), error)) + if (!flatpak_save_override_keyfile (metakey, app, flatpak_dir_is_user (dir), error)) return FALSE; return TRUE; diff --git a/app/xdg-app-builtins-repo-update.c b/app/xdg-app-builtins-repo-update.c index 24c5bcc..378d380 100644 --- a/app/xdg-app-builtins-repo-update.c +++ b/app/xdg-app-builtins-repo-update.c @@ -49,7 +49,7 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_build_update_repo (int argc, char **argv, +flatpak_builtin_build_update_repo (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; @@ -60,7 +60,7 @@ xdg_app_builtin_build_update_repo (int argc, char **argv, context = g_option_context_new ("LOCATION - Update repository metadata"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (argc < 2) @@ -75,11 +75,11 @@ xdg_app_builtin_build_update_repo (int argc, char **argv, return FALSE; if (opt_title && - !xdg_app_repo_set_title (repo, opt_title, error)) + !flatpak_repo_set_title (repo, opt_title, error)) return FALSE; g_print ("Updating appstream branch\n"); - if (!xdg_app_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, &my_error)) + if (!flatpak_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, &my_error)) { if (g_error_matches (my_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)) { @@ -187,7 +187,7 @@ xdg_app_builtin_build_update_repo (int argc, char **argv, } g_print ("Updating summary\n"); - if (!xdg_app_repo_update (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, error)) + if (!flatpak_repo_update (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, cancellable, error)) return FALSE; if (opt_prune) diff --git a/app/xdg-app-builtins-run.c b/app/xdg-app-builtins-run.c index 42fd32b..377ae8d 100644 --- a/app/xdg-app-builtins-run.c +++ b/app/xdg-app-builtins-run.c @@ -57,16 +57,16 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDeploy) app_deploy = NULL; + g_autoptr(FlatpakDeploy) app_deploy = NULL; g_autofree char *app_ref = NULL; const char *app; const char *branch = "master"; int i; int rest_argv_start, rest_argc; - g_autoptr(XdgAppContext) arg_context = NULL; + g_autoptr(FlatpakContext) arg_context = NULL; context = g_option_context_new ("APP [args...] - Run an app"); @@ -83,10 +83,10 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** } } - arg_context = xdg_app_context_new (); - g_option_context_add_group (context, xdg_app_context_get_options (arg_context)); + arg_context = flatpak_context_new (); + g_option_context_add_group (context, flatpak_context_get_options (arg_context)); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error)) return FALSE; if (rest_argc == 0) @@ -99,32 +99,32 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** if (opt_branch == NULL && opt_arch == NULL) { - g_autoptr(XdgAppDir) user_dir = xdg_app_dir_get_user (); - g_autoptr(XdgAppDir) system_dir = xdg_app_dir_get_system (); + g_autoptr(FlatpakDir) user_dir = flatpak_dir_get_user (); + g_autoptr(FlatpakDir) system_dir = flatpak_dir_get_system (); - app_ref = xdg_app_dir_current_ref (user_dir, app, cancellable); + app_ref = flatpak_dir_current_ref (user_dir, app, cancellable); if (app_ref == NULL) - app_ref = xdg_app_dir_current_ref (system_dir, app, cancellable); + app_ref = flatpak_dir_current_ref (system_dir, app, cancellable); } if (app_ref == NULL) { - app_ref = xdg_app_compose_ref (TRUE, app, branch, opt_arch, error); + app_ref = flatpak_compose_ref (TRUE, app, branch, opt_arch, error); if (app_ref == NULL) return FALSE; } - app_deploy = xdg_app_find_deploy_for_ref (app_ref, cancellable, error); + app_deploy = flatpak_find_deploy_for_ref (app_ref, cancellable, error); if (app_deploy == NULL) return FALSE; - if (!xdg_app_run_app (app_ref, app_deploy, + if (!flatpak_run_app (app_ref, app_deploy, arg_context, opt_runtime, opt_runtime_version, - (opt_devel ? XDG_APP_RUN_FLAG_DEVEL : 0) | - (opt_log_session_bus ? XDG_APP_RUN_FLAG_LOG_SESSION_BUS : 0) | - (opt_log_system_bus ? XDG_APP_RUN_FLAG_LOG_SYSTEM_BUS : 0), + (opt_devel ? FLATPAK_RUN_FLAG_DEVEL : 0) | + (opt_log_session_bus ? FLATPAK_RUN_FLAG_LOG_SESSION_BUS : 0) | + (opt_log_system_bus ? FLATPAK_RUN_FLAG_LOG_SYSTEM_BUS : 0), opt_command, &argv[rest_argv_start + 1], rest_argc - 1, diff --git a/app/xdg-app-builtins-uninstall.c b/app/xdg-app-builtins-uninstall.c index 75279f8..41ad74c 100644 --- a/app/xdg-app-builtins-uninstall.c +++ b/app/xdg-app-builtins-uninstall.c @@ -47,10 +47,10 @@ static GOptionEntry options[] = { }; gboolean -xdg_app_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GError **error) +flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; const char *name = NULL; const char *branch = NULL; g_autofree char *ref = NULL; @@ -62,7 +62,7 @@ xdg_app_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr context = g_option_context_new ("APP [BRANCH] - Uninstall an application"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 2) @@ -75,7 +75,7 @@ xdg_app_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr if (!opt_app && !opt_runtime) opt_app = opt_runtime = TRUE; - ref = xdg_app_dir_find_installed_ref (dir, + ref = flatpak_dir_find_installed_ref (dir, name, branch, opt_arch, @@ -86,33 +86,33 @@ xdg_app_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr /* TODO: when removing runtimes, look for apps that use it, require --force */ - if (!xdg_app_dir_lock (dir, &lock, + if (!flatpak_dir_lock (dir, &lock, cancellable, error)) return FALSE; - repository = xdg_app_dir_get_origin (dir, ref, cancellable, NULL); + repository = flatpak_dir_get_origin (dir, ref, cancellable, NULL); g_debug ("dropping active ref"); - if (!xdg_app_dir_set_active (dir, ref, NULL, cancellable, error)) + if (!flatpak_dir_set_active (dir, ref, NULL, cancellable, error)) return FALSE; if (is_app) { - current_ref = xdg_app_dir_current_ref (dir, name, cancellable); + current_ref = flatpak_dir_current_ref (dir, name, cancellable); if (current_ref != NULL && strcmp (ref, current_ref) == 0) { g_debug ("dropping current ref"); - if (!xdg_app_dir_drop_current_ref (dir, name, cancellable, error)) + if (!flatpak_dir_drop_current_ref (dir, name, cancellable, error)) return FALSE; } } - if (!xdg_app_dir_undeploy_all (dir, ref, opt_force_remove, &was_deployed, cancellable, error)) + if (!flatpak_dir_undeploy_all (dir, ref, opt_force_remove, &was_deployed, cancellable, error)) return FALSE; if (!opt_keep_ref) { - if (!xdg_app_dir_remove_ref (dir, repository, ref, cancellable, error)) + if (!flatpak_dir_remove_ref (dir, repository, ref, cancellable, error)) return FALSE; } @@ -120,28 +120,28 @@ xdg_app_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr if (!opt_keep_ref) { - if (!xdg_app_dir_prune (dir, cancellable, error)) + if (!flatpak_dir_prune (dir, cancellable, error)) return FALSE; } - xdg_app_dir_cleanup_removed (dir, cancellable, NULL); + flatpak_dir_cleanup_removed (dir, cancellable, NULL); if (is_app) { - if (!xdg_app_dir_update_exports (dir, name, cancellable, error)) + if (!flatpak_dir_update_exports (dir, name, cancellable, error)) return FALSE; } if (repository != NULL && g_str_has_suffix (repository, "-origin") && - xdg_app_dir_get_remote_noenumerate (dir, repository)) - ostree_repo_remote_delete (xdg_app_dir_get_repo (dir), repository, NULL, NULL); + flatpak_dir_get_remote_noenumerate (dir, repository)) + ostree_repo_remote_delete (flatpak_dir_get_repo (dir), repository, NULL, NULL); - if (!xdg_app_dir_mark_changed (dir, error)) + if (!flatpak_dir_mark_changed (dir, error)) return FALSE; if (!was_deployed) - return xdg_app_fail (error, "Nothing to uninstall"); + return flatpak_fail (error, "Nothing to uninstall"); return TRUE; } diff --git a/app/xdg-app-builtins-update.c b/app/xdg-app-builtins-update.c index 727d2e2..9918942 100644 --- a/app/xdg-app-builtins-update.c +++ b/app/xdg-app-builtins-update.c @@ -55,11 +55,11 @@ static GOptionEntry options[] = { }; static gboolean -update_appstream (XdgAppDir *dir, const char *remote, GCancellable *cancellable, GError **error) +update_appstream (FlatpakDir *dir, const char *remote, GCancellable *cancellable, GError **error) { gboolean changed; - if (!xdg_app_dir_update_appstream (dir, remote, opt_arch, &changed, + if (!flatpak_dir_update_appstream (dir, remote, opt_arch, &changed, NULL, cancellable, error)) return FALSE; @@ -67,7 +67,7 @@ update_appstream (XdgAppDir *dir, const char *remote, GCancellable *cancellable, } static gboolean -do_update (XdgAppDir * dir, +do_update (FlatpakDir * dir, const char *name, const char *branch, const char *arch, @@ -82,7 +82,7 @@ do_update (XdgAppDir * dir, g_auto(GStrv) subpaths = NULL; gboolean is_app; - ref = xdg_app_dir_find_installed_ref (dir, + ref = flatpak_dir_find_installed_ref (dir, name, branch, arch, @@ -91,18 +91,18 @@ do_update (XdgAppDir * dir, if (ref == NULL) return FALSE; - repository = xdg_app_dir_get_origin (dir, ref, cancellable, error); + repository = flatpak_dir_get_origin (dir, ref, cancellable, error); if (repository == NULL) return FALSE; - if (xdg_app_dir_get_remote_disabled (dir, repository)) + if (flatpak_dir_get_remote_disabled (dir, repository)) g_print ("Not updating %s due to disabled remote %s\n", ref, repository); - subpaths = xdg_app_dir_get_subpaths (dir, ref, cancellable, error); + subpaths = flatpak_dir_get_subpaths (dir, ref, cancellable, error); if (subpaths == NULL) return FALSE; - if (!xdg_app_dir_update (dir, + if (!flatpak_dir_update (dir, opt_no_pull, opt_no_deploy, ref, repository, opt_commit, opt_subpaths, @@ -114,13 +114,13 @@ do_update (XdgAppDir * dir, } gboolean -xdg_app_builtin_update (int argc, +flatpak_builtin_update (int argc, char **argv, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; const char *name = NULL; const char *branch = NULL; const char *arch = opt_arch; @@ -128,7 +128,7 @@ xdg_app_builtin_update (int argc, context = g_option_context_new ("[NAME [BRANCH]] - Update an application or runtime"); - if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) + if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error)) return FALSE; if (argc < 1) @@ -140,7 +140,7 @@ xdg_app_builtin_update (int argc, branch = argv[2]; if (arch == NULL) - arch = xdg_app_get_arch (); + arch = flatpak_get_arch (); if (!opt_app && !opt_runtime) opt_app = opt_runtime = TRUE; @@ -154,14 +154,14 @@ xdg_app_builtin_update (int argc, { g_auto(GStrv) refs = NULL; - if (!xdg_app_dir_list_refs (dir, "app", &refs, + if (!flatpak_dir_list_refs (dir, "app", &refs, cancellable, error)) return FALSE; for (i = 0; refs != NULL && refs[i] != NULL; i++) { - g_auto(GStrv) parts = xdg_app_decompose_ref (refs[i], error); + g_auto(GStrv) parts = flatpak_decompose_ref (refs[i], error); if (parts == NULL) return FALSE; @@ -188,14 +188,14 @@ xdg_app_builtin_update (int argc, { g_auto(GStrv) refs = NULL; - if (!xdg_app_dir_list_refs (dir, "runtime", &refs, + if (!flatpak_dir_list_refs (dir, "runtime", &refs, cancellable, error)) return FALSE; for (i = 0; refs != NULL && refs[i] != NULL; i++) { - g_auto(GStrv) parts = xdg_app_decompose_ref (refs[i], error); + g_auto(GStrv) parts = flatpak_decompose_ref (refs[i], error); if (parts == NULL) return FALSE; @@ -230,7 +230,7 @@ xdg_app_builtin_update (int argc, return FALSE; } - xdg_app_dir_cleanup_removed (dir, cancellable, NULL); + flatpak_dir_cleanup_removed (dir, cancellable, NULL); return TRUE; } diff --git a/app/xdg-app-builtins.h b/app/xdg-app-builtins.h index 380316c..71af4b4 100644 --- a/app/xdg-app-builtins.h +++ b/app/xdg-app-builtins.h @@ -18,8 +18,8 @@ * Alexander Larsson <alexl@redhat.com> */ -#ifndef __XDG_APP_BUILTINS_H__ -#define __XDG_APP_BUILTINS_H__ +#ifndef __FLATPAK_BUILTINS_H__ +#define __FLATPAK_BUILTINS_H__ #include <ostree.h> #include <gio/gio.h> @@ -29,16 +29,16 @@ G_BEGIN_DECLS typedef enum { - XDG_APP_BUILTIN_FLAG_NO_DIR = 1 << 0, - XDG_APP_BUILTIN_FLAG_NO_REPO = 1 << 1, -} XdgAppBuiltinFlags; + FLATPAK_BUILTIN_FLAG_NO_DIR = 1 << 0, + FLATPAK_BUILTIN_FLAG_NO_REPO = 1 << 1, +} FlatpakBuiltinFlags; -gboolean xdg_app_option_context_parse (GOptionContext *context, +gboolean flatpak_option_context_parse (GOptionContext *context, const GOptionEntry *main_entries, int *argc, char ***argv, - XdgAppBuiltinFlags flags, - XdgAppDir **out_dir, + FlatpakBuiltinFlags flags, + FlatpakDir **out_dir, GCancellable *cancellable, GError **error); @@ -46,7 +46,7 @@ gboolean usage_error (GOptionContext *context, const char *message, GError **error); -#define BUILTINPROTO(name) gboolean xdg_app_builtin_ ## name (int argc, char **argv, GCancellable * cancellable, GError * *error) +#define BUILTINPROTO(name) gboolean flatpak_builtin_ ## name (int argc, char **argv, GCancellable * cancellable, GError * *error) BUILTINPROTO (add_remote); BUILTINPROTO (modify_remote); @@ -77,4 +77,4 @@ BUILTINPROTO (override); G_END_DECLS -#endif /* __XDG_APP_BUILTINS_H__ */ +#endif /* __FLATPAK_BUILTINS_H__ */ diff --git a/app/xdg-app-main.c b/app/xdg-app-main.c index da50cef..5acdbc8 100644 --- a/app/xdg-app-main.c +++ b/app/xdg-app-main.c @@ -46,39 +46,39 @@ typedef struct GError **error); const char *description; gboolean deprecated; -} XdgAppCommand; +} FlatpakCommand; -static XdgAppCommand commands[] = { +static FlatpakCommand commands[] = { { " Manage installed apps and runtimes" }, - { "install", xdg_app_builtin_install, "Install an application or runtime from a remote"}, - { "update", xdg_app_builtin_update, "Update an installed application or runtime"}, - { "uninstall", xdg_app_builtin_uninstall, "Uninstall an installed application or runtime" }, - { "list", xdg_app_builtin_list, "List installed apps and/or runtimes" }, - { "info", xdg_app_builtin_info, "Show info for installed app or runtime" }, + { "install", flatpak_builtin_install, "Install an application or runtime from a remote"}, + { "update", flatpak_builtin_update, "Update an installed application or runtime"}, + { "uninstall", flatpak_builtin_uninstall, "Uninstall an installed application or runtime" }, + { "list", flatpak_builtin_list, "List installed apps and/or runtimes" }, + { "info", flatpak_builtin_info, "Show info for installed app or runtime" }, { "\n Running applications" }, - { "run", xdg_app_builtin_run, "Run an application" }, - { "override", xdg_app_builtin_override, "Override permissions for an application" }, - { "export-file", xdg_app_builtin_export_file, "Grant an application access to a specific file" }, - { "make-current", xdg_app_builtin_make_current_app, "Specify default version to run" }, - { "enter", xdg_app_builtin_enter, "Enter the namespace of a running application" }, + { "run", flatpak_builtin_run, "Run an application" }, + { "override", flatpak_builtin_override, "Override permissions for an application" }, + { "export-file", flatpak_builtin_export_file, "Grant an application access to a specific file" }, + { "make-current", flatpak_builtin_make_current_app, "Specify default version to run" }, + { "enter", flatpak_builtin_enter, "Enter the namespace of a running application" }, { "\n Manage remote repositories" }, - { "remote-add", xdg_app_builtin_add_remote, "Add a new remote repository (by URL)" }, - { "remote-modify", xdg_app_builtin_modify_remote, "Modify properties of a configured remote" }, - { "remote-delete", xdg_app_builtin_delete_remote, "Delete a configured remote" }, - { "remote-list", xdg_app_builtin_list_remotes, "List all configured remotes" }, - { "remote-ls", xdg_app_builtin_ls_remote, "List contents of a configured remote" }, + { "remote-add", flatpak_builtin_add_remote, "Add a new remote repository (by URL)" }, + { "remote-modify", flatpak_builtin_modify_remote, "Modify properties of a configured remote" }, + { "remote-delete", flatpak_builtin_delete_remote, "Delete a configured remote" }, + { "remote-list", flatpak_builtin_list_remotes, "List all configured remotes" }, + { "remote-ls", flatpak_builtin_ls_remote, "List contents of a configured remote" }, { "\n Build applications" }, - { "build-init", xdg_app_builtin_build_init, "Initialize a directory for building" }, - { "build", xdg_app_builtin_build, "Run a build command inside the build dir" }, - { "build-finish", xdg_app_builtin_build_finish, "Finish a build dir for export" }, - { "build-export", xdg_app_builtin_build_export, "Export a build dir to a repository" }, - { "build-bundle", xdg_app_builtin_build_bundle, "Create a bundle file from a build directory" }, - { "build-import-bundle", xdg_app_builtin_build_import, "Import a bundle file" }, - { "build-sign", xdg_app_builtin_build_sign, "Sign an application or runtime" }, - { "build-update-repo", xdg_app_builtin_build_update_repo, "Update the summary file in a repository" }, + { "build-init", flatpak_builtin_build_init, "Initialize a directory for building" }, + { "build", flatpak_builtin_build, "Run a build command inside the build dir" }, + { "build-finish", flatpak_builtin_build_finish, "Finish a build dir for export" }, + { "build-export", flatpak_builtin_build_export, "Export a build dir to a repository" }, + { "build-bundle", flatpak_builtin_build_bundle, "Create a bundle file from a build directory" }, + { "build-import-bundle", flatpak_builtin_build_import, "Import a bundle file" }, + { "build-sign", flatpak_builtin_build_sign, "Sign an application or runtime" }, + { "build-update-repo", flatpak_builtin_build_update_repo, "Update the summary file in a repository" }, { NULL } }; @@ -110,7 +110,7 @@ message_handler (const gchar *log_domain, } GOptionContext * -xdg_app_option_context_new_with_commands (XdgAppCommand *commands) +flatpak_option_context_new_with_commands (FlatpakCommand *commands) { GOptionContext *context; GString *summary; @@ -145,13 +145,13 @@ xdg_app_option_context_new_with_commands (XdgAppCommand *commands) } int -xdg_app_usage (XdgAppCommand *commands, - gboolean is_error) +flatpak_usage (FlatpakCommand *commands, + gboolean is_error) { GOptionContext *context; g_autofree char *help; - context = xdg_app_option_context_new_with_commands (commands); + context = flatpak_option_context_new_with_commands (commands); g_option_context_add_main_entries (context, global_entries, NULL); @@ -168,18 +168,18 @@ xdg_app_usage (XdgAppCommand *commands, } gboolean -xdg_app_option_context_parse (GOptionContext *context, +flatpak_option_context_parse (GOptionContext *context, const GOptionEntry *main_entries, int *argc, char ***argv, - XdgAppBuiltinFlags flags, - XdgAppDir **out_dir, + FlatpakBuiltinFlags flags, + FlatpakDir **out_dir, GCancellable *cancellable, GError **error) { - g_autoptr(XdgAppDir) dir = NULL; + g_autoptr(FlatpakDir) dir = NULL; - if (!(flags & XDG_APP_BUILTIN_FLAG_NO_DIR)) + if (!(flags & FLATPAK_BUILTIN_FLAG_NO_DIR)) g_option_context_add_main_entries (context, user_entries, NULL); if (main_entries != NULL) @@ -198,19 +198,19 @@ xdg_app_option_context_parse (GOptionContext *context, if (opt_default_arch) { - g_print ("%s\n", xdg_app_get_arch ()); + g_print ("%s\n", flatpak_get_arch ()); exit (EXIT_SUCCESS); } - if (!(flags & XDG_APP_BUILTIN_FLAG_NO_DIR)) + if (!(flags & FLATPAK_BUILTIN_FLAG_NO_DIR)) { - dir = xdg_app_dir_get (opt_user); + dir = flatpak_dir_get (opt_user); - if (!xdg_app_dir_ensure_path (dir, cancellable, error)) + if (!flatpak_dir_ensure_path (dir, cancellable, error)) return FALSE; - if (!(flags & XDG_APP_BUILTIN_FLAG_NO_REPO) && - !xdg_app_dir_ensure_repo (dir, cancellable, error)) + if (!(flags & FLATPAK_BUILTIN_FLAG_NO_REPO) && + !flatpak_dir_ensure_repo (dir, cancellable, error)) return FALSE; } @@ -234,11 +234,11 @@ usage_error (GOptionContext *context, const char *message, GError **error) } int -xdg_app_run (int argc, +flatpak_run (int argc, char **argv, GError **res_error) { - XdgAppCommand *command; + FlatpakCommand *command; GError *error = NULL; GCancellable *cancellable = NULL; const char *command_name = NULL; @@ -283,10 +283,10 @@ xdg_app_run (int argc, GOptionContext *context; g_autofree char *help; - context = xdg_app_option_context_new_with_commands (commands); + context = flatpak_option_context_new_with_commands (commands); /* This will not return for some options (e.g. --version). */ - if (xdg_app_option_context_parse (context, NULL, &argc, &argv, XDG_APP_BUILTIN_FLAG_NO_DIR, NULL, cancellable, &error)) + if (flatpak_option_context_parse (context, NULL, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, &error)) { if (command_name == NULL) g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, @@ -345,9 +345,9 @@ main (int argc, else g_unsetenv ("GIO_USE_VFS"); - ret = xdg_app_run (argc, argv, &error); + ret = flatpak_run (argc, argv, &error); if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) - xdg_app_usage (commands, TRUE); + flatpak_usage (commands, TRUE); if (error != NULL) { |