forked from Mirrors/flatpak-builder
lib: Always use "branch" not "version" in API
"version" is really confusintingping/wmclass
parent
4ea61d3830
commit
dd7f18aaf2
|
@ -76,7 +76,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(ref)),
|
||||
xdg_app_installed_ref_get_origin (ref),
|
||||
xdg_app_installed_ref_get_deploy_dir (ref),
|
||||
|
@ -100,7 +100,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(app)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(app)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(app)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(app)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(app)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(app)),
|
||||
xdg_app_installed_ref_get_origin (app),
|
||||
xdg_app_installed_ref_get_deploy_dir (app),
|
||||
|
@ -124,7 +124,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(runtime)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(runtime)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(runtime)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(runtime)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(runtime)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(runtime)),
|
||||
xdg_app_installed_ref_get_origin (runtime),
|
||||
xdg_app_installed_ref_get_deploy_dir (runtime),
|
||||
|
@ -143,7 +143,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(app1)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(app1)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(app1)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(app1)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(app1)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(app1)),
|
||||
xdg_app_installed_ref_get_origin (app1),
|
||||
xdg_app_installed_ref_get_deploy_dir (app1),
|
||||
|
@ -160,7 +160,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(app2)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(app2)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(app2)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(app2)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(app2)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(app2)),
|
||||
xdg_app_installed_ref_get_origin (app2),
|
||||
xdg_app_installed_ref_get_deploy_dir (app2),
|
||||
|
@ -192,7 +192,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(ref)),
|
||||
xdg_app_remote_ref_get_remote_name (ref));
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_kind (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_ref_get_name (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(remote_ref)),
|
||||
xdg_app_remote_ref_get_remote_name (remote_ref));
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ get_ref (XdgAppInstallation *self,
|
|||
* @kind: ...
|
||||
* @name: ...
|
||||
* @arch: ...
|
||||
* @version: ...
|
||||
* @branch: ...
|
||||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
|
@ -195,7 +195,7 @@ xdg_app_installation_get_installed_ref (XdgAppInstallation *self,
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -207,9 +207,9 @@ xdg_app_installation_get_installed_ref (XdgAppInstallation *self,
|
|||
arch = xdg_app_get_arch ();
|
||||
|
||||
if (kind == XDG_APP_REF_KIND_APP)
|
||||
ref = xdg_app_build_app_ref (name, version, arch);
|
||||
ref = xdg_app_build_app_ref (name, branch, arch);
|
||||
else
|
||||
ref = xdg_app_build_runtime_ref (name, version, arch);
|
||||
ref = xdg_app_build_runtime_ref (name, branch, arch);
|
||||
|
||||
|
||||
deploy = xdg_app_dir_get_if_deployed (priv->dir,
|
||||
|
@ -513,7 +513,7 @@ xdg_app_installation_install (XdgAppInstallation *self,
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
@ -530,7 +530,7 @@ xdg_app_installation_install (XdgAppInstallation *self,
|
|||
g_autoptr(GError) local_error = NULL;
|
||||
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
|
||||
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, version, arch, error);
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
|
||||
if (ref == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -539,7 +539,7 @@ xdg_app_installation_install (XdgAppInstallation *self,
|
|||
{
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_ALREADY_INSTALLED,
|
||||
"%s branch %s already installed", name, version ? version : "master");
|
||||
"%s branch %s already installed", name, branch ? branch : "master");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ xdg_app_installation_install (XdgAppInstallation *self,
|
|||
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_EXISTS))
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_ALREADY_INSTALLED,
|
||||
"%s branch %s already installed", name, version ? version : "master");
|
||||
"%s branch %s already installed", name, branch ? branch : "master");
|
||||
else
|
||||
g_propagate_error (error, g_steal_pointer (&local_error));
|
||||
goto out;
|
||||
|
@ -624,7 +624,7 @@ xdg_app_installation_update (XdgAppInstallation *self,
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
@ -641,7 +641,7 @@ xdg_app_installation_update (XdgAppInstallation *self,
|
|||
gboolean was_updated;
|
||||
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
|
||||
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, version, arch, error);
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
|
||||
if (ref == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -650,7 +650,7 @@ xdg_app_installation_update (XdgAppInstallation *self,
|
|||
{
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
|
||||
"%s branch %s is not installed", name, version ? version : "master");
|
||||
"%s branch %s is not installed", name, branch ? branch : "master");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -684,7 +684,7 @@ xdg_app_installation_update (XdgAppInstallation *self,
|
|||
{
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
|
||||
"%s branch %s is not installed", name, version ? version : "master");
|
||||
"%s branch %s is not installed", name, branch ? branch : "master");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -732,7 +732,7 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
@ -747,7 +747,7 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
|
|||
gboolean was_deployed = FALSE;
|
||||
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
|
||||
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, version, arch, error);
|
||||
ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
|
||||
if (ref == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
@ -760,7 +760,7 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
|
|||
{
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
|
||||
"%s branch %s is not installed", name, version ? version : "master");
|
||||
"%s branch %s is not installed", name, branch ? branch : "master");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -803,7 +803,7 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
|
|||
{
|
||||
g_set_error (error,
|
||||
XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
|
||||
"%s branch %s is not installed", name, version ? version : "master");
|
||||
"%s branch %s is not installed", name, branch ? branch : "master");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_get_installed_ref
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_get_current_installed_app (XdgAppInstallation *self,
|
||||
|
@ -91,7 +91,7 @@ XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_install
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
@ -100,7 +100,7 @@ XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_update
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
@ -109,7 +109,7 @@ XDG_APP_EXTERN gboolean xdg_app_installation_uninstall
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
XdgAppProgressCallback progress,
|
||||
gpointer progress_data,
|
||||
GCancellable *cancellable,
|
||||
|
|
|
@ -217,7 +217,7 @@ xdg_app_installed_ref_launch (XdgAppInstalledRef *self,
|
|||
|
||||
app_ref =
|
||||
xdg_app_build_app_ref (xdg_app_ref_get_name (XDG_APP_REF (self)),
|
||||
xdg_app_ref_get_version (XDG_APP_REF (self)),
|
||||
xdg_app_ref_get_branch (XDG_APP_REF (self)),
|
||||
xdg_app_ref_get_arch (XDG_APP_REF (self)));
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ xdg_app_installed_ref_new (const char *full_ref,
|
|||
"kind", kind,
|
||||
"name", parts[1],
|
||||
"arch", parts[2],
|
||||
"version", parts[3],
|
||||
"branch", parts[3],
|
||||
"commit", commit,
|
||||
"origin", origin,
|
||||
"current", current,
|
||||
|
|
|
@ -30,7 +30,7 @@ struct _XdgAppRefPrivate
|
|||
{
|
||||
char *name;
|
||||
char *arch;
|
||||
char *version;
|
||||
char *branch;
|
||||
char *commit;
|
||||
XdgAppRefKind kind;
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ enum {
|
|||
|
||||
PROP_NAME,
|
||||
PROP_ARCH,
|
||||
PROP_VERSION,
|
||||
PROP_BRANCH,
|
||||
PROP_COMMIT,
|
||||
PROP_KIND
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ xdg_app_ref_finalize (GObject *object)
|
|||
|
||||
g_free (priv->name);
|
||||
g_free (priv->arch);
|
||||
g_free (priv->version);
|
||||
g_free (priv->branch);
|
||||
g_free (priv->commit);
|
||||
|
||||
G_OBJECT_CLASS (xdg_app_ref_parent_class)->finalize (object);
|
||||
|
@ -82,9 +82,9 @@ xdg_app_ref_set_property (GObject *object,
|
|||
priv->arch = g_value_dup_string (value);
|
||||
break;
|
||||
|
||||
case PROP_VERSION:
|
||||
g_clear_pointer (&priv->version, g_free);
|
||||
priv->version = g_value_dup_string (value);
|
||||
case PROP_BRANCH:
|
||||
g_clear_pointer (&priv->branch, g_free);
|
||||
priv->branch = g_value_dup_string (value);
|
||||
break;
|
||||
|
||||
case PROP_COMMIT:
|
||||
|
@ -121,8 +121,8 @@ xdg_app_ref_get_property (GObject *object,
|
|||
g_value_set_string (value, priv->arch);
|
||||
break;
|
||||
|
||||
case PROP_VERSION:
|
||||
g_value_set_string (value, priv->version);
|
||||
case PROP_BRANCH:
|
||||
g_value_set_string (value, priv->branch);
|
||||
break;
|
||||
|
||||
case PROP_COMMIT:
|
||||
|
@ -163,8 +163,8 @@ xdg_app_ref_class_init (XdgAppRefClass *klass)
|
|||
NULL,
|
||||
G_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_VERSION,
|
||||
g_param_spec_string ("version",
|
||||
PROP_BRANCH,
|
||||
g_param_spec_string ("branch",
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
|
@ -211,11 +211,11 @@ xdg_app_ref_get_arch (XdgAppRef *self)
|
|||
}
|
||||
|
||||
const char *
|
||||
xdg_app_ref_get_version (XdgAppRef *self)
|
||||
xdg_app_ref_get_branch (XdgAppRef *self)
|
||||
{
|
||||
XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
|
||||
|
||||
return priv->version;
|
||||
return priv->branch;
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef enum {
|
|||
|
||||
XDG_APP_EXTERN const char * xdg_app_ref_get_name (XdgAppRef *self);
|
||||
XDG_APP_EXTERN const char * xdg_app_ref_get_arch (XdgAppRef *self);
|
||||
XDG_APP_EXTERN const char * xdg_app_ref_get_version (XdgAppRef *self);
|
||||
XDG_APP_EXTERN const char * xdg_app_ref_get_branch (XdgAppRef *self);
|
||||
XDG_APP_EXTERN const char * xdg_app_ref_get_commit (XdgAppRef *self);
|
||||
XDG_APP_EXTERN XdgAppRefKind xdg_app_ref_get_kind (XdgAppRef *self);
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ xdg_app_remote_ref_new (const char *full_ref,
|
|||
"kind", kind,
|
||||
"name", parts[1],
|
||||
"arch", parts[2],
|
||||
"version", parts[3],
|
||||
"branch", parts[3],
|
||||
"commit", commit,
|
||||
"remote-name", remote_name,
|
||||
NULL);
|
||||
|
|
|
@ -220,7 +220,7 @@ xdg_app_remote_list_refs_sync (XdgAppRemote *self,
|
|||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Gets the current remote version of a ref in the #XdgAppRemote.
|
||||
* Gets the current remote branch of a ref in the #XdgAppRemote.
|
||||
*
|
||||
* Returns: (transfer full): a #XdgAppRemoteRef instance, or %NULL
|
||||
*/
|
||||
|
@ -229,7 +229,7 @@ xdg_app_remote_fetch_ref_sync (XdgAppRemote *self,
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -238,8 +238,8 @@ xdg_app_remote_fetch_ref_sync (XdgAppRemote *self,
|
|||
g_autofree char *ref = NULL;
|
||||
const char *checksum;
|
||||
|
||||
if (version == NULL)
|
||||
version = "master";
|
||||
if (branch == NULL)
|
||||
branch = "master";
|
||||
|
||||
if (!xdg_app_dir_list_remote_refs (priv->dir,
|
||||
priv->name,
|
||||
|
@ -250,11 +250,11 @@ xdg_app_remote_fetch_ref_sync (XdgAppRemote *self,
|
|||
|
||||
if (kind == XDG_APP_REF_KIND_APP)
|
||||
ref = xdg_app_build_app_ref (name,
|
||||
version,
|
||||
branch,
|
||||
arch);
|
||||
else
|
||||
ref = xdg_app_build_runtime_ref (name,
|
||||
version,
|
||||
branch,
|
||||
arch);
|
||||
|
||||
checksum = g_hash_table_lookup (ht, ref);
|
||||
|
|
|
@ -61,7 +61,7 @@ XDG_APP_EXTERN XdgAppRemoteRef *xdg_app_remote_fetch_ref_sync (XdgAppRemote *
|
|||
XdgAppRefKind kind,
|
||||
const char *name,
|
||||
const char *arch,
|
||||
const char *version,
|
||||
const char *branch,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
|
Loading…
Reference in New Issue