aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2010-03-13 12:33:35 -0800
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-14 08:46:51 +0000
commit53642f3b30c6f4d9a1817db6be749f3e02b6608b (patch)
treeba51e786b5250091dfa843c8d8b23fca741b58bf
parentd46c71cb452401473061aac073843fb32dd9aaa7 (diff)
downloadpaludis-53642f3b30c6f4d9a1817db6be749f3e02b6608b.tar.gz
paludis-53642f3b30c6f4d9a1817db6be749f3e02b6608b.tar.xz
honour environment values for CONFIG_PROTECT{,_MASK}
The values for CONFIG_PROTECT and CONFIG_PROTECT_MASK in env.d should be used when merging packages. However, they may not contain the values that are specified in the profile. We manually merge the values when creating the repository now.
-rw-r--r--paludis/repositories/e/e_repository.cc21
-rw-r--r--paludis/repositories/e/e_repository.hh1
2 files changed, 20 insertions, 2 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 8b1f342..5b21caf 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -896,6 +896,23 @@ ERepository::profile_variable(const std::string & s) const
return _imp->profile_ptr->environment_variable(s);
}
+std::string
+ERepository::environment_updated_profile_variable(const std::string & var) const
+{
+ std::vector<std::string> values;
+ std::vector<std::string>::iterator last;
+
+ _imp->need_profiles();
+
+ tokenise_whitespace(_imp->profile_ptr->environment_variable(var), std::back_inserter(values));
+ tokenise_whitespace(paludis::getenv_with_default(var, ""), std::back_inserter(values));
+
+ std::sort(values.begin(), values.end());
+ last = std::unique(values.begin(), values.end());
+
+ return join(values.begin(), last, " ");
+}
+
std::tr1::shared_ptr<const ERepository::VirtualsSequence>
ERepository::virtual_packages() const
{
@@ -2460,8 +2477,8 @@ ERepository::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
make_named_values<EbuildInstallCommandParams>(
value_for<n::a>(archives),
value_for<n::aa>(all_archives),
- value_for<n::config_protect>(profile_variable("CONFIG_PROTECT")),
- value_for<n::config_protect_mask>(profile_variable("CONFIG_PROTECT_MASK")),
+ value_for<n::config_protect>(environment_updated_profile_variable("CONFIG_PROTECT")),
+ value_for<n::config_protect_mask>(environment_updated_profile_variable("CONFIG_PROTECT_MASK")),
value_for<n::expand_vars>(expand_vars),
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::profiles>(_imp->params.profiles()),
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 3296477..4310e51 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -145,6 +145,7 @@ namespace paludis
const erepository::ERepositoryParams & params() const;
std::string profile_variable(const std::string &) const;
+ std::string environment_updated_profile_variable(const std::string &) const;
HookResult perform_hook(const Hook &)
PALUDIS_ATTRIBUTE((warn_unused_result));