Skip to content

Commit

Permalink
Fix loading local repositories
Browse files Browse the repository at this point in the history
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 <r4f4rfs@gmail.com>
  • Loading branch information
r4f4 authored and ignatenkobrain committed Jul 8, 2019
1 parent 72a98d5 commit d2b51e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit d2b51e0

Please sign in to comment.