diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-16 19:06:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-16 19:06:27 +0200 |
commit | 1f3774634b122e4ace102c8643f6d9281e3a20de (patch) | |
tree | 1eb2df333c9cd78581ab8840c508036b6aabb565 /brep | |
parent | d5b0b7b1d099125bf6f86b2e49acdbf2e6625beb (diff) |
Make root configuration option notation to be the same as of AP_ROOT configuration variable
Diffstat (limited to 'brep')
-rw-r--r-- | brep/options.cli | 2 | ||||
-rw-r--r-- | brep/package-details.cxx | 5 | ||||
-rw-r--r-- | brep/package-search.cxx | 5 | ||||
-rw-r--r-- | brep/package-version-details.cxx | 5 | ||||
-rw-r--r-- | brep/repository-details.cxx | 5 | ||||
-rw-r--r-- | brep/types-parsers.cxx | 3 |
6 files changed, 17 insertions, 8 deletions
diff --git a/brep/options.cli b/brep/options.cli index 77dc45a..4126f4a 100644 --- a/brep/options.cli +++ b/brep/options.cli @@ -16,7 +16,7 @@ namespace brep class module { std::uint16_t verb = 0; - butl::dir_path root = "/"; + butl::dir_path root = ""; }; class db diff --git a/brep/package-details.cxx b/brep/package-details.cxx index 780d98a..8be6108 100644 --- a/brep/package-details.cxx +++ b/brep/package-details.cxx @@ -70,7 +70,10 @@ namespace brep // server process. // static const size_t rp (options_->results_on_page ()); - static const dir_path& rt (options_->root ()); + static const dir_path& rt ( + options_->root ().empty () + ? dir_path ("/") + : options_->root ()); const string& name (*rq.path ().rbegin ()); const string en (mime_url_encode (name)); diff --git a/brep/package-search.cxx b/brep/package-search.cxx index 1617e58..6a349b0 100644 --- a/brep/package-search.cxx +++ b/brep/package-search.cxx @@ -65,7 +65,10 @@ namespace brep // server process. // static const size_t rp (options_->results_on_page ()); - static const dir_path& rt (options_->root ()); + static const dir_path& rt ( + options_->root ().empty () + ? dir_path ("/") + : options_->root ()); params::package_search pr; diff --git a/brep/package-version-details.cxx b/brep/package-version-details.cxx index d00c10a..a1fe017 100644 --- a/brep/package-version-details.cxx +++ b/brep/package-version-details.cxx @@ -54,7 +54,10 @@ namespace brep // The module options object is not changed after being created once per // server process. // - static const dir_path& rt (options_->root ()); + static const dir_path& rt ( + options_->root ().empty () + ? dir_path ("/") + : options_->root ()); auto i (rq.path ().rbegin ()); version v; diff --git a/brep/repository-details.cxx b/brep/repository-details.cxx index b8a2e5b..86a6099 100644 --- a/brep/repository-details.cxx +++ b/brep/repository-details.cxx @@ -50,7 +50,10 @@ namespace brep // The module options object is not changed after being created once per // server process. // - static const dir_path& rt (options_->root ()); + static const dir_path& rt ( + options_->root ().empty () + ? dir_path ("/") + : options_->root ()); xml::serializer s (rs.content (), "About"); const string& title (s.output_name ()); diff --git a/brep/types-parsers.cxx b/brep/types-parsers.cxx index f7c2f11..6236000 100644 --- a/brep/types-parsers.cxx +++ b/brep/types-parsers.cxx @@ -28,9 +28,6 @@ namespace brep try { x = T (v); - - if (x.empty ()) - throw invalid_value (o, v); } catch (const invalid_path&) { |