[gnome-software: 1/2] flatpak: Bump dependency to 1.9.1 and drop old conditional code
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 1/2] flatpak: Bump dependency to 1.9.1 and drop old conditional code
- Date: Mon, 29 Nov 2021 11:19:30 +0000 (UTC)
commit 17521a59185f4c29e32a0da290015f60a7ba30f6
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri Nov 26 18:21:47 2021 +0000
flatpak: Bump dependency to 1.9.1 and drop old conditional code
Debian Stable now ships flatpak 1.10.3, so we can depend on at least
that. The highest dependency in our conditional code which was ≤ 1.10.3
was 1.9.1, so set the build dependency to that.
Suggested by Milan Crha.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
meson.build | 2 +-
plugins/flatpak/gs-flatpak-transaction.c | 99 +-------------------------------
plugins/flatpak/gs-flatpak-transaction.h | 4 --
plugins/flatpak/gs-flatpak-utils.c | 6 --
plugins/flatpak/gs-flatpak.c | 53 +----------------
plugins/flatpak/gs-plugin-flatpak.c | 32 +----------
plugins/flatpak/gs-self-test.c | 23 +-------
7 files changed, 7 insertions(+), 212 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4c81ca601..ce4b87af7 100644
--- a/meson.build
+++ b/meson.build
@@ -218,7 +218,7 @@ if get_option('fwupd')
endif
if get_option('flatpak')
- flatpak = dependency('flatpak', version : '>= 1.0.4')
+ flatpak = dependency('flatpak', version : '>= 1.9.1')
ostree = dependency('ostree-1')
flatpak_soupapiversion = flatpak.get_pkgconfig_variable('soupapiversion')
diff --git a/plugins/flatpak/gs-flatpak-transaction.c b/plugins/flatpak/gs-flatpak-transaction.c
index cbad44170..7377f6d48 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -16,18 +16,8 @@ struct _GsFlatpakTransaction {
FlatpakTransaction parent_instance;
GHashTable *refhash; /* ref:GsApp */
GError *first_operation_error;
-#if !FLATPAK_CHECK_VERSION(1,5,1)
- gboolean no_deploy;
-#endif
};
-
-#if !FLATPAK_CHECK_VERSION(1,5,1)
-typedef enum {
- PROP_NO_DEPLOY = 1,
-} GsFlatpakTransactionProperty;
-#endif
-
enum {
SIGNAL_REF_TO_APP,
LAST_SIGNAL
@@ -52,25 +42,6 @@ gs_flatpak_transaction_finalize (GObject *object)
G_OBJECT_CLASS (gs_flatpak_transaction_parent_class)->finalize (object);
}
-
-#if !FLATPAK_CHECK_VERSION(1,5,1)
-void
-gs_flatpak_transaction_set_no_deploy (FlatpakTransaction *transaction, gboolean no_deploy)
-{
- GsFlatpakTransaction *self;
-
- g_return_if_fail (GS_IS_FLATPAK_TRANSACTION (transaction));
-
- self = GS_FLATPAK_TRANSACTION (transaction);
- if (self->no_deploy == no_deploy)
- return;
- self->no_deploy = no_deploy;
- flatpak_transaction_set_no_deploy (transaction, no_deploy);
-
- g_object_notify (G_OBJECT (self), "no-deploy");
-}
-#endif
-
GsApp *
gs_flatpak_transaction_get_app_by_ref (FlatpakTransaction *transaction, const gchar *ref)
{
@@ -184,7 +155,6 @@ _transaction_ready (FlatpakTransaction *transaction)
}
}
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
/* Debug dump. */
{
GPtrArray *related_to_ops = flatpak_transaction_operation_get_related_to_ops (op);
@@ -204,7 +174,6 @@ _transaction_ready (FlatpakTransaction *transaction)
g_string_append (debug_message, "\n └ (end)");
g_debug ("%s", debug_message->str);
}
-#endif /* flatpak ≥ 1.7.3 */
}
return TRUE;
}
@@ -227,7 +196,6 @@ progress_data_free (ProgressData *data)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProgressData, progress_data_free)
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
static gboolean
op_is_related_to_op (FlatpakTransactionOperation *op,
FlatpakTransactionOperation *root_op)
@@ -368,9 +336,7 @@ update_progress_for_op (GsFlatpakTransaction *self,
gs_app_get_unique_id (root_app));
}
}
-#endif /* flatpak 1.7.3 */
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
static void
update_progress_for_op_recurse_up (GsFlatpakTransaction *self,
FlatpakTransactionProgress *progress,
@@ -389,7 +355,6 @@ update_progress_for_op_recurse_up (GsFlatpakTransaction *self,
update_progress_for_op_recurse_up (self, progress, ops, current_op, related_to_op);
}
}
-#endif /* flatpak 1.7.3 */
static void
_transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
@@ -397,12 +362,8 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
{
ProgressData *data = user_data;
GsApp *app = data->app;
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
GsFlatpakTransaction *self = data->transaction;
g_autolist(FlatpakTransactionOperation) ops = NULL;
-#else
- guint percent;
-#endif
if (flatpak_transaction_progress_get_is_estimating (progress)) {
/* "Estimating" happens while fetching the metadata, which
@@ -413,7 +374,6 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
return;
}
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
/* Update the progress on this app, and then do the same for each
* related parent app up the hierarchy. For example, @data->operation
* could be for a runtime which was added to the transaction because of
@@ -439,19 +399,6 @@ _transaction_progress_changed_cb (FlatpakTransactionProgress *progress,
*/
ops = flatpak_transaction_get_operations (FLATPAK_TRANSACTION (self));
update_progress_for_op_recurse_up (self, progress, ops, data->operation, data->operation);
-#else /* if !flatpak 1.7.3 */
- percent = flatpak_transaction_progress_get_progress (progress);
-
- if (gs_app_get_progress (app) != 100 &&
- gs_app_get_progress (app) != GS_APP_PROGRESS_UNKNOWN &&
- gs_app_get_progress (app) > percent) {
- g_warning ("ignoring percentage %u%% -> %u%% as going down...",
- gs_app_get_progress (app), percent);
- return;
- }
-
- gs_app_set_progress (app, percent);
-#endif /* !flatpak 1.7.3 */
}
static const gchar *
@@ -533,7 +480,6 @@ _transaction_new_operation (FlatpakTransaction *transaction,
}
}
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
static gboolean
later_op_also_related (GList *ops,
FlatpakTransactionOperation *current_op,
@@ -601,7 +547,6 @@ set_skipped_related_apps_to_installed (GsFlatpakTransaction *self,
}
}
}
-#endif /* flatpak 1.7.3 */
static void
_transaction_operation_done (FlatpakTransaction *transaction,
@@ -609,9 +554,8 @@ _transaction_operation_done (FlatpakTransaction *transaction,
const gchar *commit,
FlatpakTransactionResult details)
{
-#if !FLATPAK_CHECK_VERSION(1,5,1) || FLATPAK_CHECK_VERSION(1,7,3)
GsFlatpakTransaction *self = GS_FLATPAK_TRANSACTION (transaction);
-#endif
+
/* invalidate */
GsApp *app = _transaction_operation_get_app (operation);
if (app == NULL) {
@@ -624,9 +568,7 @@ _transaction_operation_done (FlatpakTransaction *transaction,
case FLATPAK_TRANSACTION_OPERATION_INSTALL_BUNDLE:
gs_app_set_state (app, GS_APP_STATE_INSTALLED);
-#if FLATPAK_CHECK_VERSION(1,7,3)
set_skipped_related_apps_to_installed (self, transaction, operation);
-#endif
break;
case FLATPAK_TRANSACTION_OPERATION_UPDATE:
gs_app_set_version (app, gs_app_get_update_version (app));
@@ -636,18 +578,12 @@ _transaction_operation_done (FlatpakTransaction *transaction,
/* force getting the new runtime */
gs_app_remove_kudo (app, GS_APP_KUDO_SANDBOXED);
/* downloaded, but not yet installed */
-#if !FLATPAK_CHECK_VERSION(1,5,1)
- if (self->no_deploy)
-#else
if (flatpak_transaction_get_no_deploy (transaction))
-#endif
gs_app_set_state (app, GS_APP_STATE_UPDATABLE_LIVE);
else
gs_app_set_state (app, GS_APP_STATE_INSTALLED);
-#if FLATPAK_CHECK_VERSION(1,7,3)
set_skipped_related_apps_to_installed (self, transaction, operation);
-#endif
break;
case FLATPAK_TRANSACTION_OPERATION_UNINSTALL:
/* we don't actually know if this app is re-installable */
@@ -720,7 +656,6 @@ _transaction_end_of_lifed (FlatpakTransaction *transaction,
//FIXME: show something in the UI
}
-#if FLATPAK_CHECK_VERSION(1,4,1)
static gboolean
_transaction_end_of_lifed_with_rebase (FlatpakTransaction *transaction,
const gchar *remote,
@@ -759,7 +694,6 @@ _transaction_end_of_lifed_with_rebase (FlatpakTransaction *transaction,
return FALSE;
}
-#endif
static gboolean
_transaction_add_new_remote (FlatpakTransaction *transaction,
@@ -783,30 +717,9 @@ _transaction_add_new_remote (FlatpakTransaction *transaction,
return FALSE;
}
-#if !FLATPAK_CHECK_VERSION(1,5,1)
-static void
-gs_flatpak_transaction_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- FlatpakTransaction *transaction = FLATPAK_TRANSACTION (object);
-
- switch ((GsFlatpakTransactionProperty) prop_id) {
- case PROP_NO_DEPLOY:
- gs_flatpak_transaction_set_no_deploy (transaction, g_value_get_boolean (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-#endif
-
static void
gs_flatpak_transaction_class_init (GsFlatpakTransactionClass *klass)
{
-
-#if !FLATPAK_CHECK_VERSION(1,5,1)
- GParamSpec *pspec;
-#endif
GObjectClass *object_class = G_OBJECT_CLASS (klass);
FlatpakTransactionClass *transaction_class = FLATPAK_TRANSACTION_CLASS (klass);
object_class->finalize = gs_flatpak_transaction_finalize;
@@ -817,17 +730,7 @@ gs_flatpak_transaction_class_init (GsFlatpakTransactionClass *klass)
transaction_class->operation_error = _transaction_operation_error;
transaction_class->choose_remote_for_ref = _transaction_choose_remote_for_ref;
transaction_class->end_of_lifed = _transaction_end_of_lifed;
-#if FLATPAK_CHECK_VERSION(1,4,1)
transaction_class->end_of_lifed_with_rebase = _transaction_end_of_lifed_with_rebase;
-#endif
-#if !FLATPAK_CHECK_VERSION(1,5,1)
- object_class->set_property = gs_flatpak_transaction_set_property;
-
- pspec = g_param_spec_boolean ("no-deploy", NULL,
- "Whether the current transaction will deploy the downloaded objects",
- FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (object_class, PROP_NO_DEPLOY, pspec);
-#endif
signals[SIGNAL_REF_TO_APP] =
g_signal_new ("ref-to-app",
diff --git a/plugins/flatpak/gs-flatpak-transaction.h b/plugins/flatpak/gs-flatpak-transaction.h
index 97a4e10de..1cc2a0753 100644
--- a/plugins/flatpak/gs-flatpak-transaction.h
+++ b/plugins/flatpak/gs-flatpak-transaction.h
@@ -27,9 +27,5 @@ void gs_flatpak_transaction_add_app (FlatpakTransaction
*transaction,
gboolean gs_flatpak_transaction_run (FlatpakTransaction *transaction,
GCancellable *cancellable,
GError **error);
-#if !FLATPAK_CHECK_VERSION(1,5,1)
-void gs_flatpak_transaction_set_no_deploy (FlatpakTransaction *transaction,
- gboolean no_deploy);
-#endif
G_END_DECLS
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 0e8fe504d..4f7ff8dc3 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -72,10 +72,8 @@ gs_flatpak_app_new_from_remote (GsPlugin *plugin,
{
g_autofree gchar *title = NULL;
g_autofree gchar *url = NULL;
- #if FLATPAK_CHECK_VERSION(1, 4, 0)
g_autofree gchar *filter = NULL;
g_autofree gchar *description = NULL;
- #endif
g_autoptr(GsApp) app = NULL;
app = gs_flatpak_app_new (flatpak_remote_get_name (xremote));
@@ -107,22 +105,18 @@ gs_flatpak_app_new_from_remote (GsPlugin *plugin,
* not the remote title */
gs_app_set_origin_ui (app, _("Applications"));
- #if FLATPAK_CHECK_VERSION(1, 4, 0)
description = flatpak_remote_get_description (xremote);
if (description != NULL)
gs_app_set_description (app, GS_APP_QUALITY_NORMAL, description);
- #endif
/* url */
url = flatpak_remote_get_url (xremote);
if (url != NULL)
gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url);
- #if FLATPAK_CHECK_VERSION(1, 4, 0)
filter = flatpak_remote_get_filter (xremote);
if (filter != NULL)
gs_flatpak_app_set_repo_filter (app, filter);
- #endif
/* success */
return g_steal_pointer (&app);
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 4523430dc..ec0931be4 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -578,36 +578,6 @@ gs_flatpak_filter_noenumerate_cb (XbBuilderFixup *self,
return TRUE;
}
-#if !FLATPAK_CHECK_VERSION(1,1,1)
-static gchar *
-gs_flatpak_get_xremote_main_ref (GsFlatpak *self, FlatpakRemote *xremote, GError **error)
-{
- g_autoptr(GFile) dir = NULL;
- g_autofree gchar *dir_path = NULL;
- g_autofree gchar *config_fn = NULL;
- g_autofree gchar *group = NULL;
- g_autofree gchar *main_ref = NULL;
- g_autoptr(GKeyFile) kf = NULL;
-
- /* figure out the path to the config keyfile */
- dir = flatpak_installation_get_path (self->installation);
- if (dir == NULL)
- return NULL;
- dir_path = g_file_get_path (dir);
- if (dir_path == NULL)
- return NULL;
- config_fn = g_build_filename (dir_path, "repo", "config", NULL);
-
- kf = g_key_file_new ();
- if (!g_key_file_load_from_file (kf, config_fn, G_KEY_FILE_NONE, error))
- return NULL;
-
- group = g_strdup_printf ("remote \"%s\"", flatpak_remote_get_name (xremote));
- main_ref = g_key_file_get_string (kf, group, "xa.main-ref", error);
- return g_steal_pointer (&main_ref);
-}
-#endif
-
#if LIBXMLB_CHECK_VERSION(0,3,0)
static gboolean
gs_flatpak_tokenize_cb (XbBuilderFixup *self,
@@ -795,16 +765,9 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
/* only add the specific app for noenumerate=true */
if (flatpak_remote_get_noenumerate (xremote)) {
g_autofree gchar *main_ref = NULL;
-#if FLATPAK_CHECK_VERSION(1,1,1)
+
main_ref = flatpak_remote_get_main_ref (xremote);
-#else
- g_autoptr(GError) error_local = NULL;
- main_ref = gs_flatpak_get_xremote_main_ref (self, xremote, &error_local);
- if (main_ref == NULL) {
- g_warning ("failed to get main ref: %s", error_local->message);
- g_clear_error (&error_local);
- }
-#endif
+
if (main_ref != NULL) {
g_autoptr(XbBuilderFixup) fixup = NULL;
fixup = xb_builder_fixup_new ("FilterNoEnumerate",
@@ -1297,9 +1260,7 @@ gs_flatpak_set_metadata_installed (GsFlatpak *self,
FlatpakInstalledRef *xref,
GCancellable *cancellable)
{
-#if FLATPAK_CHECK_VERSION(1,1,3)
const gchar *appdata_version;
-#endif
guint64 mtime;
guint64 size_installed;
g_autofree gchar *metadata_fn = NULL;
@@ -1361,11 +1322,9 @@ gs_flatpak_set_metadata_installed (GsFlatpak *self,
if (size_installed != 0)
gs_app_set_size_installed (app, size_installed);
-#if FLATPAK_CHECK_VERSION(1,1,3)
appdata_version = flatpak_installed_ref_get_appdata_version (xref);
if (appdata_version != NULL)
gs_app_set_version (app, appdata_version);
-#endif
}
static GsApp *
@@ -1632,10 +1591,8 @@ gs_flatpak_app_install_source (GsFlatpak *self,
g_debug ("modifying existing remote %s", flatpak_remote_get_name (xremote));
flatpak_remote_set_disabled (xremote, FALSE);
if (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_REPO) {
- #if FLATPAK_CHECK_VERSION(1, 4, 0)
flatpak_remote_set_filter (xremote, gs_flatpak_app_get_repo_filter (app));
flatpak_remote_set_description (xremote, gs_app_get_description (app));
- #endif
flatpak_remote_set_title (xremote, gs_app_get_origin_ui (app));
}
} else if (!is_install) {
@@ -2342,11 +2299,7 @@ gs_flatpak_fetch_remote_metadata (GsFlatpak *self,
cancellable,
&local_error);
if (data == NULL) {
-#if FLATPAK_CHECK_VERSION(1,4,0)
if (g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_REF_NOT_FOUND) &&
-#else
- if (g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_INVALID_DATA) &&
-#endif
!gs_plugin_get_network_available (self->plugin)) {
local_error->code = GS_PLUGIN_ERROR_NO_NETWORK;
local_error->domain = GS_PLUGIN_ERROR;
@@ -2986,9 +2939,7 @@ gs_flatpak_refine_appstream (GsFlatpak *self,
if (installed_ref == NULL)
return TRUE; /* the app may not be installed */
-#if FLATPAK_CHECK_VERSION(1,1,2)
appstream_gz = flatpak_installed_ref_load_appdata (installed_ref, NULL, NULL);
-#endif
if (appstream_gz == NULL)
return TRUE;
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index 2d0e013c6..f867c24fd 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -529,7 +529,6 @@ _group_apps_by_installation (GsPluginFlatpak *self,
return g_steal_pointer (&applist_by_flatpaks);
}
-#if FLATPAK_CHECK_VERSION(1,6,0)
typedef struct {
FlatpakTransaction *transaction;
guint id;
@@ -641,37 +640,18 @@ _webflow_done (FlatpakTransaction *transaction,
{
g_debug ("Browser done");
}
-#endif
static FlatpakTransaction *
_build_transaction (GsPlugin *plugin, GsFlatpak *flatpak,
GCancellable *cancellable, GError **error)
{
FlatpakInstallation *installation;
-#if !FLATPAK_CHECK_VERSION(1, 7, 3)
- g_autoptr(GFile) installation_path = NULL;
-#endif /* flatpak < 1.7.3 */
g_autoptr(FlatpakInstallation) installation_clone = NULL;
g_autoptr(FlatpakTransaction) transaction = NULL;
installation = gs_flatpak_get_installation (flatpak);
-#if !FLATPAK_CHECK_VERSION(1, 7, 3)
- /* Operate on a copy of the installation so we can set the interactive
- * flag for the duration of this transaction. */
- installation_path = flatpak_installation_get_path (installation);
- installation_clone = flatpak_installation_new_for_path (installation_path,
- flatpak_installation_get_is_user
(installation),
- cancellable, error);
- if (installation_clone == NULL)
- return NULL;
-
- /* Let flatpak know if it is a background operation */
- flatpak_installation_set_no_interaction (installation_clone,
- !gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE));
-#else /* if flatpak ≥ 1.7.3 */
installation_clone = g_object_ref (installation);
-#endif /* flatpak ≥ 1.7.3 */
/* create transaction */
transaction = gs_flatpak_transaction_new (installation_clone, cancellable, error);
@@ -681,23 +661,19 @@ _build_transaction (GsPlugin *plugin, GsFlatpak *flatpak,
return NULL;
}
-#if FLATPAK_CHECK_VERSION(1, 7, 3)
/* Let flatpak know if it is a background operation */
flatpak_transaction_set_no_interaction (transaction,
!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE));
-#endif /* flatpak ≥ 1.7.3 */
/* connect up signals */
g_signal_connect (transaction, "ref-to-app",
G_CALLBACK (_ref_to_app), plugin);
-#if FLATPAK_CHECK_VERSION(1,6,0)
g_signal_connect (transaction, "basic-auth-start",
G_CALLBACK (_basic_auth_start), plugin);
g_signal_connect (transaction, "webflow-start",
G_CALLBACK (_webflow_start), plugin);
g_signal_connect (transaction, "webflow-done",
G_CALLBACK (_webflow_done), plugin);
-#endif
/* use system installations as dependency sources for user installations */
flatpak_transaction_add_default_dependency_sources (transaction);
@@ -752,11 +728,9 @@ gs_plugin_download (GsPlugin *plugin, GsAppList *list,
gs_flatpak_error_convert (error);
return FALSE;
}
-#if !FLATPAK_CHECK_VERSION(1,5,1)
- gs_flatpak_transaction_set_no_deploy (transaction, TRUE);
-#else
+
flatpak_transaction_set_no_deploy (transaction, TRUE);
-#endif
+
for (guint i = 0; i < gs_app_list_length (list_tmp); i++) {
GsApp *app = gs_app_list_index (list_tmp, i);
g_autofree gchar *ref = NULL;
@@ -1204,10 +1178,8 @@ gs_plugin_flatpak_update (GsPlugin *plugin,
flatpak_transaction_set_no_pull (transaction, TRUE);
}
-#if FLATPAK_CHECK_VERSION(1, 9, 1)
/* automatically clean up unused EOL runtimes when updating */
flatpak_transaction_set_include_unused_uninstall_ops (transaction, TRUE);
-#endif
if (!gs_flatpak_transaction_run (transaction, cancellable, error)) {
for (guint i = 0; i < gs_app_list_length (list_tmp); i++) {
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index f79965a00..f284a695f 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1037,13 +1037,8 @@ gs_plugins_flatpak_broken_remote_func (GsPluginLoader *plugin_loader)
g_assert_cmpint (gs_app_get_kind (app), ==, AS_COMPONENT_KIND_DESKTOP_APP);
g_assert_cmpint (gs_app_get_state (app), ==, GS_APP_STATE_AVAILABLE_LOCAL);
g_assert_cmpstr (gs_app_get_id (app), ==, "org.test.Chiron");
-#if FLATPAK_CHECK_VERSION(1,1,2)
g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app),
"user/flatpak/chiron-origin/org.test.Chiron/master"));
-#else
- g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app),
- "user/flatpak/org.test.Chiron-origin/org.test.Chiron/master"));
-#endif
g_assert_cmpstr (gs_app_get_url (app, AS_URL_KIND_HOMEPAGE), ==, "http://127.0.0.1/");
g_assert_cmpstr (gs_app_get_name (app), ==, "Chiron");
g_assert_cmpstr (gs_app_get_summary (app), ==, "Single line synopsis");
@@ -1205,13 +1200,8 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
"user/flatpak/flatpak/org.test.Chiron/master"));
g_assert_true (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_BUNDLE);
} else {
-#if FLATPAK_CHECK_VERSION(1,1,2)
g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app),
"user/flatpak/chiron-origin/org.test.Chiron/master"));
-#else
- g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app),
- "user/flatpak/org.test.Chiron-origin/org.test.Chiron/master"));
-#endif
g_assert_true (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_REF);
g_assert_cmpstr (gs_app_get_url (app, AS_URL_KIND_HOMEPAGE), ==, "http://127.0.0.1/");
g_assert_cmpstr (gs_app_get_description (app), ==, "Long description.");
@@ -1261,13 +1251,8 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
g_assert_true (app2 != NULL);
g_assert_cmpint (gs_app_get_state (app2), ==, GS_APP_STATE_INSTALLED);
if (is_bundle) {
-#if FLATPAK_CHECK_VERSION(1,1,2)
g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app2),
"user/flatpak/chiron-origin/org.test.Chiron/master"));
-#else
- g_assert_true (as_utils_data_id_equal (gs_app_get_unique_id (app2),
- "user/flatpak/org.test.Chiron-origin/org.test.Chiron/master"));
-#endif
} else {
/* Note: the origin is now test-1 because that remote was created from the
* RuntimeRepo= setting
@@ -1795,14 +1780,8 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
loop);
g_main_loop_run (loop);
gs_test_flush_main_context ();
-#if !FLATPAK_CHECK_VERSION(1,7,3)
- /* Older flatpak versions don't have the API we use to propagate state
- * between extension and app
- */
- gs_app_set_state (app, GS_APP_STATE_INSTALLED);
-#else
+
g_assert_cmpint (gs_app_get_state (app), ==, GS_APP_STATE_INSTALLED);
-#endif
g_assert_cmpstr (gs_app_get_version (app), ==, "1.2.3");
g_assert_true (got_progress_installing);
g_assert_cmpint (pending_app_changed_cnt, ==, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]