aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-06 22:09:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-06 22:09:54 +0100
commit3af91940a0b913d12bf8870a6fea989092fc0d10 (patch)
treec1cdb1c71e6407f12c627454e67b3f5c0db81b74
parent0ee09bb7018b16ce200c99facc0422290284aee1 (diff)
downloadpaludis-3af91940a0b913d12bf8870a6fea989092fc0d10.tar.gz
paludis-3af91940a0b913d12bf8870a6fea989092fc0d10.tar.xz
Let variables be both prefixed and unprefixed
-rw-r--r--paludis/repositories/e/ebuild_id.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index a6a59b8..21cbf9b 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -330,6 +330,7 @@ EbuildID::need_keys_added() const
std::copy(e_repository()->profile()->iuse_implicit()->begin(), e_repository()->profile()->iuse_implicit()->end(),
iuse_effective->inserter());
+ const std::tr1::shared_ptr<const Set<std::string> > use_expand(e_repository()->profile()->use_expand());
const std::tr1::shared_ptr<const Set<std::string> > use_expand_unprefixed(e_repository()->profile()->use_expand_unprefixed());
const std::string separator(stringify(_imp->eapi->supported()->choices_options()->use_expand_separator()));
@@ -340,14 +341,19 @@ EbuildID::need_keys_added() const
std::string lower_x;
std::transform(x->begin(), x->end(), std::back_inserter(lower_x), &::tolower);
- bool prefixed(use_expand_unprefixed->end() == use_expand_unprefixed->find(*x));
+ bool prefixed(use_expand->end() != use_expand->find(*x));
+ bool unprefixed(use_expand_unprefixed->end() != use_expand_unprefixed->find(*x));
+
+ if ((! unprefixed) && (! prefixed))
+ throw InternalError(PALUDIS_HERE, "(! unprefixed) && (! prefixed) for " + *x);
+
const std::tr1::shared_ptr<const Set<std::string> > values(e_repository()->profile()->use_expand_values(*x));
for (Set<std::string>::ConstIterator v(values->begin()), v_end(values->end()) ;
v != v_end ; ++v)
{
if (prefixed)
iuse_effective->insert(lower_x + separator + *v);
- else
+ if (unprefixed)
iuse_effective->insert(*v);
}
}