summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-09 21:27:44 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-09 21:27:44 +0200
commit20788bc290bc6ccda38efb9971837b23abcb8b41 (patch)
tree4e3d4ef21aa41aee71d36bebdf8db375bdfc4ec0
parentaabcc54db4451f568320adf25062f13fd0f5adfe (diff)
downloadxdg-app-20788bc290bc6ccda38efb9971837b23abcb8b41.tar.gz
lib: Remove deprecated calls
Now that we broke ABI anyway
-rw-r--r--lib/flatpak-installation.c85
-rw-r--r--lib/flatpak-installation.h16
-rw-r--r--lib/test-lib.c35
3 files changed, 14 insertions, 122 deletions
diff --git a/lib/flatpak-installation.c b/lib/flatpak-installation.c
index 46e0ecc..e66d98d 100644
--- a/lib/flatpak-installation.c
+++ b/lib/flatpak-installation.c
@@ -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,60 +1235,23 @@ 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
+ * @ref: the ref
* @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,
+ FlatpakRef *ref,
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
- *
- * Obtains the metadata file from a commit.
- *
- * Returns: (transfer full): a #GBytes containing the flatpak metadata file,
- * 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)
-{
- FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *full_ref = flatpak_ref_format_ref (ref);
char *res = NULL;
diff --git a/lib/flatpak-installation.h b/lib/flatpak-installation.h
index c3a1b19..4d954fe 100644
--- a/lib/flatpak-installation.h
+++ b/lib/flatpak-installation.h
@@ -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,
diff --git a/lib/test-lib.c b/lib/test-lib.c
index bd6f448..e227a19 100644
--- a/lib/test-lib.c
+++ b/lib/test-lib.c
@@ -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
{