mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-22 06:38:16 -05:00
The plural of appdata is appstream
This commit is contained in:
@@ -68,8 +68,8 @@ xdg_app_builtin_build_update_repo (int argc, char **argv, GCancellable *cancella
|
||||
!xdg_app_repo_set_title (repo, opt_title, error))
|
||||
return FALSE;
|
||||
|
||||
g_print ("Updating appdata branch\n");
|
||||
if (!xdg_app_repo_generate_appdata (repo, cancellable, &my_error))
|
||||
g_print ("Updating appstream branch\n");
|
||||
if (!xdg_app_repo_generate_appstream (repo, cancellable, &my_error))
|
||||
{
|
||||
if (g_error_matches (my_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
|
||||
g_print ("WARNING: Can't find appstream-builder, unable to update appstream branch\n");
|
||||
|
||||
@@ -38,7 +38,7 @@ static gboolean opt_no_pull;
|
||||
static gboolean opt_no_deploy;
|
||||
static gboolean opt_runtime;
|
||||
static gboolean opt_app;
|
||||
static gboolean opt_appdata;
|
||||
static gboolean opt_appstream;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "arch", 0, 0, G_OPTION_ARG_STRING, &opt_arch, "Arch to update for", "ARCH" },
|
||||
@@ -48,15 +48,15 @@ static GOptionEntry options[] = {
|
||||
{ "no-deploy", 0, 0, G_OPTION_ARG_NONE, &opt_no_deploy, "Don't deploy, only download to local cache", },
|
||||
{ "runtime", 0, 0, G_OPTION_ARG_NONE, &opt_runtime, "Look for runtime with the specified name", },
|
||||
{ "app", 0, 0, G_OPTION_ARG_NONE, &opt_app, "Look for app with the specified name", },
|
||||
{ "appdata", 0, 0, G_OPTION_ARG_NONE, &opt_appdata, "Update appdata for remote", },
|
||||
{ "appstream", 0, 0, G_OPTION_ARG_NONE, &opt_appstream, "Update appstream for remote", },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static gboolean
|
||||
update_appdata (XdgAppDir *dir, const char *remote, GCancellable *cancellable, GError **error)
|
||||
update_appstream (XdgAppDir *dir, const char *remote, GCancellable *cancellable, GError **error)
|
||||
{
|
||||
gboolean changed;
|
||||
if (!xdg_app_dir_update_appdata (dir, remote, opt_arch, &changed,
|
||||
if (!xdg_app_dir_update_appstream (dir, remote, opt_arch, &changed,
|
||||
NULL, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
@@ -91,8 +91,8 @@ xdg_app_builtin_update (int argc, char **argv, GCancellable *cancellable, GError
|
||||
if (!opt_app && !opt_runtime)
|
||||
opt_app = opt_runtime = TRUE;
|
||||
|
||||
if (opt_appdata)
|
||||
return update_appdata (dir, name, cancellable, error);
|
||||
if (opt_appstream)
|
||||
return update_appstream (dir, name, cancellable, error);
|
||||
|
||||
ref = xdg_app_dir_find_installed_ref (dir,
|
||||
name,
|
||||
|
||||
@@ -593,20 +593,20 @@ xdg_app_dir_mark_changed (XdgAppDir *self,
|
||||
}
|
||||
|
||||
gboolean
|
||||
xdg_app_dir_update_appdata (XdgAppDir *self,
|
||||
const char *remote,
|
||||
const char *arch,
|
||||
gboolean *out_changed,
|
||||
OstreeAsyncProgress *progress,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
xdg_app_dir_update_appstream (XdgAppDir *self,
|
||||
const char *remote,
|
||||
const char *arch,
|
||||
gboolean *out_changed,
|
||||
OstreeAsyncProgress *progress,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autofree char *branch = NULL;
|
||||
g_autofree char *remote_and_branch = NULL;
|
||||
g_autofree char *old_checksum = NULL;
|
||||
g_autofree char *new_checksum = NULL;
|
||||
g_autoptr(GFile) root = NULL;
|
||||
g_autoptr(GFile) appdata_dir = NULL;
|
||||
g_autoptr(GFile) appstream_dir = NULL;
|
||||
g_autoptr(GFile) remote_dir = NULL;
|
||||
g_autoptr(GFile) arch_dir = NULL;
|
||||
g_autoptr(GFile) checkout_dir = NULL;
|
||||
@@ -624,7 +624,7 @@ xdg_app_dir_update_appdata (XdgAppDir *self,
|
||||
if (arch == NULL)
|
||||
arch = xdg_app_get_arch ();
|
||||
|
||||
branch = g_strdup_printf ("appdata/%s", arch);
|
||||
branch = g_strdup_printf ("appstream/%s", arch);
|
||||
remote_and_branch = g_strdup_printf ("%s:%s", remote, branch);
|
||||
|
||||
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &old_checksum, error))
|
||||
@@ -637,8 +637,8 @@ xdg_app_dir_update_appdata (XdgAppDir *self,
|
||||
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &new_checksum, error))
|
||||
return FALSE;
|
||||
|
||||
appdata_dir = g_file_get_child (xdg_app_dir_get_path (self), "appdata");
|
||||
remote_dir = g_file_get_child (appdata_dir, remote);
|
||||
appstream_dir = g_file_get_child (xdg_app_dir_get_path (self), "appstream");
|
||||
remote_dir = g_file_get_child (appstream_dir, remote);
|
||||
arch_dir = g_file_get_child (remote_dir, arch);
|
||||
checkout_dir = g_file_get_child (arch_dir, new_checksum);
|
||||
old_checkout_dir = g_file_get_child (arch_dir, old_checksum);
|
||||
@@ -691,7 +691,7 @@ xdg_app_dir_update_appdata (XdgAppDir *self,
|
||||
|
||||
if (g_strcmp0 (old_checksum, new_checksum) != 0 &&
|
||||
!gs_shutil_rm_rf (old_checkout_dir, cancellable, &tmp_error))
|
||||
g_warning ("Unable to remove old appdata checkout: %s\n", tmp_error->message);
|
||||
g_warning ("Unable to remove old appstream checkout: %s\n", tmp_error->message);
|
||||
|
||||
if (out_changed)
|
||||
*out_changed = TRUE;
|
||||
|
||||
@@ -130,7 +130,7 @@ gboolean xdg_app_dir_ensure_repo (XdgAppDir *self,
|
||||
GError **error);
|
||||
gboolean xdg_app_dir_mark_changed (XdgAppDir *self,
|
||||
GError **error);
|
||||
gboolean xdg_app_dir_update_appdata (XdgAppDir *self,
|
||||
gboolean xdg_app_dir_update_appstream(XdgAppDir *self,
|
||||
const char *remote,
|
||||
const char *arch,
|
||||
gboolean *out_changed,
|
||||
|
||||
@@ -1379,9 +1379,9 @@ commit_filter (OstreeRepo *repo,
|
||||
}
|
||||
|
||||
gboolean
|
||||
xdg_app_repo_generate_appdata (OstreeRepo *repo,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
xdg_app_repo_generate_appstream (OstreeRepo *repo,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GHashTable) all_refs = NULL;
|
||||
g_autoptr(GHashTable) arches = NULL;
|
||||
@@ -1422,7 +1422,7 @@ xdg_app_repo_generate_appdata (OstreeRepo *repo,
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
const char *arch = key;
|
||||
g_autofree char *tmpdir = g_strdup ("/tmp/xdg-app-appdata-XXXXXX");
|
||||
g_autofree char *tmpdir = g_strdup ("/tmp/xdg-app-appstream-XXXXXX");
|
||||
g_autoptr(XdgAppTempDir) tmpdir_file = NULL;
|
||||
g_autofree char *repo_path = NULL;
|
||||
g_autofree char *repo_arg = NULL;
|
||||
@@ -1449,7 +1449,7 @@ xdg_app_repo_generate_appdata (OstreeRepo *repo,
|
||||
icon_arg = g_strdup_printf ("--icons-dir=%s/icons", tmpdir);
|
||||
|
||||
if (!appstream_builder (error,
|
||||
"--basename=appdata",
|
||||
"--basename=appstream",
|
||||
"--origin=xdg-app",
|
||||
"--uncompressed-icons",
|
||||
"--enable-hidpi",
|
||||
@@ -1463,7 +1463,7 @@ xdg_app_repo_generate_appdata (OstreeRepo *repo,
|
||||
if (!ostree_repo_prepare_transaction (repo, NULL, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
branch = g_strdup_printf ("appdata/%s", arch);
|
||||
branch = g_strdup_printf ("appstream/%s", arch);
|
||||
|
||||
if (!ostree_repo_resolve_rev (repo, branch, TRUE, &parent, error))
|
||||
return FALSE;
|
||||
|
||||
@@ -176,9 +176,9 @@ gboolean xdg_app_repo_set_title (OstreeRepo *repo,
|
||||
gboolean xdg_app_repo_update (OstreeRepo *repo,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
gboolean xdg_app_repo_generate_appdata (OstreeRepo *repo,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
gboolean xdg_app_repo_generate_appstream (OstreeRepo *repo,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean xdg_app_spawn (GFile *dir,
|
||||
char **output,
|
||||
|
||||
@@ -1123,20 +1123,20 @@ no_progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
|
||||
}
|
||||
|
||||
/**
|
||||
* xdg_app_installation_update_appdata_sync:
|
||||
* xdg_app_installation_update_appstream_sync:
|
||||
* @self: a #XdgAppInstallation
|
||||
* @remote_name: the name of the remote
|
||||
* @arch: Architecture to update, or %NULL for the local machine arch
|
||||
* @out_changed: (nullable): Set to %TRUE if the contents of the appdata changed, %FALSE if nothing changed
|
||||
* @out_changed: (nullable): Set to %TRUE if the contents of the appstream changed, %FALSE if nothing changed
|
||||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Updates the local copy of appdata for @remote_name for the specified @arch.
|
||||
* Updates the local copy of appstream for @remote_name for the specified @arch.
|
||||
*
|
||||
* Returns: %TRUE on success, or %FALSE on error
|
||||
*/
|
||||
gboolean
|
||||
xdg_app_installation_update_appdata_sync (XdgAppInstallation *self,
|
||||
xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *arch,
|
||||
gboolean *out_changed,
|
||||
@@ -1151,13 +1151,13 @@ xdg_app_installation_update_appdata_sync (XdgAppInstallation *self,
|
||||
dir_clone = xdg_app_dir_clone (priv->dir);
|
||||
|
||||
ostree_progress = ostree_async_progress_new_and_connect (no_progress_cb, NULL);
|
||||
return xdg_app_dir_update_appdata (dir_clone,
|
||||
remote_name,
|
||||
arch,
|
||||
out_changed,
|
||||
ostree_progress,
|
||||
cancellable,
|
||||
error);
|
||||
return xdg_app_dir_update_appstream (dir_clone,
|
||||
remote_name,
|
||||
arch,
|
||||
out_changed,
|
||||
ostree_progress,
|
||||
cancellable,
|
||||
error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -163,7 +163,7 @@ XDG_APP_EXTERN XdgAppRemoteRef *xdg_app_installation_fetch_remote_ref_sync
|
||||
const char *branch,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
XDG_APP_EXTERN gboolean xdg_app_installation_update_appdata_sync (XdgAppInstallation *self,
|
||||
XDG_APP_EXTERN gboolean xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *arch,
|
||||
gboolean *out_changed,
|
||||
|
||||
Reference in New Issue
Block a user