From dce6f748bb73ee0b439b41b4901a77d0498f1cac Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 22 Oct 2020 11:11:28 +0200 Subject: [PATCH] summaries: Rework the debug spew for summary/cache loading This way its easier to tell exactly what happens. --- common/flatpak-dir.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index abdcadf6..9c6c72a7 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -11131,18 +11131,22 @@ flatpak_dir_remote_fetch_summary (FlatpakDir *self, } else { - g_debug ("Fetching summary file for remote ‘%s’", name_or_uri); if (only_cached) { if (!flatpak_dir_remote_load_cached_summary (self, name_or_uri, NULL, ".sig", &summary, &summary_sig, cancellable, error)) return FALSE; + g_debug ("Loaded summary from cache for remote ‘%s’", name_or_uri); + } + else + { + g_debug ("Fetching summary file for remote ‘%s’", name_or_uri); + if (!ostree_repo_remote_fetch_summary (self->repo, name_or_uri, + &summary, &summary_sig, + cancellable, + error)) + return FALSE; } - else if (!ostree_repo_remote_fetch_summary (self->repo, name_or_uri, - &summary, &summary_sig, - cancellable, - error)) - return FALSE; } if (summary == NULL) @@ -11266,7 +11270,6 @@ flatpak_dir_remote_fetch_summary_index (FlatpakDir *self, flatpak_dir_remote_load_cached_summary (self, name_or_uri, ".idx", ".idx.sig", &cached_index, &cached_index_sig, cancellable, &cache_error); - g_debug ("Fetching summary index file for remote ‘%s’", name_or_uri); if (only_cached) { if (cached_index == NULL) @@ -11274,6 +11277,7 @@ flatpak_dir_remote_fetch_summary_index (FlatpakDir *self, g_propagate_error (error, g_steal_pointer (&cache_error)); return FALSE; } + g_debug ("Loaded summary index from cache for remote ‘%s’", name_or_uri); index = g_steal_pointer (&cached_index); index_sig = g_steal_pointer (&cached_index_sig); @@ -11282,6 +11286,8 @@ flatpak_dir_remote_fetch_summary_index (FlatpakDir *self, { g_autofree char *index_url = g_build_filename (url, "summary.idx", NULL); + g_debug ("Fetching summary index file for remote ‘%s’", name_or_uri); + if (gpg_verify_summary) { g_autofree char *index_sig_url = g_build_filename (url, "summary.idx.sig", NULL); @@ -11431,6 +11437,8 @@ flatpak_dir_remote_fetch_indexed_summary (FlatpakDir *self, cancellable, error)) return FALSE; } + else + g_debug ("Loaded indexed summary file %s from cache for remote ‘%s’", checksum, name_or_uri); /* Cache in memory */ if (!is_local && !only_cached)