aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:23:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:23:53 +0300
commitdbe40c32018cf7d2002e6511d53c598c3bb45155 (patch)
treed6fbdd0a8f737fcdb73d0111e4e97b36f232d9cb
parent423f8752de65d91cc1f89eda1408022a305df2f9 (diff)
Adapt to repository_url(string) ctor throwing invalid_argument for empty string
-rw-r--r--libbrep/common.hxx4
-rw-r--r--load/load.cxx4
2 files changed, 5 insertions, 3 deletions
diff --git a/libbrep/common.hxx b/libbrep/common.hxx
index 7860876..df838a7 100644
--- a/libbrep/common.hxx
+++ b/libbrep/common.hxx
@@ -229,7 +229,9 @@ namespace brep
#pragma db map type(repository_location) as(string) \
to((?).url ().string ()) \
- from(brep::repository_location (brep::repository_url (?), \
+ from(brep::repository_location ((?).empty () \
+ ? bpkg::repository_url () \
+ : brep::repository_url (?), \
brep::repository_type::pkg))
// Version comparison operators.
diff --git a/load/load.cxx b/load/load.cxx
index e63f1f5..ca7c6c7 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -160,7 +160,7 @@ load_repositories (path p)
// process. Note that the resulting absolute path should be a valid
// repository location.
//
- dir_path cache_path = dir_path (string (nv, vp));
+ dir_path cache_path (string (nv, vp));
if (cache_path.relative ())
cache_path = p.directory () / cache_path;
@@ -177,7 +177,7 @@ load_repositories (path p)
{
bad_line (string ("invalid cache path: ") + e.what ());
}
- catch (const invalid_argument& e) // Thrown by repository_location().
+ catch (const invalid_argument& e) // Thrown by repository_*().
{
bad_line (string ("invalid cache path: ") + e.what ());
}