repo: use the skip summary download optimization for repo_remote_fetch_summary
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
58b48424bc
commit
2bf84d7e5d
|
|
@ -1750,9 +1750,7 @@ repo_remote_fetch_summary (OstreeRepo *self,
|
||||||
g_autoptr(GMainContext) mainctx = NULL;
|
g_autoptr(GMainContext) mainctx = NULL;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
SoupURI *base_uri = NULL;
|
SoupURI *base_uri = NULL;
|
||||||
uint i;
|
gboolean from_cache = FALSE;
|
||||||
const char *filenames[] = {"summary", "summary.sig"};
|
|
||||||
GBytes **outputs[] = {out_summary, out_signatures};
|
|
||||||
|
|
||||||
mainctx = g_main_context_new ();
|
mainctx = g_main_context_new ();
|
||||||
g_main_context_push_thread_default (mainctx);
|
g_main_context_push_thread_default (mainctx);
|
||||||
|
|
@ -1782,20 +1780,42 @@ repo_remote_fetch_summary (OstreeRepo *self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (filenames); i++)
|
if (!_ostree_preload_metadata_file (self,
|
||||||
|
fetcher,
|
||||||
|
base_uri,
|
||||||
|
"summary.sig",
|
||||||
|
metalink_url_string ? TRUE : FALSE,
|
||||||
|
out_signatures,
|
||||||
|
cancellable,
|
||||||
|
error))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (*out_signatures)
|
||||||
|
{
|
||||||
|
if (!_ostree_repo_load_cache_summary_if_same_sig (self,
|
||||||
|
name,
|
||||||
|
*out_signatures,
|
||||||
|
out_summary,
|
||||||
|
cancellable,
|
||||||
|
error))
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*out_summary)
|
||||||
|
from_cache = TRUE;
|
||||||
{
|
{
|
||||||
if (!_ostree_preload_metadata_file (self,
|
if (!_ostree_preload_metadata_file (self,
|
||||||
fetcher,
|
fetcher,
|
||||||
base_uri,
|
base_uri,
|
||||||
filenames[i],
|
"summary",
|
||||||
metalink_url_string ? TRUE : FALSE,
|
metalink_url_string ? TRUE : FALSE,
|
||||||
outputs[i],
|
out_summary,
|
||||||
cancellable,
|
cancellable,
|
||||||
error))
|
error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*out_summary && *out_signatures)
|
if (!from_cache && *out_summary && *out_signatures)
|
||||||
{
|
{
|
||||||
if (!_ostree_repo_cache_summary (self,
|
if (!_ostree_repo_cache_summary (self,
|
||||||
name,
|
name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue