aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-22 09:42:34 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-22 09:46:17 +0100
commit3acc707fdddab596f8e8fa88834d4fe160ceca40 (patch)
tree4e8f9cf87c4824582f2df8f27dd3e8bb0bce793a
parente11e4f0105cb71dc86524c95a3132492f590e6fc (diff)
downloadpaludis-3acc707fdddab596f8e8fa88834d4fe160ceca40.tar.gz
paludis-3acc707fdddab596f8e8fa88834d4fe160ceca40.tar.xz
Read user output confs first, pass vars along
-rw-r--r--paludis/environments/paludis/output_conf.cc14
-rw-r--r--paludis/environments/paludis/paludis_config.cc4
2 files changed, 13 insertions, 5 deletions
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index b0999e6..ac68155 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -103,9 +103,11 @@ namespace paludis
RuleList rules;
Managers managers;
std::map<std::string, std::string> misc_vars;
+ std::shared_ptr<Map<std::string, std::string> > predefined_variables;
Imp(const PaludisEnvironment * const e) :
- env(e)
+ env(e),
+ predefined_variables(std::make_shared<Map<std::string, std::string> >())
{
}
};
@@ -331,8 +333,7 @@ OutputConf::add(const FSEntry & filename)
Context context("When adding source '" + stringify(filename) + "' as an output file:");
std::shared_ptr<KeyValueConfigFile> f(make_bashable_kv_conf(filename,
- std::make_shared<Map<std::string, std::string>>(),
- { kvcfo_allow_sections }));
+ _imp->predefined_variables, { kvcfo_allow_sections }));
if (! f)
return;
@@ -398,6 +399,13 @@ OutputConf::add(const FSEntry & filename)
for (Managers::const_iterator m(local_managers.begin()), m_end(local_managers.end()) ;
m != m_end ; ++m)
_imp->managers[m->first] = m->second;
+
+ for (auto i(f->begin()), i_end(f->end()) ;
+ i != i_end ; ++i)
+ {
+ _imp->predefined_variables->erase(i->first);
+ _imp->predefined_variables->insert(i->first, i->second);
+ }
}
const std::shared_ptr<OutputManager>
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 35cc0f7..a670173 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -687,10 +687,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* output */
{
std::list<FSEntry> files;
- files.push_back(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
- SHAREDIR "/paludis/environments/paludis/default_output.conf"));
files.push_back(local_config_dir / (dist->output_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->output_filename_part() + ".bash"));
+ files.push_back(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
+ SHAREDIR "/paludis/environments/paludis/default_output.conf"));
if ((local_config_dir / (dist->output_filename_part() + ".conf.d")).exists())
{
std::remove_copy_if(DirIterator(local_config_dir / (dist->output_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),