[gnome-software/wip/mcrha/ci-test] more debug prints



commit c2c0ddcc7f32e3315fe228827d7aa9d2d8fcd3d9
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 16 15:52:52 2022 +0100

    more debug prints

 plugins/flatpak/gs-plugin-flatpak.c | 33 +++++++++++++++++++++++++++++++++
 plugins/flatpak/gs-self-test.c      |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
---
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index 15e60404d..da12b030c 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -1236,6 +1236,7 @@ gs_plugin_app_install (GsPlugin *plugin,
        gboolean already_installed = FALSE;
        gboolean interactive = gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE);
 
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        /* queue for install if installation needs the network */
        if (!app_has_local_source (app) &&
            !gs_plugin_get_network_available (plugin)) {
@@ -1243,20 +1244,25 @@ gs_plugin_app_install (GsPlugin *plugin,
                return TRUE;
        }
 
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        /* set the app scope */
        gs_plugin_flatpak_ensure_scope (plugin, app);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* not supported */
        flatpak = gs_plugin_flatpak_get_handler (self, app);
        if (flatpak == NULL)
                return TRUE;
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* is a source, handled by dedicated function */
        g_return_val_if_fail (gs_app_get_kind (app) != AS_COMPONENT_KIND_REPOSITORY, FALSE);
 
        /* build */
        transaction = _build_transaction (plugin, flatpak, interactive, cancellable, error);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        if (transaction == NULL) {
+               g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                gs_flatpak_error_convert (error);
                return FALSE;
        }
@@ -1264,12 +1270,14 @@ gs_plugin_app_install (GsPlugin *plugin,
        /* add to the transaction cache for quick look up -- other unrelated
         * refs will be matched using gs_plugin_flatpak_find_app_by_ref() */
        gs_flatpak_transaction_add_app (transaction, app);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* add flatpakref */
        if (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_REF) {
                GFile *file = gs_app_get_local_file (app);
                g_autoptr(GBytes) blob = NULL;
                if (file == NULL) {
+                       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                        g_set_error (error,
                                     GS_PLUGIN_ERROR,
                                     GS_PLUGIN_ERROR_NOT_SUPPORTED,
@@ -1277,20 +1285,25 @@ gs_plugin_app_install (GsPlugin *plugin,
                                     gs_app_get_unique_id (app));
                        return FALSE;
                }
+               g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                blob = g_file_load_bytes (file, cancellable, NULL, error);
                if (blob == NULL) {
                        gs_flatpak_error_convert (error);
                        return FALSE;
                }
+               g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (!flatpak_transaction_add_install_flatpakref (transaction, blob, error)) {
                        gs_flatpak_error_convert (error);
                        return FALSE;
                }
+               g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* add bundle */
        } else if (gs_flatpak_app_get_file_kind (app) == GS_FLATPAK_APP_FILE_KIND_BUNDLE) {
                GFile *file = gs_app_get_local_file (app);
+               g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (file == NULL) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                        g_set_error (error,
                                     GS_PLUGIN_ERROR,
                                     GS_PLUGIN_ERROR_NOT_SUPPORTED,
@@ -1298,18 +1311,22 @@ gs_plugin_app_install (GsPlugin *plugin,
                                     gs_app_get_unique_id (app));
                        return FALSE;
                }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (!flatpak_transaction_add_install_bundle (transaction, file,
                                                             NULL, error)) {
                        gs_flatpak_error_convert (error);
                        return FALSE;
                }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* add normal ref */
        } else {
                g_autofree gchar *ref = gs_flatpak_app_get_ref_display (app);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (!flatpak_transaction_add_install (transaction,
                                                      gs_app_get_origin (app),
                                                      ref, NULL, &error_local)) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                        /* Somehow, the app might already be installed. */
                        if (g_error_matches (error_local, FLATPAK_ERROR,
                                             FLATPAK_ERROR_ALREADY_INSTALLED)) {
@@ -1323,23 +1340,30 @@ gs_plugin_app_install (GsPlugin *plugin,
                }
        }
 
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        gs_flatpak_cover_addons_in_transaction (plugin, transaction, app, GS_APP_STATE_INSTALLING);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        if (!interactive) {
                /* FIXME: Add additional details here, especially the download
                 * size bounds (using `size-minimum` and `size-maximum`, both
                 * type `t`). */
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (!gs_metered_block_app_on_download_scheduler (app, &schedule_entry_handle, cancellable, 
&error_local)) {
                        g_warning ("Failed to block on download scheduler: %s",
                                   error_local->message);
                        g_clear_error (&error_local);
                }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        }
 
        /* run transaction */
        if (!already_installed) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                gs_app_set_state (app, GS_APP_STATE_INSTALLING);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                if (!gs_flatpak_transaction_run (transaction, cancellable, &error_local)) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                        /* Somehow, the app might already be installed. */
                        if (g_error_matches (error_local, FLATPAK_ERROR,
                                             FLATPAK_ERROR_ALREADY_INSTALLED)) {
@@ -1353,30 +1377,38 @@ gs_plugin_app_install (GsPlugin *plugin,
                                return FALSE;
                        }
                }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        }
 
        if (already_installed) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                /* Set the app back to UNKNOWN so that refining it gets all the right details. */
                g_debug ("App %s is already installed", gs_app_get_unique_id (app));
                gs_app_set_state (app, GS_APP_STATE_UNKNOWN);
        }
 
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        remove_schedule_entry (schedule_entry_handle);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        /* get any new state */
        if (!gs_flatpak_refresh (flatpak, G_MAXUINT, interactive, cancellable, error)) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                gs_flatpak_error_convert (error);
                return FALSE;
        }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        if (!gs_flatpak_refine_app (flatpak, app,
                                    GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID,
                                    interactive,
                                    cancellable, error)) {
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
                g_prefix_error (error, "failed to run refine for %s: ",
                                gs_app_get_unique_id (app));
                gs_flatpak_error_convert (error);
                return FALSE;
        }
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        gs_flatpak_refine_addons (flatpak,
                                  app,
@@ -1384,6 +1416,7 @@ gs_plugin_app_install (GsPlugin *plugin,
                                  GS_APP_STATE_INSTALLING,
                                  interactive,
                                  cancellable);
+       g_message ("   yyy %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
 
        return TRUE;
 }
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index c9f94b931..7ebf49c48 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -424,7 +424,7 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_INSTALL,
                                         "app", app,
                                         NULL);
-       g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
+       g_message ("xxx %s: %d app:%p\n", __FUNCTION__, __LINE__, app);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        g_message ("xxx %s: %d\n", __FUNCTION__, __LINE__);
        gs_test_flush_main_context ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]