aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-05 07:16:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-05 07:16:45 +0000
commit4b1049778358573294a285a0705ab6c99a5182f5 (patch)
tree829eeca312c2f09b385640898e80ed4d5b110d2d
parent24d566c9885e9e4444ab656ef949727ef2123c24 (diff)
downloadpaludis-4b1049778358573294a285a0705ab6c99a5182f5.tar.gz
paludis-4b1049778358573294a285a0705ab6c99a5182f5.tar.xz
Handle USE_EXPAND, ARCH deps correctly
-rw-r--r--paludis/portage_repository.cc36
1 files changed, 34 insertions, 2 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index a02902a..c4cc5e0 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -175,8 +175,11 @@ namespace paludis
/// Destructor.
~Implementation();
- /// Add a use.mask, use from a profile directory, recursive.
+ /// Add a profile directory.
void add_profile(const FSEntry & f) const;
+
+ private:
+ void add_profile_r(const FSEntry & f) const;
};
}
@@ -209,6 +212,35 @@ Implementation<PortageRepository>::~Implementation()
void
Implementation<PortageRepository>::add_profile(const FSEntry & f) const
{
+ Context context("When setting profile from directory '" + stringify(f) + "':");
+
+ add_profile_r(f);
+
+ for (UseFlagSet::const_iterator x(expand_list.begin()), x_end(expand_list.end()) ;
+ x != x_end ; ++x)
+ {
+ static Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
+ std::list<std::string> uses;
+ tokeniser.tokenise(profile_env[stringify(*x)], std::back_inserter(uses));
+ for (std::list<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
+ u != u_end ; ++u)
+ {
+ std::string lower_x;
+ std::transform(x->data().begin(), x->data().end(), std::back_inserter(lower_x),
+ &::tolower);
+ use[UseFlagName(lower_x + "_" + *u)] = use_enabled;
+ }
+ }
+
+ std::string arch(profile_env["ARCH"]);
+ if (arch.empty())
+ throw InternalError(PALUDIS_HERE, "todo: ARCH unset"); /// \todo
+ use[UseFlagName(arch)] = use_enabled;
+}
+
+void
+Implementation<PortageRepository>::add_profile_r(const FSEntry & f) const
+{
Context context("When reading profile directory '" + stringify(f) + "':");
static Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
@@ -226,7 +258,7 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
LineConfigFile parent(f / "parent");
if (parent.begin() != parent.end())
- add_profile((f / *parent.begin()).realpath());
+ add_profile_r((f / *parent.begin()).realpath());
else
{
Log::get_instance()->message(ll_warning, "Profile parent file in '" +