aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-10-31 14:32:41 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-10-31 14:32:41 +0000
commit48de14890aa4e4ecb228ac324e902a714dbdbd23 (patch)
treef8b5a5f70620fa4dc65c1b463c35db59c14608fb
parent2934739931964a1128ee74ef72699343506e9c49 (diff)
downloadpaludis-48de14890aa4e4ecb228ac324e902a714dbdbd23.tar.gz
paludis-48de14890aa4e4ecb228ac324e902a714dbdbd23.tar.xz
specpath.conf system_root
-rw-r--r--doc/configuration/specpath.html.part.in4
-rw-r--r--paludis/environments/paludis/paludis_config.cc11
-rw-r--r--paludis/environments/paludis/paludis_config.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc2
4 files changed, 20 insertions, 2 deletions
diff --git a/doc/configuration/specpath.html.part.in b/doc/configuration/specpath.html.part.in
index d420a99..1812fb9 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 1538c2f..4013ee6 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 d319f45..210be8c 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 f62454b..4f57ade 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())))
{
}