aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-05 00:45:25 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-05 00:45:25 +0000
commit6de227497132300ccc0fc1498c032e8924712049 (patch)
treed46b29c6683f4447538fd8b1f7b373a2c31628d3
parente43513525a96ea640e4cfbf2166ea140a081ed5b (diff)
downloadpaludis-6de227497132300ccc0fc1498c032e8924712049.tar.gz
paludis-6de227497132300ccc0fc1498c032e8924712049.tar.xz
Don't use UseRequirementsNotMetError unless we'd otherwise have available versions
-rw-r--r--paludis/dep_list/dep_list.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 16ba657..8f06d09 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -453,11 +453,18 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
if (already_installed->empty() || ! can_fall_back)
{
- if (a->use_requirements_ptr() && d->_imp->env->package_database()->query(
- *a->without_use_requirements(), is_any, qo_whatever))
- throw UseRequirementsNotMetError(stringify(*a));
- else
+ if (! a->use_requirements_ptr())
throw AllMaskedError(stringify(*a));
+
+ PackageDatabaseEntryCollection::ConstPointer match_except_reqs(d->_imp->env->package_database()->query(
+ *a->without_use_requirements(), is_any, qo_whatever));
+
+ for (PackageDatabaseEntryCollection::Iterator i(match_except_reqs->begin()),
+ i_end(match_except_reqs->end()) ; i != i_end ; ++i)
+ if (! (d->_imp->env->mask_reasons(*i).any()))
+ throw UseRequirementsNotMetError(stringify(*a));
+
+ throw AllMaskedError(stringify(*a));
}
else
{