aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-25 13:11:05 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-25 13:11:05 +0000
commit47cd5b987fe1121eab48870f91777c5c8f367145 (patch)
tree125aa56de163a79a48fcc1b044b870d38442cf34
parent977fd0db77ca5a8b4af96c5692aea1c203429ef0 (diff)
downloadpaludis-47cd5b987fe1121eab48870f91777c5c8f367145.tar.gz
paludis-47cd5b987fe1121eab48870f91777c5c8f367145.tar.xz
More USE_EXPAND fixes
-rw-r--r--paludis/default_environment.cc3
-rw-r--r--paludis/repositories/portage/portage_repository_ebuild_entries.cc11
2 files changed, 11 insertions, 3 deletions
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index aec0542..67a85bd 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -503,6 +503,9 @@ DefaultEnvironment::known_use_expand_names(const UseFlagName & prefix, const Pac
if (0 == i->flag_name.data().compare(0, prefix_lower.length(), prefix_lower, 0, prefix_lower.length()))
result->insert(i->flag_name);
+ Log::get_instance()->message(ll_debug, lc_no_context, "DefaultEnvironment::known_use_expand_names("
+ + stringify(prefix) + ", " + (pde ? stringify(*pde) : stringify("0")) + ") -> ("
+ + join(result->begin(), result->end(), ", ") + ")");
return result;
}
diff --git a/paludis/repositories/portage/portage_repository_ebuild_entries.cc b/paludis/repositories/portage/portage_repository_ebuild_entries.cc
index 50a9375..a8cbdb3 100644
--- a/paludis/repositories/portage/portage_repository_ebuild_entries.cc
+++ b/paludis/repositories/portage/portage_repository_ebuild_entries.cc
@@ -415,6 +415,8 @@ PortageRepositoryEbuildEntries::install(const QualifiedPackageName & q, const Ve
std::string lower_x;
std::transform(x->data().begin(), x->data().end(), std::back_inserter(lower_x), &::tolower);
+ expand_vars->insert(stringify(*x), "");
+
/* possible values from profile */
std::set<UseFlagName> possible_values;
WhitespaceTokeniser::get_instance()->tokenise(p->environment_variable(stringify(*x)),
@@ -423,8 +425,9 @@ PortageRepositoryEbuildEntries::install(const QualifiedPackageName & q, const Ve
/* possible values from environment */
UseFlagNameCollection::ConstPointer possible_values_from_env(_imp->params.environment->
known_use_expand_names(*x, &e));
- std::copy(possible_values_from_env->begin(), possible_values_from_env->end(),
- std::inserter(possible_values, possible_values.end()));
+ for (UseFlagNameCollection::Iterator i(possible_values_from_env->begin()),
+ i_end(possible_values_from_env->end()) ; i != i_end ; ++i)
+ possible_values.insert(UseFlagName(stringify(*i).substr(lower_x.length() + 1)));
for (std::set<UseFlagName>::const_iterator u(possible_values.begin()), u_end(possible_values.end()) ;
u != u_end ; ++u)
@@ -438,7 +441,9 @@ PortageRepositoryEbuildEntries::install(const QualifiedPackageName & q, const Ve
AssociativeCollection<std::string, std::string>::Iterator i(expand_vars->find(stringify(*x)));
if (expand_vars->end() != i)
{
- value = i->second + " ";
+ value = i->second;
+ if (! value.empty())
+ value.append(" ");
expand_vars->erase(i);
}
value.append(stringify(*u));