aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-11 10:04:36 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-11 10:04:36 +0000
commitd58ea50741f89e0a9834fd7710d4361baa28869f (patch)
tree38d94164f6764bd5b94cebe7cc846f519aa9915d
parent1a91aa1959a46b8a9719aba9a9048a31daf05329 (diff)
downloadpaludis-d58ea50741f89e0a9834fd7710d4361baa28869f.tar.gz
paludis-d58ea50741f89e0a9834fd7710d4361baa28869f.tar.xz
Allow overriding of selected masks as necessary
-rw-r--r--paludis/dep_list/dep_list.cc21
-rw-r--r--paludis/dep_list/dep_list.hh2
-rw-r--r--paludis/dep_list/dep_list.sr1
3 files changed, 19 insertions, 5 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 2a93489..1b7e0c0 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -445,6 +445,19 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
break;
}
+ /* are we allowed to override mask reasons? */
+ if (! best_visible_candidate && d->_imp->opts.override_mask_reasons.any())
+ {
+ for (PackageDatabaseEntryCollection::ReverseIterator p(installable_candidates->rbegin()),
+ p_end(installable_candidates->rend()) ; p != p_end ; ++p)
+ if (! (d->_imp->env->mask_reasons(*p) & ~d->_imp->opts.override_mask_reasons).any())
+ {
+ d->add_error_package(*p, dlk_masked);
+ best_visible_candidate = &*p;
+ break;
+ }
+ }
+
/* no installable candidates. if we're already installed, that's ok (except for top level
* package targets), otherwise error. */
if (! best_visible_candidate)
@@ -667,7 +680,7 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
else
for (PackageDatabaseEntryCollection::Iterator p(m->begin()), p_end(m->end()) ;
p != p_end ; ++p)
- d->add_blocked_package(*p);
+ d->add_error_package(*p, dlk_block);
}
break;
@@ -825,14 +838,14 @@ DepList::add_package(const PackageDatabaseEntry & p, DepTag::ConstPointer tag)
}
void
-DepList::add_blocked_package(const PackageDatabaseEntry & p)
+DepList::add_error_package(const PackageDatabaseEntry & p, const DepListEntryKind kind)
{
std::pair<MergeListIndex::iterator, MergeListIndex::const_iterator> pp(
_imp->merge_list_index.equal_range(p.name));
for ( ; pp.first != pp.second ; ++pp.first)
{
- if (pp.first->second->kind == dlk_block && pp.first->second->package == p)
+ if (pp.first->second->kind == kind && pp.first->second->package == p)
{
if (_imp->current_pde())
pp.first->second->tags->insert(DepTagEntry::create()
@@ -852,7 +865,7 @@ DepList::add_blocked_package(const PackageDatabaseEntry & p)
.state(dle_has_all_deps)
.tags(DepListEntryTags::Pointer(new DepListEntryTags::Concrete))
.destinations(RepositoryNameCollection::Pointer(new RepositoryNameCollection::Concrete))
- .kind(dlk_block)));
+ .kind(kind)));
if (_imp->current_pde())
our_merge_entry_position->tags->insert(DepTagEntry::create()
diff --git a/paludis/dep_list/dep_list.hh b/paludis/dep_list/dep_list.hh
index 87f17e3..527535d 100644
--- a/paludis/dep_list/dep_list.hh
+++ b/paludis/dep_list/dep_list.hh
@@ -62,7 +62,7 @@ namespace paludis
void add_package(const PackageDatabaseEntry &, DepTag::ConstPointer);
void add_already_installed_package(const PackageDatabaseEntry &, DepTag::ConstPointer);
- void add_blocked_package(const PackageDatabaseEntry &);
+ void add_error_package(const PackageDatabaseEntry &, const DepListEntryKind);
void add_predeps(DepAtom::ConstPointer, const DepListDepsOption, const std::string &);
void add_postdeps(DepAtom::ConstPointer, const DepListDepsOption, const std::string &);
diff --git a/paludis/dep_list/dep_list.sr b/paludis/dep_list/dep_list.sr
index 24e2887..6058eb5 100644
--- a/paludis/dep_list/dep_list.sr
+++ b/paludis/dep_list/dep_list.sr
@@ -20,6 +20,7 @@ make_class_DepListOptions()
key circular DepListCircularOption
key blocks DepListBlocksOption
+ key override_mask_reasons MaskReasons
key dependency_tags bool