mergerepo: Do not prepend file:// if protocol is already specified
authorTomas Mlcoch <tmlcoch@redhat.com>
Fri, 15 May 2015 05:59:38 +0000 (07:59 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Fri, 15 May 2015 05:59:38 +0000 (07:59 +0200)
src/mergerepo_c.c

index d45aa2b..0c028e6 100644 (file)
@@ -810,7 +810,11 @@ add_package(cr_Package *pkg,
         list = g_slist_prepend(list, pkg);
         if ((!pkg->location_base || *pkg->location_base == '\0') && repopath) {
             _cleanup_free_ gchar *repopath_with_protocol = NULL;
-            repopath_with_protocol = g_strconcat("file://", repopath, NULL);
+            if (*repopath == '/')
+                // Repo path is local absolute path
+                repopath_with_protocol = g_strconcat("file://", repopath, NULL);
+            else
+                repopath_with_protocol = g_strdup(repopath);
             pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, repopath_with_protocol);
         }
         g_hash_table_insert (merged, (gpointer) pkg->name, (gpointer) list);