From b0b833e6a7330b38bc2732d681a8f48c380d49e8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 18 Jan 2018 23:55:47 +0300 Subject: Allow enforcing file:// notation for repository_url::string() --- libbpkg/manifest.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libbpkg/manifest.cxx') diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx index 9859a47..306649d 100644 --- a/libbpkg/manifest.cxx +++ b/libbpkg/manifest.cxx @@ -1524,7 +1524,7 @@ namespace bpkg repository_url_traits::string_type repository_url_traits:: translate_scheme (string_type& url, const scheme_type& scheme, - const optional& /*authority*/, + const optional& authority, const optional& path, const optional& /*query*/, const optional& fragment) @@ -1536,16 +1536,10 @@ namespace bpkg case scheme_type::git: return "git"; case scheme_type::file: { - // If there is no fragment present then represent the URL object as a - // local path. - // assert (path); - if (fragment) - { - assert (path->absolute ()); + if (path->absolute () && (fragment || authority)) return "file"; - } url = path->relative () ? path->posix_string () : path->string (); return string_type (); -- cgit v1.1