From d2b51e08852eabd9605fa315378380f90e0c5f84 Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Mon, 8 Jul 2019 14:35:27 +0200 Subject: [PATCH] Fix loading local repositories Closes #68 Since we are now operating from the cache, we need to copy the repomd.xml file from local repos there otherwise we'll get errors about 'No such file'. Signed-off-by: Rafael Fonseca --- fus.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fus.c b/fus.c index e16e432..d155099 100644 --- a/fus.c +++ b/fus.c @@ -476,10 +476,13 @@ download_to_path (SoupSession *session, GError **error) { g_autoptr(SoupURI) parsed = soup_uri_new (url); + g_autoptr(GFile) file = g_file_new_for_path (path); + if (!SOUP_URI_VALID_FOR_HTTP (parsed)) { - g_debug ("%s is already a local file", url); - return TRUE; + /* Local file, so just copy to the cache */ + g_autoptr(GFile) local = g_file_new_for_path (url); + return g_file_copy (local, file, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, error); } g_debug ("Downloading %s to %s", url, path); @@ -489,7 +492,6 @@ download_to_path (SoupSession *session, if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) return FALSE; - g_autoptr(GFile) file = g_file_new_for_path (path); g_autoptr(GFileOutputStream) ostream = g_file_replace (file, NULL, FALSE,