aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-14 13:03:37 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-14 13:03:37 +0100
commit7d101615917b9a8f011b9841409c455c0732c885 (patch)
tree5ae22cf6aba8b8efe6808594b42efa064f4ae58f
parent12fdd07da80b04724dce37b1a5d87215be245999 (diff)
downloadpaludis-7d101615917b9a8f011b9841409c455c0732c885.tar.gz
paludis-7d101615917b9a8f011b9841409c455c0732c885.tar.xz
Pass root into output confs
-rw-r--r--paludis/environments/paludis/output_conf.cc8
-rw-r--r--paludis/environments/paludis/output_conf.hh2
-rw-r--r--paludis/environments/paludis/paludis_config.cc2
3 files changed, 9 insertions, 3 deletions
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index 6e5b965..44d5cea 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -332,10 +332,15 @@ namespace
}
void
-OutputConf::add(const FSPath & filename)
+OutputConf::add(const FSPath & filename, const FSPath & root)
{
Context context("When adding source '" + stringify(filename) + "' as an output file:");
+ _imp->predefined_variables->erase(std::string("root"));
+ _imp->predefined_variables->insert("root", stringify(root));
+ _imp->predefined_variables->erase(std::string("ROOT"));
+ _imp->predefined_variables->insert("ROOT", stringify(root));
+
std::shared_ptr<KeyValueConfigFile> f(make_bashable_kv_conf(filename,
_imp->predefined_variables, { kvcfo_allow_sections, kvcfo_allow_fancy_assigns, kvcfo_allow_env }));
if (! f)
@@ -491,3 +496,4 @@ namespace paludis
{
template class Pimp<paludis_environment::OutputConf>;
}
+
diff --git a/paludis/environments/paludis/output_conf.hh b/paludis/environments/paludis/output_conf.hh
index bb07ba6..1bf8d54 100644
--- a/paludis/environments/paludis/output_conf.hh
+++ b/paludis/environments/paludis/output_conf.hh
@@ -52,7 +52,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSPath &);
+ void add(const FSPath &, const FSPath & root);
const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index e695e63..f70154b 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -705,7 +705,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (! file->stat().exists())
continue;
- _imp->output_conf->add(*file);
+ _imp->output_conf->add(*file, FSPath(_imp->root));
any = true;
}