From e0f96605a6d150152169c636ef4841e9b298fdfd Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Thu, 14 May 2015 13:00:58 +0200 Subject: [PATCH] mergerepo: Use file:// protocol in local baseurl --- src/mergerepo_c.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c index 50f733f..ebdadca 100644 --- a/src/mergerepo_c.c +++ b/src/mergerepo_c.c @@ -39,6 +39,7 @@ #include "sqlite.h" #include "threads.h" #include "xml_file.h" +#include "cleanup.h" // TODO: @@ -804,8 +805,10 @@ add_package(cr_Package *pkg, if (!list) { list = g_slist_prepend(list, pkg); - if (!pkg->location_base) { - pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, repopath); + if ((!pkg->location_base || *pkg->location_base == '\0') && repopath) { + _cleanup_free_ gchar *repopath_with_protocol = NULL; + repopath_with_protocol = g_strconcat("file://", repopath, NULL); + pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, repopath_with_protocol); } g_hash_table_insert (merged, (gpointer) pkg->name, (gpointer) list); return 1; -- 2.7.4