aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-14 16:29:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-16 16:42:35 +0200
commit03905bcf1bcfd9e7932fcac4283c5817058a25ce (patch)
treeb643d3bedf436bfcd8956b25133d5674b6b18e36 /loader
parent96281a6c4f818311a6df90c0d8b8f537a61e1090 (diff)
Invent root path web interface configuration option
Diffstat (limited to 'loader')
-rw-r--r--loader/buildfile2
-rw-r--r--loader/loader.cxx14
2 files changed, 15 insertions, 1 deletions
diff --git a/loader/buildfile b/loader/buildfile
index d4e4678..bb5684e 100644
--- a/loader/buildfile
+++ b/loader/buildfile
@@ -15,6 +15,6 @@ loader = cxx{loader} cli.cxx{options}
exe{brep-loader}: $loader ../brep/libso{brep} $libs
cli.options += -I $src_root --include-with-brackets --include-prefix loader \
---guard-prefix LOADER
+--guard-prefix LOADER --cli-namespace brep::cli
cli.cxx{options}: cli{options}
diff --git a/loader/loader.cxx b/loader/loader.cxx
index ee3e5fa..e9f5566 100644
--- a/loader/loader.cxx
+++ b/loader/loader.cxx
@@ -426,6 +426,20 @@ load_repositories (const shared_ptr<repository>& rp, database& db)
//
rp->url = move (rm.url);
+ // @@ Should we throw if url is not available for external repository ?
+ // Can, basically, repository be available on the web but have no web
+ // interface associated ?
+ //
+ if (rp->url)
+ {
+ // Normalize web interface url adding trailing '/' if not present.
+ //
+ auto& u (*rp->url);
+ assert (!u.empty ());
+ if (u.back () != '/')
+ u += '/';
+ }
+
if (rp->internal)
{
rp->email = move (rm.email);