diff options
-rw-r--r-- | doc/configuration/specpath.html.part.in | 4 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_config.cc | 11 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_config.hh | 5 | ||||
-rw-r--r-- | paludis/environments/paludis/paludis_environment.cc | 2 |
4 files changed, 20 insertions, 2 deletions
diff --git a/doc/configuration/specpath.html.part.in b/doc/configuration/specpath.html.part.in index d420a99c5..1812fb9b8 100644 --- a/doc/configuration/specpath.html.part.in +++ b/doc/configuration/specpath.html.part.in @@ -33,5 +33,9 @@ from the commandline given in --environment(-E). Recognised keys are as follows: <dt><code>config-suffix</code></dt> <dd>If set, Paludis will instead look in <code>${root}/SYSCONFDIR/paludis-suffix</code> for configuration files. By default, no configuration suffix is used under root.</dd> + + <dt><code>system_root</code></dt> + <dd>If set, Paludis will use this value for the root for resolving dependencies. Defaults to <code>/</code>, and + should not be changed except under exceptional circumstances.</dd> </dl> diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc index 1538c2f84..4013ee644 100644 --- a/paludis/environments/paludis/paludis_config.cc +++ b/paludis/environments/paludis/paludis_config.cc @@ -169,6 +169,7 @@ namespace paludis std::string paludis_command; std::string root; + std::string system_root; std::string config_dir; mutable Mutex distribution_mutex; mutable std::string distribution; @@ -177,6 +178,7 @@ namespace paludis Repos repos; std::function<std::string (const std::string &)> predefined_conf_vars_func; std::string root_prefix; + std::string system_root_prefix; std::shared_ptr<KeywordsConf> keywords_conf; std::shared_ptr<UseConf> use_conf; @@ -365,7 +367,6 @@ namespace paludis << (FSPath(config_dir) / "general.conf") << ". Any attempted updates to world will not be saved."; world = std::make_shared<World>(env, world_file); - has_general_conf = true; } @@ -463,6 +464,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s if (specpath) { _imp->root_prefix = specpath->get("root"); + _imp->system_root_prefix = specpath->get("system_root"); local_config_suffix = specpath->get("config-suffix"); if (! local_config_suffix.empty()) @@ -479,6 +481,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s } _imp->root = _imp->root_prefix.empty() ? "/" : _imp->root_prefix; + _imp->system_root = _imp->system_root_prefix.empty() ? "/" : _imp->system_root_prefix; _imp->config_dir = stringify(local_config_dir); const std::shared_ptr<const PaludisDistribution> dist( @@ -916,6 +919,12 @@ PaludisConfig::root() const } std::string +PaludisConfig::system_root() const +{ + return _imp->system_root; +} + +std::string PaludisConfig::config_dir() const { return _imp->config_dir; diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh index d319f45a3..210be8ca8 100644 --- a/paludis/environments/paludis/paludis_config.hh +++ b/paludis/environments/paludis/paludis_config.hh @@ -148,6 +148,11 @@ namespace paludis std::string root() const; /** + * The system root. + */ + std::string system_root() const; + + /** * Whether it's ok to unmask things that break Portage, regardless of the reason. */ bool accept_all_breaks_portage() const; diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc index f62454b06..4f57adeea 100644 --- a/paludis/environments/paludis/paludis_environment.cc +++ b/paludis/environments/paludis/paludis_environment.cc @@ -105,7 +105,7 @@ namespace paludis preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, FSPath(config->root()))), system_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("system_root", "System Root", mkt_normal, - FSPath("/"))) + FSPath(config->system_root()))) { } |