forked from Mirrors/flatpak-builder
parent
aabcc54db4
commit
20788bc290
|
@ -1196,36 +1196,6 @@ flatpak_installation_uninstall (FlatpakInstallation *self,
|
|||
* flatpak_installation_fetch_remote_size_sync:
|
||||
* @self: a #FlatpakInstallation
|
||||
* @remote_name: the name of the remote
|
||||
* @commit: the commit
|
||||
* @download_size: (out): return location for the download size
|
||||
* @installed_size: (out): return location for the installed size
|
||||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Gets information about the amount of data that needs to be transferred
|
||||
* to pull a commit from a remote repository, and about the amount of
|
||||
* local disk space that is required to check out this commit.
|
||||
*
|
||||
* This is deprectated, use flatpak_installation_fetch_remote_size_sync2 instead.
|
||||
*
|
||||
* Returns: %TRUE, unless an error occurred
|
||||
*/
|
||||
gboolean
|
||||
flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
return flatpak_fail (error, "Deprecated function call flatpak_installation_fetch_remote_size_sync");
|
||||
}
|
||||
|
||||
/**
|
||||
* flatpak_installation_fetch_remote_size_sync2:
|
||||
* @self: a #FlatpakInstallation
|
||||
* @remote_name: the name of the remote
|
||||
* @ref: the ref
|
||||
* @download_size: (out): return location for the (maximum) download size
|
||||
* @installed_size: (out): return location for the installed size
|
||||
|
@ -1243,13 +1213,13 @@ flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
|
|||
* Returns: %TRUE, unless an error occurred
|
||||
*/
|
||||
gboolean
|
||||
flatpak_installation_fetch_remote_size_sync2 (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
|
||||
g_autofree char *full_ref = flatpak_ref_format_ref (ref);
|
||||
|
@ -1265,43 +1235,6 @@ flatpak_installation_fetch_remote_size_sync2 (FlatpakInstallation *self,
|
|||
* flatpak_installation_fetch_remote_metadata_sync:
|
||||
* @self: a #FlatpakInstallation
|
||||
* @remote_name: the name of the remote
|
||||
* @commit: the commit
|
||||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
*
|
||||
* Obtains the metadata file from a commit.
|
||||
*
|
||||
* This is deprecated, use flatpak_installation_fetch_remote_metadata_sync2
|
||||
*
|
||||
* Returns: (transfer full): a #GBytes containing the flatpak metadata file,
|
||||
* or %NULL if an error occurred
|
||||
*/
|
||||
GBytes *
|
||||
flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
|
||||
|
||||
g_autoptr(GBytes) bytes = NULL;
|
||||
|
||||
bytes = flatpak_dir_fetch_metadata (priv->dir,
|
||||
remote_name,
|
||||
commit,
|
||||
cancellable,
|
||||
error);
|
||||
if (bytes == NULL)
|
||||
return NULL;
|
||||
|
||||
return g_steal_pointer (&bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* flatpak_installation_fetch_remote_metadata_sync2:
|
||||
* @self: a #FlatpakInstallation
|
||||
* @remote_name: the name of the remote
|
||||
* @ref: the ref
|
||||
* @cancellable: (nullable): a #GCancellable
|
||||
* @error: return location for a #GError
|
||||
|
@ -1312,11 +1245,11 @@ flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
|
|||
* or %NULL if an error occurred
|
||||
*/
|
||||
GBytes *
|
||||
flatpak_installation_fetch_remote_metadata_sync2 (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
|
||||
g_autofree char *full_ref = flatpak_ref_format_ref (ref);
|
||||
|
|
|
@ -177,28 +177,16 @@ FLATPAK_EXTERN gboolean flatpak_installation_uninstall (FlatpakInsta
|
|||
|
||||
FLATPAK_EXTERN gboolean flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
FlatpakRef *ref,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
FLATPAK_EXTERN gboolean flatpak_installation_fetch_remote_size_sync2 (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
FLATPAK_EXTERN GBytes * flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
FlatpakRef *ref,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
FLATPAK_EXTERN GBytes * flatpak_installation_fetch_remote_metadata_sync2 (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
FlatpakRef *ref,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
FLATPAK_EXTERN GPtrArray * flatpak_installation_list_remote_refs_sync (FlatpakInstallation *self,
|
||||
const char *remote_name,
|
||||
GCancellable *cancellable,
|
||||
|
|
|
@ -322,9 +322,10 @@ main (int argc, char *argv[])
|
|||
{
|
||||
guint64 download_size;
|
||||
guint64 installed_size;
|
||||
|
||||
if (!flatpak_installation_fetch_remote_size_sync (installation,
|
||||
flatpak_remote_get_name (remote),
|
||||
flatpak_ref_get_commit (FLATPAK_REF (ref)),
|
||||
FLATPAK_REF (ref),
|
||||
&download_size,
|
||||
&installed_size,
|
||||
NULL, &error))
|
||||
|
@ -338,22 +339,6 @@ main (int argc, char *argv[])
|
|||
download_size, installed_size);
|
||||
}
|
||||
|
||||
if (!flatpak_installation_fetch_remote_size_sync2 (installation,
|
||||
flatpak_remote_get_name (remote),
|
||||
FLATPAK_REF (ref),
|
||||
&download_size,
|
||||
&installed_size,
|
||||
NULL, &error))
|
||||
{
|
||||
g_print ("error fetching sizes2: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Download size2: %"G_GUINT64_FORMAT " Installed size2: %"G_GUINT64_FORMAT "\n",
|
||||
download_size, installed_size);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +352,6 @@ main (int argc, char *argv[])
|
|||
if (remote_ref)
|
||||
{
|
||||
GBytes *metadata;
|
||||
GBytes *metadata2;
|
||||
|
||||
g_print ("%d %s %s %s %s %s\n",
|
||||
flatpak_ref_get_kind (FLATPAK_REF (remote_ref)),
|
||||
|
@ -378,7 +362,7 @@ main (int argc, char *argv[])
|
|||
flatpak_remote_ref_get_remote_name (remote_ref));
|
||||
|
||||
metadata = flatpak_installation_fetch_remote_metadata_sync (installation, flatpak_remote_get_name (remote),
|
||||
flatpak_ref_get_commit (FLATPAK_REF (remote_ref)), NULL, &error);
|
||||
FLATPAK_REF (remote_ref), NULL, &error);
|
||||
if (metadata)
|
||||
{
|
||||
g_print ("metadata: %s\n", (char *) g_bytes_get_data (metadata, NULL));
|
||||
|
@ -389,19 +373,6 @@ main (int argc, char *argv[])
|
|||
g_print ("error: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
metadata2 = flatpak_installation_fetch_remote_metadata_sync2 (installation, flatpak_remote_get_name (remote),
|
||||
FLATPAK_REF (remote_ref), NULL, &error);
|
||||
if (metadata2)
|
||||
{
|
||||
g_print ("metadata2: %s\n", (char *) g_bytes_get_data (metadata2, NULL));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("fetch error\n");
|
||||
g_print ("error: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue