diff --git a/src/gs-plugin-apk/gs-plugin-apk.c b/src/gs-plugin-apk/gs-plugin-apk.c index 445ff9e..cb12be0 100644 --- a/src/gs-plugin-apk/gs-plugin-apk.c +++ b/src/gs-plugin-apk/gs-plugin-apk.c @@ -202,14 +202,17 @@ gs_plugin_apk_setup_finish (GsPlugin *plugin, return g_task_propagate_boolean (G_TASK (result), error); } +static void +apk_polkit_proxy_setup_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data); + static void gs_plugin_apk_setup_async (GsPlugin *plugin, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { - GsPluginApk *self = GS_PLUGIN_APK (plugin); - g_autoptr (GError) local_error = NULL; g_autoptr (GTask) task = NULL; task = g_task_new (plugin, cancellable, callback, user_data); @@ -217,13 +220,25 @@ gs_plugin_apk_setup_async (GsPlugin *plugin, g_debug ("Initializing plugin"); - self->proxy = apk_polkit2_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "dev.Cogitri.apkPolkit2", - "/dev/Cogitri/apkPolkit2", - cancellable, - &local_error); + apk_polkit2_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + "dev.Cogitri.apkPolkit2", + "/dev/Cogitri/apkPolkit2", + cancellable, + apk_polkit_proxy_setup_cb, + g_steal_pointer (&task)); +} +static void +apk_polkit_proxy_setup_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + g_autoptr (GTask) task = g_steal_pointer (&user_data); + GsPluginApk *self = g_task_get_source_object (task); + g_autoptr (GError) local_error = NULL; + + self->proxy = apk_polkit2_proxy_new_for_bus_finish (result, &local_error); if (local_error != NULL) { g_dbus_error_strip_remote_error (local_error); @@ -231,7 +246,7 @@ gs_plugin_apk_setup_async (GsPlugin *plugin, return; } - // FIXME: Instead of disabling the timeout here, apkd should have an async API. + /* Live update operations can take very, very long */ g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (self->proxy), G_MAXINT); g_task_return_boolean (task, TRUE); @@ -245,6 +260,10 @@ gs_plugin_apk_refresh_metadata_finish (GsPlugin *plugin, return g_task_propagate_boolean (G_TASK (result), error); } +static void apk_polkit_update_repositories_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data); + static void gs_plugin_apk_refresh_metadata_async (GsPlugin *plugin, guint64 cache_age_secs, @@ -256,27 +275,35 @@ gs_plugin_apk_refresh_metadata_async (GsPlugin *plugin, GsPluginApk *self = GS_PLUGIN_APK (plugin); g_autoptr (GTask) task = NULL; g_autoptr (GError) local_error = NULL; - g_autoptr (GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin)); task = g_task_new (plugin, cancellable, callback, user_data); g_task_set_source_tag (task, gs_plugin_apk_refresh_metadata_async); g_debug ("Refreshing repositories"); - gs_app_set_summary_missing (app_dl, _ ("Getting apk repository indexes…")); - gs_plugin_status_update (plugin, app_dl, GS_PLUGIN_STATUS_DOWNLOADING); - if (apk_polkit2_call_update_repositories_sync (self->proxy, cancellable, &local_error)) - { - gs_app_set_progress (app_dl, 100); - gs_plugin_updates_changed (plugin); - g_task_return_boolean (task, TRUE); - return; - } - else + gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_DOWNLOADING); + apk_polkit2_call_update_repositories (self->proxy, cancellable, + apk_polkit_update_repositories_cb, + g_steal_pointer (&task)); +} + +static void +apk_polkit_update_repositories_cb (GObject *source_object, + GAsyncResult *res, + gpointer user_data) +{ + g_autoptr (GTask) task = g_steal_pointer (&user_data); + GsPluginApk *self = g_task_get_source_object (task); + g_autoptr (GError) local_error = NULL; + + if (!apk_polkit2_call_update_repositories_finish (self->proxy, res, &local_error)) { g_task_return_error (task, g_steal_pointer (&local_error)); return; } + + gs_plugin_updates_changed (GS_PLUGIN (self)); + g_task_return_boolean (task, TRUE); } gboolean @@ -288,11 +315,9 @@ gs_plugin_add_updates (GsPlugin *plugin, GsPluginApk *self = GS_PLUGIN_APK (plugin); g_autoptr (GVariant) upgradable_packages = NULL; g_autoptr (GError) local_error = NULL; - g_autoptr (GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin)); - g_debug ("Adding updates"); /* I believe we have to invalidate the cache here! */ - gs_app_set_progress (app_dl, GS_APP_PROGRESS_UNKNOWN); + g_debug ("Adding updates"); if (!apk_polkit2_call_list_upgradable_packages_sync (self->proxy, APK_POLKIT_CLIENT_DETAILS_FLAGS_ALL, @@ -452,11 +477,11 @@ gs_plugin_update (GsPlugin *plugin, { GsPluginApk *self = GS_PLUGIN_APK (plugin); g_autoptr (GError) local_error = NULL; - g_autoptr (GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin)); g_autoptr (GsAppList) update_list = gs_app_list_new (); g_autofree const gchar **source_array = NULL; - gs_app_set_progress (app_dl, GS_APP_PROGRESS_UNKNOWN); + /* update UI as this might take some time */ + gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING); gs_plugin_apk_prepare_update (plugin, list, update_list); @@ -487,7 +512,15 @@ gs_plugin_update (GsPlugin *plugin, GsApp *app = gs_app_list_index (update_list, i); gs_app_set_state_recover (app); } - /*gs_app_set_state_recover (app); TODO: Fix this! */ + + /* Roll-back apps from the original list with a quirk */ + for (int i = 0; i < gs_app_list_length (list); i++) + { + GsApp *app = gs_app_list_index (list, i); + if (gs_app_has_quirk (app, GS_APP_QUIRK_IS_PROXY)) + gs_app_set_state_recover (app); + } + return FALSE; } @@ -588,30 +621,176 @@ set_app_metadata (GsPlugin *plugin, GsApp *app, ApkdPackage *package) gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_PACKAGE); } +typedef struct +{ + GsAppList *missing_pkgname_list; /* (owned) (nullable) */ + GsAppList *refine_apps_list; /* (owned) (not nullable) */ + GsPluginRefineFlags flags; +} RefineData; + +static void +refine_data_free (RefineData *data) +{ + g_clear_object (&data->missing_pkgname_list); + g_clear_object (&data->refine_apps_list); + + g_free (data); +} + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (RefineData, refine_data_free); + +static void +refine_apk_packages_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data); + +static void +fix_app_missing_appstream_async (GsPlugin *plugin, + GsAppList *list, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +static gboolean +gs_plugin_apk_refine_finish (GsPlugin *plugin, + GAsyncResult *result, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (result), error); +} + +static void +gs_plugin_apk_refine_async (GsPlugin *plugin, + GsAppList *list, + GsPluginRefineFlags flags, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_autoptr (GTask) task = NULL; + g_autoptr (GError) local_error = NULL; + g_autoptr (GsAppList) missing_pkgname_list = gs_app_list_new (); + g_autoptr (GsAppList) refine_apps_list = gs_app_list_new (); + RefineData *data = g_new0 (RefineData, 1); + + data->missing_pkgname_list = g_object_ref (missing_pkgname_list); + data->refine_apps_list = g_object_ref (refine_apps_list); + data->flags = flags; + + task = g_task_new (plugin, cancellable, callback, user_data); + g_task_set_source_tag (task, gs_plugin_apk_refine_async); + g_task_set_task_data (task, data, (GDestroyNotify) refine_data_free); + + g_debug ("Starting refinining process"); + + for (guint i = 0; i < gs_app_list_length (list); i++) + { + GsApp *app = gs_app_list_index (list, i); + GPtrArray *sources; + AsBundleKind bundle_kind = gs_app_get_bundle_kind (app); + + if (gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD) || + gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY) + { + g_debug ("App %s has quirk WILDCARD or is a repository; not refining!", gs_app_get_unique_id (app)); + continue; + } + + /* Only package and unknown (desktop or metainfo file with upstream AS) + * belog to us */ + if (bundle_kind != AS_BUNDLE_KIND_UNKNOWN && + bundle_kind != AS_BUNDLE_KIND_PACKAGE) + { + g_debug ("App %s has bundle kind %s; not refining!", gs_app_get_unique_id (app), + as_bundle_kind_to_string (bundle_kind)); + continue; + } + + /* set management plugin for system apps just created by appstream */ + if (gs_app_has_management_plugin (app, NULL) && + gs_app_get_scope (app) == AS_COMPONENT_SCOPE_SYSTEM && + g_strcmp0 (gs_app_get_metadata_item (app, "GnomeSoftware::Creator"), "appstream") == 0) + { + /* If appstream couldn't assign a source, it means the app does not + * have an entry in the distribution-generated metadata. That should + * be fixed in the app. We try to workaround it by finding the + * owner of the metainfo or desktop file */ + if (gs_app_get_source_default (app) == NULL) + { + g_debug ("App %s missing pkgname. Will try to resolve via metainfo/desktop file", + gs_app_get_unique_id (app)); + gs_app_list_add (missing_pkgname_list, app); + continue; + } + + g_debug ("Setting ourselves as management plugin for app %s", gs_app_get_unique_id (app)); + gs_app_set_management_plugin (app, plugin); + } + + if (!gs_app_has_management_plugin (app, plugin)) + { + g_debug ("Ignoring app %s, not owned by apk", gs_app_get_unique_id (app)); + continue; + } + + sources = gs_app_get_sources (app); + if (sources->len == 0) + { + g_warning ("app %s has missing sources; skipping", gs_app_get_unique_id (app)); + continue; + } + if (sources->len >= 2) + { + g_warning ("app %s has %d > 1 sources; skipping", gs_app_get_unique_id (app), sources->len); + continue; + } + + gs_app_list_add (refine_apps_list, app); + } + + fix_app_missing_appstream_async (plugin, missing_pkgname_list, + cancellable, refine_apk_packages_cb, + g_steal_pointer (&task)); +} + +static void +apk_polkit_search_files_owners_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data); + /** * fix_app_missing_appstream: * @plugin: The apk GsPlugin. * @list: The GsAppList to resolve the metainfo/desktop files for. * @cancellable: GCancellable to cancel synchronous dbus call. + * @task: FIXME! * * If the appstream plugin could not find the apps in the distribution metadata, * it might have created the application from the metainfo or desktop files * installed. It will contain some basic information, but the apk package to * which it belongs (the source) needs to completed by us. **/ -static gboolean -fix_app_missing_appstream (GsPlugin *plugin, - GsAppList *list, - GCancellable *cancellable, - GError **error) +static void +fix_app_missing_appstream_async (GsPlugin *plugin, + GsAppList *list, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { GsPluginApk *self = GS_PLUGIN_APK (plugin); g_autofree const gchar **fn_array = NULL; g_autoptr (GsAppList) search_list = gs_app_list_new (); - g_autoptr (GVariant) search_results = NULL; + g_autoptr (GTask) task = NULL; + + task = g_task_new (plugin, cancellable, callback, user_data); + g_task_set_source_tag (task, gs_plugin_apk_refine_async); + g_task_set_task_data (task, g_object_ref (list), g_object_unref); if (gs_app_list_length (list) == 0) - return TRUE; + { + g_task_return_boolean (task, TRUE); + return; + } g_debug ("Trying to find source packages for %d apps", gs_app_list_length (list)); /* The appstream plugin sets some metadata on apps that come from desktop @@ -635,13 +814,33 @@ fix_app_missing_appstream (GsPlugin *plugin, } if (gs_app_list_length (search_list) == 0) - return TRUE; + { + g_task_return_boolean (task, TRUE); + return; + } - if (!apk_polkit2_call_search_files_owners_sync (self->proxy, fn_array, - APK_POLKIT_CLIENT_DETAILS_FLAGS_NONE, - &search_results, cancellable, - error)) - return FALSE; + apk_polkit2_call_search_files_owners (self->proxy, fn_array, + APK_POLKIT_CLIENT_DETAILS_FLAGS_NONE, + cancellable, apk_polkit_search_files_owners_cb, + g_steal_pointer (&task)); +} + +static void +apk_polkit_search_files_owners_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data) +{ + g_autoptr (GTask) task = g_steal_pointer (&user_data); + GsPluginApk *self = g_task_get_source_object (task); + g_autoptr (GError) local_error = NULL; + g_autoptr (GVariant) search_results = NULL; + GsAppList *search_list = g_task_get_task_data (task); + + if (!apk_polkit2_call_search_files_owners_finish (self->proxy, &search_results, res, &local_error)) + { + g_task_return_error (task, g_steal_pointer (&local_error)); + return; + } g_assert (g_variant_n_children (search_results) == gs_app_list_length (search_list)); for (int i = 0; i < gs_app_list_length (search_list); i++) @@ -653,42 +852,92 @@ fix_app_missing_appstream (GsPlugin *plugin, apk_pkg_variant = g_variant_get_child_value (search_results, i); if (!gs_plugin_apk_variant_to_apkd (apk_pkg_variant, &apk_pkg)) { - g_warning ("Couldn't find any package owning file '%s'", - fn_array[i]); + // TODO: We need fn_array if we want to print this info! + /* g_warning ("Couldn't find any package owning file '%s'", */ + /* fn_array[i]); */ continue; } g_debug ("Found pkgname '%s' for app %s: adding source and setting management plugin", apk_pkg.name, gs_app_get_unique_id (app)); gs_app_add_source (app, apk_pkg.name); - gs_app_set_management_plugin (app, plugin); + gs_app_set_management_plugin (app, GS_PLUGIN (self)); } - return TRUE; + g_task_return_boolean (task, TRUE); } +static gboolean +fix_app_missing_appstream_finish (GsPlugin *plugin, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +apk_polkit_get_packages_details_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data); + /** - * refine_apk_packages: + * refine_apk_packages_cb: * @plugin: The apk GsPlugin. * @list: The list of apps to refine. * @flags: TheGsPluginRefineFlags which determine what data we add. * @cancellable: GCancellable to cancel resolving what app owns the appstream/desktop file. - * @error: GError which is set if something goes wrong. + * @task: The task to follow the asynchronous execution. * - * Get details from apk package for a specific app and fill-in requested refine data. + * Get details from apk package for a list of apps and fill-in requested refine data. **/ -static gboolean -refine_apk_packages (GsPlugin *plugin, - GsAppList *list, - GsPluginRefineFlags flags, - GCancellable *cancellable, - GError **error) +static void +refine_apk_packages_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data) { - GsPluginApk *self = GS_PLUGIN_APK (plugin); + g_autoptr (GTask) task = G_TASK (g_steal_pointer (&user_data)); + GCancellable *cancellable = g_task_get_cancellable (task); + GsPluginApk *self = g_task_get_source_object (task); g_autofree const gchar **source_array = NULL; guint details_flags = APK_POLKIT_CLIENT_DETAILS_FLAGS_PACKAGE_STATE; - g_autoptr (GVariant) apk_pkgs = NULL; + RefineData *data = g_task_get_task_data (task); + GsAppList *list = data->refine_apps_list; + GsAppList *missing_pkgname_list = data->missing_pkgname_list; + GsPluginRefineFlags flags = data->flags; + g_autoptr (GError) local_error = NULL; + + if (!fix_app_missing_appstream_finish (GS_PLUGIN (self), res, &local_error)) + { + // TODO: We should print a warning, but continue execution! + // There's no reason failing to find some package should stop + // the rest of the processing. + g_task_return_error (task, g_steal_pointer (&local_error)); + return; + } + + if (!(flags & + (GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL | + GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE))) + { + g_task_return_boolean (task, TRUE); + return; + } + + for (int i = 0; i < gs_app_list_length (missing_pkgname_list); i++) + { + GsApp *app = gs_app_list_index (missing_pkgname_list, i); + if (gs_app_get_source_default (app) != NULL) + gs_app_list_add (list, app); + } if (gs_app_list_length (list) == 0) - return TRUE; + { + g_task_return_boolean (task, TRUE); + return; + } if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION) details_flags |= APK_POLKIT_CLIENT_DETAILS_FLAGS_ALL; @@ -712,10 +961,30 @@ refine_apk_packages (GsPlugin *plugin, } source_array[gs_app_list_length (list)] = NULL; - if (!apk_polkit2_call_get_packages_details_sync (self->proxy, source_array, - details_flags, &apk_pkgs, - cancellable, error)) - return FALSE; + apk_polkit2_call_get_packages_details (self->proxy, source_array, + details_flags, + cancellable, + apk_polkit_get_packages_details_cb, + g_steal_pointer (&task)); +} + +static void +apk_polkit_get_packages_details_cb (GObject *object_source, + GAsyncResult *res, + gpointer user_data) +{ + g_autoptr (GTask) task = g_steal_pointer (&user_data); + GsPluginApk *self = g_task_get_source_object (task); + g_autoptr (GError) local_error = NULL; + g_autoptr (GVariant) apk_pkgs = NULL; + RefineData *data = g_task_get_task_data (task); + GsAppList *list = data->refine_apps_list; + + if (!apk_polkit2_call_get_packages_details_finish (self->proxy, &apk_pkgs, res, &local_error)) + { + g_task_return_error (task, g_steal_pointer (&local_error)); + return; + } g_assert (gs_app_list_length (list) == g_variant_n_children (apk_pkgs)); for (int i = 0; i < gs_app_list_length (list); i++) @@ -739,138 +1008,12 @@ refine_apk_packages (GsPlugin *plugin, g_warning ("source: '%s' and the pkg name: '%s' differ", source, apk_pkg.name); continue; } - set_app_metadata (plugin, app, &apk_pkg); + set_app_metadata (GS_PLUGIN (self), app, &apk_pkg); /* We should only set generic apps for OS updates */ if (gs_app_get_kind (app) == AS_COMPONENT_KIND_GENERIC) gs_app_set_special_kind (app, GS_APP_SPECIAL_KIND_OS_UPDATE); } - return TRUE; -} - -static gboolean -gs_plugin_apk_refine_finish (GsPlugin *plugin, - GAsyncResult *result, - GError **error) -{ - return g_task_propagate_boolean (G_TASK (result), error); -} - -static void -gs_plugin_apk_refine_async (GsPlugin *plugin, - GsAppList *list, - GsPluginRefineFlags flags, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_autoptr (GTask) task = NULL; - g_autoptr (GError) local_error = NULL; - g_autoptr (GsAppList) refine_apps_list = NULL; - g_autoptr (GsAppList) missing_pkgname_list = NULL; - - task = g_task_new (plugin, cancellable, callback, user_data); - g_task_set_source_tag (task, gs_plugin_apk_refine_async); - - refine_apps_list = gs_app_list_new (); - missing_pkgname_list = gs_app_list_new (); - - g_debug ("Starting refinining process"); - - for (guint i = 0; i < gs_app_list_length (list); i++) - { - GsApp *app = gs_app_list_index (list, i); - GPtrArray *sources; - AsBundleKind bundle_kind = gs_app_get_bundle_kind (app); - - if (gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD) || - gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY) - { - g_debug ("App %s has quirk WILDCARD or is a repository; not refining!", gs_app_get_unique_id (app)); - continue; - } - - /* Only package and unknown (desktop or metainfo file with upstream AS) - * belog to us */ - if (bundle_kind != AS_BUNDLE_KIND_UNKNOWN && - bundle_kind != AS_BUNDLE_KIND_PACKAGE) - { - g_debug ("App %s has bundle kind %s; not refining!", gs_app_get_unique_id (app), - as_bundle_kind_to_string (bundle_kind)); - continue; - } - - /* set management plugin for system apps just created by appstream */ - if (gs_app_has_management_plugin (app, NULL) && - gs_app_get_scope (app) == AS_COMPONENT_SCOPE_SYSTEM && - g_strcmp0 (gs_app_get_metadata_item (app, "GnomeSoftware::Creator"), "appstream") == 0) - { - /* If appstream couldn't assign a source, it means the app does not - * have an entry in the distribution-generated metadata. That should - * be fixed in the app. We try to workaround it by finding the - * owner of the metainfo or desktop file */ - if (gs_app_get_source_default (app) == NULL) - { - g_debug ("App %s missing pkgname. Will try to resolve via metainfo/desktop file", - gs_app_get_unique_id (app)); - gs_app_list_add (missing_pkgname_list, app); - continue; - } - - g_debug ("Setting ourselves as management plugin for app %s", gs_app_get_unique_id (app)); - gs_app_set_management_plugin (app, plugin); - } - - if (!gs_app_has_management_plugin (app, plugin)) - { - g_debug ("Ignoring app %s, not owned by apk", gs_app_get_unique_id (app)); - continue; - } - - sources = gs_app_get_sources (app); - if (sources->len == 0) - { - g_warning ("app %s has missing sources; skipping", gs_app_get_unique_id (app)); - continue; - } - if (sources->len >= 2) - { - g_warning ("app %s has %d > 1 sources; skipping", gs_app_get_unique_id (app), sources->len); - continue; - } - - gs_app_list_add (refine_apps_list, app); - } - - if (!fix_app_missing_appstream (plugin, missing_pkgname_list, cancellable, &local_error)) - { - g_task_return_error (task, g_steal_pointer (&local_error)); - return; - } - - for (int i = 0; i < gs_app_list_length (missing_pkgname_list); i++) - { - GsApp *app = gs_app_list_index (missing_pkgname_list, i); - if (gs_app_get_source_default (app) != NULL) - gs_app_list_add (refine_apps_list, app); - } - - if (flags & - (GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL | - GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE)) - { - if (!refine_apk_packages (plugin, refine_apps_list, flags, cancellable, &local_error)) - { - g_task_return_error (task, g_steal_pointer (&local_error)); - return; - } - } - g_task_return_boolean (task, TRUE); } diff --git a/tests/apkpolkit2.py b/tests/apkpolkit2.py index b7e6d5a..503e256 100644 --- a/tests/apkpolkit2.py +++ b/tests/apkpolkit2.py @@ -51,7 +51,7 @@ def load(mock, parameters): mock.AddMethods(MAIN_IFACE, [ ('AddRepository', 's', '', ''), ('RemoveRepository', 's', '', ''), - ('UpdateRepositories', '', '', ''), + ('UpdateRepositories', '', '', 'time.sleep(2)'), ])