aboutsummaryrefslogtreecommitdiff
path: root/brep/mod-repository-root.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-03-06 13:52:48 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-03-07 00:05:29 +0300
commitb72424fca7a6af6ff7921101c450850fef875152 (patch)
treeac295d1e228379b1b31c6af3a84e7057f2ea96ae /brep/mod-repository-root.cxx
parent0f9c65e489a7b59f76ccbf2ca6e76ab0a1012932 (diff)
Support multiple instances of brep in a single Apache instance
Diffstat (limited to 'brep/mod-repository-root.cxx')
-rw-r--r--brep/mod-repository-root.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/brep/mod-repository-root.cxx b/brep/mod-repository-root.cxx
index 61aa71b..7c27a60 100644
--- a/brep/mod-repository-root.cxx
+++ b/brep/mod-repository-root.cxx
@@ -58,6 +58,37 @@ namespace brep
{
}
+ repository_root::
+ repository_root (const repository_root& r)
+ : module (r),
+ //
+ // Deep/shallow-copy sub-modules depending on whether this is an
+ // exemplar/handler.
+ //
+ package_search_ (
+ r.initialized_
+ ? r.package_search_
+ : make_shared<package_search> (*r.package_search_)),
+ package_details_ (
+ r.initialized_
+ ? r.package_details_
+ : make_shared<package_details> (*r.package_details_)),
+ package_version_details_ (
+ r.initialized_
+ ? r.package_version_details_
+ : make_shared<package_version_details> (
+ *r.package_version_details_)),
+ repository_details_ (
+ r.initialized_
+ ? r.repository_details_
+ : make_shared<repository_details> (*r.repository_details_)),
+ options_ (
+ r.initialized_
+ ? r.options_
+ : nullptr)
+ {
+ }
+
// Return amalgamation of repository_root and all its sub-modules option
// descriptions.
//
@@ -112,7 +143,7 @@ namespace brep
{
MODULE_DIAG;
- static const dir_path& root (options_->root ());
+ const dir_path& root (options_->root ());
const path& rpath (rq.path ());
if (!rpath.sub (root))