aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-06 22:45:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-06 22:45:44 +0000
commitc311f98874ed2684f2ef63866942386b576b5bd9 (patch)
treed06e5ba9cecc6d9daec4edba8b2c120b818d3667
parente57e0581b110f84e85e8bef47216210f12b7e211 (diff)
downloadpaludis-c311f98874ed2684f2ef63866942386b576b5bd9.tar.gz
paludis-c311f98874ed2684f2ef63866942386b576b5bd9.tar.xz
more dead sr
-rw-r--r--paludis/dep_list.cc228
-rw-r--r--paludis/dep_list.hh31
-rw-r--r--paludis/dep_list.sr29
-rw-r--r--paludis/dep_list_TEST.cc22
-rw-r--r--paludis/dep_list_TEST.hh4
-rw-r--r--paludis/dep_list_TEST_blockers.cc24
-rw-r--r--paludis/dep_tag-fwd.hh3
-rw-r--r--paludis/dep_tag.cc14
-rw-r--r--paludis/dep_tag.hh36
-rw-r--r--paludis/dep_tag.sr25
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/install_task.cc158
-rw-r--r--paludis/uninstall_list.cc9
-rw-r--r--python/dep_list.cc24
-rwxr-xr-xpython/dep_list_TEST.py1
-rw-r--r--ruby/dep_list.cc12
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc12
-rw-r--r--src/output/console_install_task.cc174
-rw-r--r--src/output/console_install_task.hh4
20 files changed, 422 insertions, 392 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index f3af735..e03b486 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -128,7 +128,7 @@ namespace paludis
const std::tr1::shared_ptr<const PackageID> current_package_id() const
{
if (current_merge_list_entry != merge_list.end())
- return current_merge_list_entry->package_id;
+ return current_merge_list_entry->package_id();
return std::tr1::shared_ptr<const PackageID>();
}
@@ -160,7 +160,7 @@ namespace
template <typename T_>
bool operator() (const T_ & e) const
{
- return e.generation > g;
+ return e.generation() > g;
}
};
@@ -176,15 +176,15 @@ namespace
void operator() (DepListEntry & e) const
{
/* see EffSTL 9 for why this is so painful */
- if (e.tags->empty())
+ if (e.tags()->empty())
return;
std::tr1::shared_ptr<DepListEntryTags> t(new DepListEntryTags);
GenerationGreaterThan pred(g);
- for (DepListEntryTags::ConstIterator i(e.tags->begin()), i_end(e.tags->end()) ;
+ for (DepListEntryTags::ConstIterator i(e.tags()->begin()), i_end(e.tags()->end()) ;
i != i_end ; ++i)
if (! pred(*i))
t->insert(*i);
- std::swap(e.tags, t);
+ std::swap(e.tags(), t);
}
};
@@ -227,7 +227,7 @@ namespace
else
{
for (std::pair<MergeListIndex::iterator, MergeListIndex::iterator> p(
- _index.equal_range(i->package_id->name())) ; p.first != p.second ; )
+ _index.equal_range(i->package_id()->name())) ; p.first != p.second ; )
if (p.first->second == i)
_index.erase(p.first++);
else
@@ -258,14 +258,14 @@ namespace
bool operator() (const std::pair<const QualifiedPackageName, MergeList::const_iterator> & e)
{
- switch (e.second->kind)
+ switch (e.second->kind())
{
case dlk_virtual:
case dlk_package:
case dlk_provided:
case dlk_already_installed:
case dlk_subpackage:
- return match_package(*env, a, *e.second->package_id, o);
+ return match_package(*env, a, *e.second->package_id(), o);
case dlk_block:
case dlk_masked:
@@ -409,20 +409,22 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
{
/* tag it */
if (a.tag())
- existing_merge_list_entry->tags->insert(DepTagEntry::create()
- .tag(a.tag())
- .generation(d->_imp->merge_list_generation));
+ existing_merge_list_entry->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(d->_imp->merge_list_generation),
+ value_for<n::tag>(a.tag())
+ ));
if (d->_imp->opts->dependency_tags && d->_imp->current_package_id())
- existing_merge_list_entry->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(d->_imp->current_package_id(), a, conditions)))
- .generation(d->_imp->merge_list_generation));
+ existing_merge_list_entry->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(d->_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(d->_imp->current_package_id(), a, conditions)))
+ ));
/* add an appropriate destination */
// TODO
/* have our deps been merged already, or is this a circular dep? */
- if (dle_no_deps == existing_merge_list_entry->state)
+ if (dle_no_deps == existing_merge_list_entry->state())
{
/* is a sufficiently good version installed? */
if (! already_installed->empty())
@@ -431,14 +433,14 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
if (d->_imp->opts->circular == dl_circular_discard)
{
Log::get_instance()->message("dep_list.dropping_circular", ll_qa, lc_context)
- << "Dropping circular dependency on '" << *existing_merge_list_entry->package_id << "'";
+ << "Dropping circular dependency on '" << *existing_merge_list_entry->package_id() << "'";
return;
}
else if (d->_imp->opts->circular == dl_circular_discard_silently)
return;
throw CircularDependencyError("Atom '" + stringify(a) + "' matched by merge list entry '" +
- stringify(*existing_merge_list_entry->package_id) + "', which does not yet have its "
+ stringify(*existing_merge_list_entry->package_id()) + "', which does not yet have its "
"dependencies installed");
}
else
@@ -846,7 +848,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
if (d->_imp->current_merge_list_entry == p.first->second)
continue;
- if (d->_imp->current_merge_list_entry->associated_entry == &*p.first->second)
+ if (d->_imp->current_merge_list_entry->associated_entry() == &*p.first->second)
continue;
}
@@ -874,12 +876,12 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
bool replaced(false);
for (std::list<MergeList::const_iterator>::const_iterator r(will_be_installed.begin()),
r_end(will_be_installed.end()) ; r != r_end && ! replaced ; ++r)
- if ((*r)->package_id->slot() == (*aa)->slot())
+ if ((*r)->package_id()->slot() == (*aa)->slot())
{
/* if it's a virtual, it only replaces if it's the same package. */
- if ((*r)->package_id->virtual_for_key())
+ if ((*r)->package_id()->virtual_for_key())
{
- if ((*r)->package_id->virtual_for_key()->value()->name() == (*aa)->name())
+ if ((*r)->package_id()->virtual_for_key()->value()->name() == (*aa)->name())
replaced = true;
}
else
@@ -931,7 +933,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
for (std::list<MergeList::const_iterator>::const_iterator r(will_be_installed.begin()),
r_end(will_be_installed.end()) ; r != r_end ; ++r)
{
- if (! match_package(*d->_imp->env, *a.blocked_spec(), *(*r)->package_id, d->_imp->opts->match_package_options))
+ if (! match_package(*d->_imp->env, *a.blocked_spec(), *(*r)->package_id(), d->_imp->opts->match_package_options))
continue;
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
@@ -945,10 +947,10 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
|| a.blocked_spec()->installable_to_path_ptr())
&& d->_imp->current_package_id())
{
- if ((*r)->package_id->name() == d->_imp->current_package_id()->name())
+ if ((*r)->package_id()->name() == d->_imp->current_package_id()->name())
continue;
- if ((*r)->package_id->virtual_for_key() && (*r)->package_id->virtual_for_key()->value()->name() ==
+ if ((*r)->package_id()->virtual_for_key() && (*r)->package_id()->virtual_for_key()->value()->name() ==
d->_imp->current_package_id()->name())
continue;
}
@@ -961,7 +963,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
for (MergeList::const_iterator r(d->_imp->merge_list.begin()),
r_end(d->_imp->merge_list.end()) ; r != r_end ; ++r)
{
- if (! match_package(*d->_imp->env, *a.blocked_spec(), *r->package_id, d->_imp->opts->match_package_options))
+ if (! match_package(*d->_imp->env, *a.blocked_spec(), *r->package_id(), d->_imp->opts->match_package_options))
continue;
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
@@ -975,11 +977,11 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
|| a.blocked_spec()->installable_to_path_ptr())
&& d->_imp->current_package_id())
{
- if (r->package_id->name() == d->_imp->current_package_id()->name())
+ if (r->package_id()->name() == d->_imp->current_package_id()->name())
continue;
- if (r->package_id->virtual_for_key() &&
- r->package_id->virtual_for_key()->value()->name() == d->_imp->current_package_id()->name())
+ if (r->package_id()->virtual_for_key() &&
+ r->package_id()->virtual_for_key()->value()->name() == d->_imp->current_package_id()->name())
continue;
}
@@ -1078,30 +1080,33 @@ DepList::add_package(const std::tr1::shared_ptr<const PackageID> & p, const std:
MergeList::iterator our_merge_entry_position(
_imp->merge_list.insert(_imp->merge_list_insert_position,
- DepListEntry::create()
- .package_id(p)
- .generation(_imp->merge_list_generation)
- .state(dle_no_deps)
- .tags(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
- .destination(p->virtual_for_key() ? std::tr1::shared_ptr<Repository>() : find_destination(*p, destinations))
- .associated_entry(0)
- .handled(p->virtual_for_key() ?
- std::tr1::shared_ptr<DepListEntryHandled>(new DepListEntryNoHandlingRequired) :
- std::tr1::shared_ptr<DepListEntryHandled>(new DepListEntryUnhandled))
- .kind(p->virtual_for_key() ? dlk_virtual : dlk_package))),
+ make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(static_cast<DepListEntry *>(0)),
+ value_for<n::destination>(p->virtual_for_key() ? std::tr1::shared_ptr<Repository>() : find_destination(*p, destinations)),
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::handled>(p->virtual_for_key() ?
+ std::tr1::shared_ptr<DepListEntryHandled>(new DepListEntryNoHandlingRequired) :
+ std::tr1::shared_ptr<DepListEntryHandled>(new DepListEntryUnhandled)),
+ value_for<n::kind>(p->virtual_for_key() ? dlk_virtual : dlk_package),
+ value_for<n::package_id>(p),
+ value_for<n::state>(dle_no_deps),
+ value_for<n::tags>(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
+ ))),
our_merge_entry_post_position(our_merge_entry_position);
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry_position));
if (tag)
- our_merge_entry_position->tags->insert(DepTagEntry::create()
- .generation(_imp->merge_list_generation)
- .tag(tag));
+ our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(tag)
+ ));
if (_imp->opts->dependency_tags && _imp->current_package_id())
- our_merge_entry_position->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
- .generation(_imp->merge_list_generation));
+ our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
+ ));
Save<MergeList::const_iterator> save_current_merge_list_entry(&_imp->current_merge_list_entry,
our_merge_entry_position);
@@ -1141,17 +1146,18 @@ DepList::add_package(const std::tr1::shared_ptr<const PackageID> & p, const std:
continue;
our_merge_entry_post_position = _imp->merge_list.insert(next(our_merge_entry_post_position),
- DepListEntry(DepListEntry::create()
- .package_id((*_imp->env->package_database()->fetch_repository(
+ DepListEntry(make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(&*_imp->current_merge_list_entry),
+ value_for<n::destination>(std::tr1::shared_ptr<Repository>()),
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::handled>(make_shared_ptr(new DepListEntryNoHandlingRequired)),
+ value_for<n::kind>(dlk_provided),
+ value_for<n::package_id>((*_imp->env->package_database()->fetch_repository(
RepositoryName("virtuals"))).make_virtuals_interface()->make_virtual_package_id(
- QualifiedPackageName((*i)->text()), p))
- .generation(_imp->merge_list_generation)
- .state(dle_has_all_deps)
- .tags(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
- .destination(std::tr1::shared_ptr<Repository>())
- .associated_entry(&*_imp->current_merge_list_entry)
- .handled(make_shared_ptr(new DepListEntryNoHandlingRequired))
- .kind(dlk_provided)));
+ QualifiedPackageName((*i)->text()), p)),
+ value_for<n::state>(dle_has_all_deps),
+ value_for<n::tags>(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
+ )));
_imp->merge_list_index.insert(std::make_pair((*i)->text(), our_merge_entry_post_position));
}
}
@@ -1187,7 +1193,7 @@ DepList::add_package(const std::tr1::shared_ptr<const PackageID> & p, const std:
if (_imp->opts->suggested == dl_suggested_install && p->suggested_dependencies_key())
add_predeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations, false);
- our_merge_entry_position->state = dle_has_pre_deps;
+ our_merge_entry_position->state() = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry_post_position);
/* add post dependencies */
@@ -1202,7 +1208,7 @@ DepList::add_package(const std::tr1::shared_ptr<const PackageID> & p, const std:
if (_imp->opts->suggested == dl_suggested_install && p->suggested_dependencies_key())
add_postdeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations, false);
- our_merge_entry_position->state = dle_has_all_deps;
+ our_merge_entry_position->state() = dle_has_all_deps;
}
void
@@ -1214,32 +1220,35 @@ DepList::add_error_package(const std::tr1::shared_ptr<const PackageID> & p, cons
for ( ; pp.second != pp.first ; ++pp.first)
{
- if (pp.first->second->kind == kind && *pp.first->second->package_id == *p)
+ if (pp.first->second->kind() == kind && *pp.first->second->package_id() == *p)
{
if (_imp->current_package_id())
- pp.first->second->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
- .generation(_imp->merge_list_generation));
+ pp.first->second->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
+ ));
return;
}
}
MergeList::iterator our_merge_entry_position(
_imp->merge_list.insert(_imp->merge_list.begin(),
- DepListEntry::create()
- .package_id(p)
- .generation(_imp->merge_list_generation)
- .state(dle_has_all_deps)
- .tags(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
- .destination(std::tr1::shared_ptr<Repository>())
- .associated_entry(&*_imp->current_merge_list_entry)
- .handled(make_shared_ptr(new DepListEntryNoHandlingRequired))
- .kind(kind)));
+ make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(&*_imp->current_merge_list_entry),
+ value_for<n::destination>(std::tr1::shared_ptr<Repository>()),
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::handled>(make_shared_ptr(new DepListEntryNoHandlingRequired)),
+ value_for<n::kind>(kind),
+ value_for<n::package_id>(p),
+ value_for<n::state>(dle_has_all_deps),
+ value_for<n::tags>(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
+ )));
if (_imp->current_package_id())
- our_merge_entry_position->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
- .generation(_imp->merge_list_generation));
+ our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
+ ));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry_position));
}
@@ -1254,28 +1263,30 @@ DepList::add_suggested_package(const std::tr1::shared_ptr<const PackageID> & p,
for ( ; pp.second != pp.first ; ++pp.first)
{
- if ((pp.first->second->kind == dlk_suggested || pp.first->second->kind == dlk_already_installed
- || pp.first->second->kind == dlk_package || pp.first->second->kind == dlk_provided
- || pp.first->second->kind == dlk_subpackage) && *pp.first->second->package_id == *p)
+ if ((pp.first->second->kind() == dlk_suggested || pp.first->second->kind() == dlk_already_installed
+ || pp.first->second->kind() == dlk_package || pp.first->second->kind() == dlk_provided
+ || pp.first->second->kind() == dlk_subpackage) && *pp.first->second->package_id() == *p)
return;
}
MergeList::iterator our_merge_entry_position(
_imp->merge_list.insert(_imp->merge_list_insert_position,
- DepListEntry::create()
- .package_id(p)
- .generation(_imp->merge_list_generation)
- .state(dle_has_all_deps)
- .tags(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
- .destination(find_destination(*p, destinations))
- .associated_entry(&*_imp->current_merge_list_entry)
- .handled(make_shared_ptr(new DepListEntryNoHandlingRequired))
- .kind(dlk_suggested)));
+ make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(&*_imp->current_merge_list_entry),
+ value_for<n::destination>(find_destination(*p, destinations)),
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::handled>(make_shared_ptr(new DepListEntryNoHandlingRequired)),
+ value_for<n::kind>(dlk_suggested),
+ value_for<n::package_id>(p),
+ value_for<n::state>(dle_has_all_deps),
+ value_for<n::tags>(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
+ )));
if (_imp->current_package_id())
- our_merge_entry_position->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
- .generation(_imp->merge_list_generation));
+ our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
+ ));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry_position));
}
@@ -1345,26 +1356,29 @@ DepList::add_already_installed_package(const std::tr1::shared_ptr<const PackageI
Save<MergeList::iterator> save_merge_list_insert_position(&_imp->merge_list_insert_position);
MergeList::iterator our_merge_entry(_imp->merge_list.insert(_imp->merge_list_insert_position,
- DepListEntry::create()
- .package_id(p)
- .generation(_imp->merge_list_generation)
- .tags(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
- .state(dle_has_pre_deps)
- .destination(std::tr1::shared_ptr<Repository>())
- .associated_entry(0)
- .handled(make_shared_ptr(new DepListEntryNoHandlingRequired))
- .kind(dlk_already_installed)));
+ make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(static_cast<DepListEntry *>(0)),
+ value_for<n::destination>(std::tr1::shared_ptr<Repository>()),
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::handled>(make_shared_ptr(new DepListEntryNoHandlingRequired)),
+ value_for<n::kind>(dlk_already_installed),
+ value_for<n::package_id>(p),
+ value_for<n::state>(dle_has_pre_deps),
+ value_for<n::tags>(std::tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags))
+ )));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry));
if (tag)
- our_merge_entry->tags->insert(DepTagEntry::create()
- .generation(_imp->merge_list_generation)
- .tag(tag));
+ our_merge_entry->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(tag)
+ ));
if (_imp->opts->dependency_tags && _imp->current_package_id())
- our_merge_entry->tags->insert(DepTagEntry::create()
- .tag(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
- .generation(_imp->merge_list_generation));
+ our_merge_entry->tags()->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(_imp->merge_list_generation),
+ value_for<n::tag>(std::tr1::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds, conditions)))
+ ));
Save<MergeList::const_iterator> save_current_merge_list_entry(&_imp->current_merge_list_entry,
our_merge_entry);
@@ -1376,7 +1390,7 @@ DepList::add_already_installed_package(const std::tr1::shared_ptr<const PackageI
if (p->post_dependencies_key())
add_predeps(*p->post_dependencies_key()->value(), _imp->opts->installed_deps_post, "post", destinations, true);
- our_merge_entry->state = dle_has_pre_deps;
+ our_merge_entry->state() = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry);
if (p->build_dependencies_key())
@@ -1589,7 +1603,7 @@ namespace
{
bool operator() (const DepListEntry & e) const
{
- switch (e.kind)
+ switch (e.kind())
{
case dlk_virtual:
case dlk_package:
@@ -1641,7 +1655,7 @@ DepList::replaced(const PackageID & m) const
while (p.second != ((p.first = std::find_if(p.first, p.second,
MatchDepListEntryAgainstPackageDepSpec(_imp->env, spec, _imp->opts->match_package_options)))))
{
- if (p.first->second->package_id->slot() != m.slot())
+ if (p.first->second->package_id()->slot() != m.slot())
p.first = next(p.first);
else
return true;
@@ -1667,7 +1681,7 @@ DepList::Iterator
DepList::push_back(const DepListEntry & e)
{
MergeList::iterator our_merge_entry_position(_imp->merge_list.insert(_imp->merge_list.end(), e));
- _imp->merge_list_index.insert(std::make_pair(e.package_id->name(), our_merge_entry_position));
+ _imp->merge_list_index.insert(std::make_pair(e.package_id()->name(), our_merge_entry_position));
return Iterator(our_merge_entry_position);
}
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index 2f6a6b5..190c8c0 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -48,6 +48,18 @@
namespace paludis
{
+ namespace n
+ {
+ struct associated_entry;
+ struct destination;
+ struct generation;
+ struct handled;
+ struct kind;
+ struct package_id;
+ struct state;
+ struct tags;
+ }
+
/**
* A sequence of functions to try, in order, when overriding masks.
*
@@ -58,6 +70,25 @@ namespace paludis
#include <paludis/dep_list-sr.hh>
/**
+ * An entry in a DepList.
+ *
+ * \see DepList
+ * \ingroup g_dep_list
+ * \nosubgrouping
+ */
+ struct DepListEntry
+ {
+ NamedValue<n::associated_entry, const DepListEntry *> associated_entry;
+ NamedValue<n::destination, std::tr1::shared_ptr<Repository> > destination;
+ NamedValue<n::generation, long> generation;
+ NamedValue<n::handled, std::tr1::shared_ptr<const DepListEntryHandled> > handled;
+ NamedValue<n::kind, DepListEntryKind> kind;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
+ NamedValue<n::state, DepListEntryState> state;
+ NamedValue<n::tags, std::tr1::shared_ptr<DepListEntryTags> > tags;
+ };
+
+ /**
* Holds a list of dependencies in merge order.
*
* \ingroup g_dep_list
diff --git a/paludis/dep_list.sr b/paludis/dep_list.sr
index 61f8ad4..22fa53a 100644
--- a/paludis/dep_list.sr
+++ b/paludis/dep_list.sr
@@ -49,32 +49,3 @@ END
END
}
-make_class_DepListEntry()
-{
- visible
-
- key kind DepListEntryKind
-
- key package_id "std::tr1::shared_ptr<const PackageID>"
- key associated_entry "const DepListEntry *"
- key tags "std::tr1::shared_ptr<DepListEntryTags>"
- key destination "std::tr1::shared_ptr<Repository>"
-
- key generation long
- key state DepListEntryState
-
- key handled "std::tr1::shared_ptr<const DepListEntryHandled>"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * An entry in a DepList.
- *
- * \see DepList
- * \ingroup g_dep_list
- * \nosubgrouping
- */
-END
-}
-
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index a5ed743..1df6dfb 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -2250,7 +2250,7 @@ namespace test_cases
// tags for cat/three
DepList::Iterator it(d1.begin());
- std::tr1::shared_ptr<DepListEntryTags> tags(it->tags);
+ std::tr1::shared_ptr<DepListEntryTags> tags(it->tags());
TEST_CHECK_EQUAL(tags->size(), 3U);
bool cat_three_has_tag_from_cat_one(false);
bool cat_three_has_first_tag_from_cat_two(false);
@@ -2259,10 +2259,10 @@ namespace test_cases
for (DepListEntryTags::ConstIterator tag_it(tags->begin()),
tag_it_end(tags->end()); tag_it_end != tag_it; ++tag_it)
{
- if ("dependency" != tag_it->tag->category())
+ if ("dependency" != tag_it->tag()->category())
continue;
std::tr1::shared_ptr<const DependencyDepTag> tag(
- std::tr1::static_pointer_cast<const DependencyDepTag>(tag_it->tag));
+ std::tr1::static_pointer_cast<const DependencyDepTag>(tag_it->tag()));
if ("cat/one-1:0::repo" == tag->short_text())
{
@@ -2301,17 +2301,17 @@ namespace test_cases
// tags for cat/one
++it;
- tags = it->tags;
+ tags = it->tags();
TEST_CHECK_EQUAL(tags->size(), 1U);
- TEST_CHECK_EQUAL(tags->begin()->tag->category(), "target");
+ TEST_CHECK_EQUAL(tags->begin()->tag()->category(), "target");
// tags for cat/four
++it;
- tags = it->tags;
+ tags = it->tags();
TEST_CHECK_EQUAL(tags->size(), 1U);
- TEST_CHECK_EQUAL(tags->begin()->tag->category(), "dependency");
+ TEST_CHECK_EQUAL(tags->begin()->tag()->category(), "dependency");
std::tr1::shared_ptr<const DependencyDepTag> deptag(
- std::tr1::static_pointer_cast<const DependencyDepTag>(tags->begin()->tag));
+ std::tr1::static_pointer_cast<const DependencyDepTag>(tags->begin()->tag()));
TEST_CHECK_EQUAL(deptag->short_text(), "cat/two-1:0::repo");
TEST_CHECK_STRINGIFY_EQUAL(*deptag->dependency(), "=cat/four-1");
StringifyFormatter ff;
@@ -2321,10 +2321,10 @@ namespace test_cases
// tags for cat/two
++it;
- tags = it->tags;
+ tags = it->tags();
TEST_CHECK_EQUAL(tags->size(), 1U);
- TEST_CHECK_EQUAL(tags->begin()->tag->category(), "general");
- TEST_CHECK_EQUAL(tags->begin()->tag->short_text(), "set");
+ TEST_CHECK_EQUAL(tags->begin()->tag()->category(), "general");
+ TEST_CHECK_EQUAL(tags->begin()->tag()->short_text(), "set");
}
} test_dep_list_dependency_tags;
}
diff --git a/paludis/dep_list_TEST.hh b/paludis/dep_list_TEST.hh
index 2be8a40..a04ecc5 100644
--- a/paludis/dep_list_TEST.hh
+++ b/paludis/dep_list_TEST.hh
@@ -48,9 +48,9 @@ namespace paludis
std::ostream &
operator<< (std::ostream & s, const DepListEntry & e)
{
- s << *e.package_id;
+ s << *e.package_id();
- switch (e.kind)
+ switch (e.kind())
{
case dlk_virtual:
case dlk_package:
diff --git a/paludis/dep_list_TEST_blockers.cc b/paludis/dep_list_TEST_blockers.cc
index ae94f88..aab8152 100644
--- a/paludis/dep_list_TEST_blockers.cc
+++ b/paludis/dep_list_TEST_blockers.cc
@@ -54,10 +54,10 @@ namespace test_cases
d.options()->blocks = dl_blocks_accumulate;
d.add(parse_user_package_dep_spec(merge_target, &env, UserPackageDepSpecOptions()), env.default_destinations());
TEST_CHECK_EQUAL(std::distance(d.begin(), d.end()), 2);
- TEST_CHECK_EQUAL(d.begin()->kind, dlk_block);
- TEST_CHECK_STRINGIFY_EQUAL(*d.begin()->package_id, "cat/two-1:0::installed");
- TEST_CHECK_EQUAL(next(d.begin())->kind, dlk_package);
- TEST_CHECK_STRINGIFY_EQUAL(*next(d.begin())->package_id, "cat/one-1:0::repo");
+ TEST_CHECK_EQUAL(d.begin()->kind(), dlk_block);
+ TEST_CHECK_STRINGIFY_EQUAL(*d.begin()->package_id(), "cat/two-1:0::installed");
+ TEST_CHECK_EQUAL(next(d.begin())->kind(), dlk_package);
+ TEST_CHECK_STRINGIFY_EQUAL(*next(d.begin())->package_id(), "cat/one-1:0::repo");
}
} test_dep_list_basic_block;
@@ -131,14 +131,14 @@ namespace test_cases
d.options()->blocks = dl_blocks_accumulate;
d.add(PackageDepSpec(parse_user_package_dep_spec(merge_target, &env, UserPackageDepSpecOptions())), env.default_destinations());
TEST_CHECK_EQUAL(std::distance(d.begin(), d.end()), 4);
- TEST_CHECK_EQUAL(d.begin()->kind, dlk_block);
- TEST_CHECK_STRINGIFY_EQUAL(*d.begin()->package_id, "virtual/two-1::installed-virtuals (virtual for other/two-1:0::installed)");
- TEST_CHECK_EQUAL(next(d.begin())->kind, dlk_package);
- TEST_CHECK_STRINGIFY_EQUAL(*next(d.begin())->package_id, "cat/two-1:0::repo");
- TEST_CHECK_EQUAL(next(next(d.begin()))->kind, dlk_provided);
- TEST_CHECK_STRINGIFY_EQUAL(*next(next(d.begin()))->package_id, "virtual/two-1::virtuals (virtual for cat/two-1:0::repo)");
- TEST_CHECK_EQUAL(next(next(next(d.begin())))->kind, dlk_package);
- TEST_CHECK_STRINGIFY_EQUAL(*next(next(next(d.begin())))->package_id, "cat/one-1:0::repo");
+ TEST_CHECK_EQUAL(d.begin()->kind(), dlk_block);
+ TEST_CHECK_STRINGIFY_EQUAL(*d.begin()->package_id(), "virtual/two-1::installed-virtuals (virtual for other/two-1:0::installed)");
+ TEST_CHECK_EQUAL(next(d.begin())->kind(), dlk_package);
+ TEST_CHECK_STRINGIFY_EQUAL(*next(d.begin())->package_id(), "cat/two-1:0::repo");
+ TEST_CHECK_EQUAL(next(next(d.begin()))->kind(), dlk_provided);
+ TEST_CHECK_STRINGIFY_EQUAL(*next(next(d.begin()))->package_id(), "virtual/two-1::virtuals (virtual for cat/two-1:0::repo)");
+ TEST_CHECK_EQUAL(next(next(next(d.begin())))->kind(), dlk_package);
+ TEST_CHECK_STRINGIFY_EQUAL(*next(next(next(d.begin())))->package_id(), "cat/one-1:0::repo");
}
} test_dep_list_provided_block;
#endif
diff --git a/paludis/dep_tag-fwd.hh b/paludis/dep_tag-fwd.hh
index c8ed8cd..c689255 100644
--- a/paludis/dep_tag-fwd.hh
+++ b/paludis/dep_tag-fwd.hh
@@ -44,13 +44,14 @@ namespace paludis
class DepTagVisitorTypes;
class DepTagEntry;
+ class DepTagEntryComparator;
/**
* Tags attached to a DepListEntry.
*
* \ingroup g_dep_spec
*/
- typedef Set<DepTagEntry> DepListEntryTags;
+ typedef Set<DepTagEntry, DepTagEntryComparator> DepListEntryTags;
}
#endif
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 4a0085a..d0d930c 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -44,15 +44,13 @@ template class Visits<const TargetDepTag>;
template class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
-template class Set<DepTagEntry>;
-template class WrappedForwardIterator<Set<DepTagEntry>::ConstIteratorTag, const DepTagEntry>;
-template class WrappedOutputIterator<Set<DepTagEntry>::InserterTag, DepTagEntry>;
+template class Set<DepTagEntry, DepTagEntryComparator>;
+template class WrappedForwardIterator<Set<DepTagEntry, DepTagEntryComparator>::ConstIteratorTag, const DepTagEntry>;
+template class WrappedOutputIterator<Set<DepTagEntry, DepTagEntryComparator>::InserterTag, DepTagEntry>;
template class PrivateImplementationPattern<GeneralSetDepTag>;
template class PrivateImplementationPattern<DependencyDepTag>;
-#include <paludis/dep_tag-sr.cc>
-
namespace
{
std::tr1::shared_ptr<DepTagCategory>
@@ -442,3 +440,9 @@ DepTagCategoryFactory::create(const std::string & s) const
throw ConfigurationError("No dep tag category named '" + s + "'");
}
+bool
+DepTagEntryComparator::operator() (const DepTagEntry & l, const DepTagEntry & r) const
+{
+ return *l.tag() < *r.tag();
+}
+
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 4210f13..15f9bc3 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -41,7 +41,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/visitor.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/sr.hh>
+#include <paludis/util/named_value.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/operators.hh>
@@ -50,6 +50,12 @@
namespace paludis
{
+ namespace n
+ {
+ struct generation;
+ struct tag;
+ }
+
/**
* Visitor class for visiting the different DepTag subclasses.
*
@@ -341,7 +347,33 @@ namespace paludis
virtual std::string category() const;
};
-#include <paludis/dep_tag-sr.hh>
+ /**
+ * Tags associated with a DepListEntry.
+ *
+ * The generation key is used internally by DepList. Its value is of no interest
+ * to outside clients.
+ *
+ * \see DepListEntry
+ * \ingroup g_dep_list
+ * \nosubgrouping
+ */
+ struct DepTagEntry
+ {
+ NamedValue<n::generation, long> generation;
+ NamedValue<n::tag, std::tr1::shared_ptr<const DepTag> > tag;
+ };
+
+ /**
+ * Compare two DepListEntry structs by tag only.
+ *
+ * \see DepTagEntry
+ * \ingroup g_dep_list
+ * \since 0.34
+ */
+ struct PALUDIS_VISIBLE DepTagEntryComparator
+ {
+ bool operator() (const DepTagEntry &, const DepTagEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class ConstAcceptInterface<DepTagVisitorTypes>;
diff --git a/paludis/dep_tag.sr b/paludis/dep_tag.sr
deleted file mode 100644
index 01ffcff..0000000
--- a/paludis/dep_tag.sr
+++ /dev/null
@@ -1,25 +0,0 @@
-make_class_DepTagEntry()
-{
- visible
-
- key tag "std::tr1::shared_ptr<const DepTag>"
- key generation long
-
- allow_named_args
- comparison_operators "all" "*tag"
-
- doxygen_comment << "END"
- /**
- * Tags associated with a DepListEntry.
- *
- * The generation key is used internally by DepList. Its value is of no interest
- * to outside clients.
- *
- * \see DepListEntry
- * \ingroup g_dep_list
- * \nosubgrouping
- */
-END
-}
-
-
diff --git a/paludis/files.m4 b/paludis/files.m4
index 973c13c..d4b6c31 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -21,7 +21,7 @@ add(`dep_list_options', `hh', `cc', `se')
add(`dep_spec', `hh', `cc', `test', `fwd')
add(`dep_spec_flattener', `hh', `cc')
add(`dep_tree', `hh', `cc', `fwd')
-add(`dep_tag', `hh', `cc', `fwd', `sr')
+add(`dep_tag', `hh', `cc', `fwd')
add(`distribution', `hh', `cc', `impl', `fwd')
add(`elike_choices', `hh', `cc', `fwd')
add(`elike_dep_parser', `hh', `cc', `fwd', `test')
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index a81e065..6e26b11 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -258,16 +258,16 @@ InstallTask::set_targets_from_serialisation(const std::string & format,
if (! tokens.empty())
throw InternalError(PALUDIS_HERE, "Serialised value '" + *s + "' too long");
- _imp->dep_list.push_back(DepListEntry::create()
- .kind(kind)
- .package_id(package_id)
- .associated_entry(static_cast<DepListEntry *>(0))
- .tags(make_shared_ptr(new DepListEntryTags))
- .destination(destination)
- .generation(0)
- .state(state)
- .handled(handled)
- );
+ _imp->dep_list.push_back(make_named_values<DepListEntry>(
+ value_for<n::associated_entry>(static_cast<DepListEntry *>(0)),
+ value_for<n::destination>(destination),
+ value_for<n::generation>(0),
+ value_for<n::handled>(handled),
+ value_for<n::kind>(kind),
+ value_for<n::package_id>(package_id),
+ value_for<n::state>(state),
+ value_for<n::tags>(make_shared_ptr(new DepListEntryTags))
+ ));
}
}
@@ -339,7 +339,7 @@ InstallTask::serialise(const bool undo_failures) const
for (DepList::ConstIterator d(_imp->dep_list.begin()), d_end(_imp->dep_list.end()) ;
d != d_end ; ++d)
{
- switch (d->kind)
+ switch (d->kind())
{
case dlk_already_installed:
case dlk_virtual:
@@ -362,19 +362,19 @@ InstallTask::serialise(const bool undo_failures) const
result << "'";
- result << d->kind << ";";
+ result << d->kind() << ";";
- result << "=" << *d->package_id << ";";
+ result << "=" << *d->package_id() << ";";
- if (d->destination)
- result << d->destination->name() << ";";
+ if (d->destination())
+ result << d->destination()->name() << ";";
else
result << "0" << ";";
- result << d->state << ";";
+ result << d->state() << ";";
HandledDisplayer h(undo_failures);
- d->handled->accept(h);
+ d->handled()->accept(h);
result << h.result;
result << "'";
@@ -516,16 +516,16 @@ InstallTask::_display_task_list()
{
if (_imp->pretend &&
0 != perform_hook(Hook("install_pretend_display_item_pre")
- ("TARGET", stringify(*dep->package_id))
- ("KIND", stringify(dep->kind))).max_exit_status())
+ ("TARGET", stringify(*dep->package_id()))
+ ("KIND", stringify(dep->kind()))).max_exit_status())
throw InstallActionError("Pretend install aborted by hook");
on_display_merge_list_entry(*dep);
if (_imp->pretend &&
0 != perform_hook(Hook("install_pretend_display_item_post")
- ("TARGET", stringify(*dep->package_id))
- ("KIND", stringify(dep->kind))).max_exit_status())
+ ("TARGET", stringify(*dep->package_id()))
+ ("KIND", stringify(dep->kind()))).max_exit_status())
throw InstallActionError("Pretend install aborted by hook");
}
@@ -609,7 +609,7 @@ InstallTask::_display_failure_summary()
dep != dep_end ; ++dep)
{
s.entry = &*dep;
- dep->handled->accept(s);
+ dep->handled()->accept(s);
}
/* we're done displaying our task list */
@@ -630,19 +630,19 @@ InstallTask::_pretend()
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end ; ++dep)
{
- if ((dlk_package != dep->kind) || already_done(*dep))
+ if ((dlk_package != dep->kind()) || already_done(*dep))
continue;
- if (dep->package_id->supports_action(pretend_action_query))
+ if (dep->package_id()->supports_action(pretend_action_query))
{
on_pretend_pre(*dep);
PretendAction pretend_action;
- dep->package_id->perform_action(pretend_action);
+ dep->package_id()->perform_action(pretend_action);
if (pretend_action.failed())
{
pretend_failed = true;
- dep->handled.reset(new DepListEntryHandledFailed);
+ dep->handled().reset(new DepListEntryHandledFailed);
}
on_pretend_post(*dep);
@@ -667,11 +667,11 @@ InstallTask::_pretend()
void
InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const int s, const int f)
{
- std::string cpvr(stringify(*dep->package_id));
+ std::string cpvr(stringify(*dep->package_id()));
bool live_destination(false);
- if (dep->destination)
- if ((*dep->destination).destination_interface() && (*dep->destination).destination_interface()->want_pre_post_phases())
+ if (dep->destination())
+ if ((*dep->destination()).destination_interface() && (*dep->destination()).destination_interface()->want_pre_post_phases())
live_destination = true;
if (already_done(*dep))
@@ -703,17 +703,17 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
try
{
SupportsActionTest<FetchAction> test_fetch;
- if (dep->package_id->supports_action(test_fetch))
+ if (dep->package_id()->supports_action(test_fetch))
{
FetchAction fetch_action(_imp->fetch_options);
- dep->package_id->perform_action(fetch_action);
+ dep->package_id()->perform_action(fetch_action);
}
if (! _imp->fetch_only)
{
- _imp->install_options.destination() = dep->destination;
+ _imp->install_options.destination() = dep->destination();
InstallAction install_action(_imp->install_options);
- dep->package_id->perform_action(install_action);
+ dep->package_id()->perform_action(install_action);
}
}
catch (const InstallActionError & e)
@@ -756,12 +756,12 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
// look for packages with the same name in the same slot in the destination repos
std::tr1::shared_ptr<const PackageIDSequence> collision_list;
- if (dep->destination)
+ if (dep->destination())
collision_list = (*_imp->env)[selection::AllVersionsSorted(
generator::Matches(make_package_dep_spec()
- .package(dep->package_id->name())
- .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(dep->package_id->slot())))
- .in_repository(dep->destination->name()),
+ .package(dep->package_id()->name())
+ .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(dep->package_id()->slot())))
+ .in_repository(dep->destination()->name()),
MatchPackageOptions()) |
filter::SupportsAction<UninstallAction>())];
@@ -770,7 +770,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (collision_list)
for (PackageIDSequence::ConstIterator c(collision_list->begin()),
c_end(collision_list->end()) ; c != c_end ; ++c)
- if (dep->package_id->version() != (*c)->version())
+ if (dep->package_id()->version() != (*c)->version())
clean_list.push_back(*c);
/* no need to sort clean_list here, although if the above is
* changed then check that this still holds... */
@@ -825,10 +825,10 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
on_clean_all_post(*dep, clean_list);
}
- dep->handled.reset(new DepListEntryHandledSuccess);
+ dep->handled().reset(new DepListEntryHandledSuccess);
/* if we installed paludis and a re-exec is available, use it. */
- if (_imp->env->is_paludis_package(dep->package_id->name()))
+ if (_imp->env->is_paludis_package(dep->package_id()->name()))
{
DepList::Iterator d(dep);
do
@@ -837,7 +837,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (d == _imp->dep_list.end())
break;
}
- while (dlk_package != d->kind);
+ while (dlk_package != d->kind());
if (d != _imp->dep_list.end())
on_installed_paludis();
@@ -862,8 +862,8 @@ InstallTask::_main_actions()
bool any_live_destination(false);
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end && ! any_live_destination ; ++dep)
- if (dlk_package == dep->kind && dep->destination)
- if ((*dep->destination).destination_interface() && (*dep->destination).destination_interface()->want_pre_post_phases())
+ if (dlk_package == dep->kind() && dep->destination())
+ if ((*dep->destination()).destination_interface() && (*dep->destination()).destination_interface()->want_pre_post_phases())
any_live_destination = true;
if (0 != perform_hook(Hook("install_all_pre")
@@ -874,14 +874,16 @@ InstallTask::_main_actions()
}
/* fetch / install our entire list */
- int x(0), y(std::count_if(_imp->dep_list.begin(), _imp->dep_list.end(),
- std::tr1::bind(std::equal_to<DepListEntryKind>(), dlk_package, std::tr1::bind<DepListEntryKind>(std::tr1::mem_fn(&DepListEntry::kind), _1)))),
- s(0), f(0);
+ int x(0), y(0), s(0), f(0);
+ for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
+ dep != dep_end ; ++dep)
+ if (dep->kind() == dlk_package)
+ ++y;
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end ; ++dep)
{
- if (dlk_package != dep->kind)
+ if (dlk_package != dep->kind())
continue;
++x;
@@ -905,7 +907,7 @@ InstallTask::_main_actions()
std::tr1::shared_ptr<const PackageDepSpec> d(_unsatisfied(*dep));
if (! d)
break;
- dep->handled.reset(new DepListEntryHandledSkippedUnsatisfied(*d));
+ dep->handled().reset(new DepListEntryHandledSkippedUnsatisfied(*d));
on_skip_unsatisfied(*dep, *d, x, y, s, f);
++s;
continue;
@@ -916,7 +918,7 @@ InstallTask::_main_actions()
std::tr1::shared_ptr<const PackageID> d(_dependent(*dep));
if (! d)
break;
- dep->handled.reset(new DepListEntryHandledSkippedDependent(d));
+ dep->handled().reset(new DepListEntryHandledSkippedDependent(d));
on_skip_dependent(*dep, d, x, y, s, f);
++s;
continue;
@@ -936,13 +938,13 @@ InstallTask::_main_actions()
}
catch (const InstallActionError & e)
{
- dep->handled.reset(new DepListEntryHandledFailed);
+ dep->handled().reset(new DepListEntryHandledFailed);
on_install_action_error(e);
++f;
}
catch (const FetchActionError & e)
{
- dep->handled.reset(new DepListEntryHandledFailed);
+ dep->handled().reset(new DepListEntryHandledFailed);
on_fetch_action_error(e);
++f;
}
@@ -1359,30 +1361,30 @@ namespace
std::tr1::shared_ptr<const PackageDepSpec>
InstallTask::_unsatisfied(const DepListEntry & e) const
{
- Context context("When checking whether dependencies for '" + stringify(*e.package_id) + "' are satisfied:");
+ Context context("When checking whether dependencies for '" + stringify(*e.package_id()) + "' are satisfied:");
- CheckSatisfiedVisitor v(environment(), *e.package_id);
+ CheckSatisfiedVisitor v(environment(), *e.package_id());
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_pre ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_pre)
- if (e.package_id->build_dependencies_key())
- e.package_id->build_dependencies_key()->value()->accept(v);
+ if (e.package_id()->build_dependencies_key())
+ e.package_id()->build_dependencies_key()->value()->accept(v);
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_runtime ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_runtime)
- if (e.package_id->run_dependencies_key())
- e.package_id->run_dependencies_key()->value()->accept(v);
+ if (e.package_id()->run_dependencies_key())
+ e.package_id()->run_dependencies_key()->value()->accept(v);
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_post ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_post)
- if (e.package_id->post_dependencies_key())
- e.package_id->post_dependencies_key()->value()->accept(v);
+ if (e.package_id()->post_dependencies_key())
+ e.package_id()->post_dependencies_key()->value()->accept(v);
if ((dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_suggested ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_suggested)
&& dl_suggested_install == _imp->dep_list.options()->suggested)
- if (e.package_id->suggested_dependencies_key())
- e.package_id->suggested_dependencies_key()->value()->accept(v);
+ if (e.package_id()->suggested_dependencies_key())
+ e.package_id()->suggested_dependencies_key()->value()->accept(v);
return v.failure;
}
@@ -1476,17 +1478,17 @@ namespace
for (DepList::ConstIterator d(dep_list.begin()), d_end(dep_list.end()) ;
d != d_end ; ++d)
{
- if (! d->handled)
+ if (! d->handled())
continue;
- if (! match_package(*env, a, *d->package_id, MatchPackageOptions()))
+ if (! match_package(*env, a, *d->package_id(), MatchPackageOptions()))
continue;
CheckHandledVisitor v;
- d->handled->accept(v);
+ d->handled()->accept(v);
if (v.failure || v.skipped)
- failure = d->package_id;
+ failure = d->package_id();
else if (v.success)
return;
}
@@ -1574,7 +1576,7 @@ InstallTask::had_action_failures() const
dep != dep_end ; ++dep)
{
CheckHandledVisitor v;
- dep->handled->accept(v);
+ dep->handled()->accept(v);
if (v.failure)
return true;
}
@@ -1585,32 +1587,32 @@ InstallTask::had_action_failures() const
std::tr1::shared_ptr<const PackageID>
InstallTask::_dependent(const DepListEntry & e) const
{
- Context context("When checking whether dependencies for '" + stringify(*e.package_id) + "' are independent of failed packages:");
+ Context context("When checking whether dependencies for '" + stringify(*e.package_id()) + "' are independent of failed packages:");
std::tr1::shared_ptr<PackageIDSet> already_checked(new PackageIDSet);
- CheckIndependentVisitor v(environment(), _imp->dep_list, e.package_id, already_checked);
- already_checked->insert(e.package_id);
+ CheckIndependentVisitor v(environment(), _imp->dep_list, e.package_id(), already_checked);
+ already_checked->insert(e.package_id());
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_pre ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_pre)
- if (e.package_id->build_dependencies_key())
- e.package_id->build_dependencies_key()->value()->accept(v);
+ if (e.package_id()->build_dependencies_key())
+ e.package_id()->build_dependencies_key()->value()->accept(v);
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_runtime ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_runtime)
- if (e.package_id->run_dependencies_key())
- e.package_id->run_dependencies_key()->value()->accept(v);
+ if (e.package_id()->run_dependencies_key())
+ e.package_id()->run_dependencies_key()->value()->accept(v);
if (dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_post ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_post)
- if (e.package_id->post_dependencies_key())
- e.package_id->post_dependencies_key()->value()->accept(v);
+ if (e.package_id()->post_dependencies_key())
+ e.package_id()->post_dependencies_key()->value()->accept(v);
if ((dl_deps_pre == _imp->dep_list.options()->uninstalled_deps_suggested ||
dl_deps_pre_or_post == _imp->dep_list.options()->uninstalled_deps_suggested)
&& dl_suggested_install == _imp->dep_list.options()->suggested)
- if (e.package_id->suggested_dependencies_key())
- e.package_id->suggested_dependencies_key()->value()->accept(v);
+ if (e.package_id()->suggested_dependencies_key())
+ e.package_id()->suggested_dependencies_key()->value()->accept(v);
return v.failure;
}
@@ -1658,7 +1660,7 @@ bool
InstallTask::already_done(const DepListEntry & e) const
{
AlreadyDoneVisitor v;
- e.handled->accept(v);
+ e.handled()->accept(v);
return v.result;
}
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 8d7dae3..33b038f 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -289,7 +289,10 @@ namespace
(*env)[selection::AllVersionsSorted(generator::Matches(a, MatchPackageOptions()) | filter::InstalledAtRoot(env->root()))]);
for (PackageIDSequence::ConstIterator it = m->begin(), it_end = m->end();
it_end != it; ++it)
- matches->insert(DepTagEntry(std::tr1::shared_ptr<const DepTag>(new DependencyDepTag(*it, a, conditions)), 0));
+ matches->insert(make_named_values<DepTagEntry>(
+ value_for<n::generation>(0),
+ value_for<n::tag>(std::tr1::shared_ptr<const DepTag>(new DependencyDepTag(*it, a, conditions)))
+ ));
}
void visit_sequence(const AnyDepSpec & a,
@@ -380,7 +383,7 @@ UninstallList::collect_depped_upon(std::tr1::shared_ptr<const PackageIDSet> targ
for (DepListEntryTags::ConstIterator it(cache->second->begin()), it_end(cache->second->end());
it_end != it; ++it)
- result->insert(std::tr1::static_pointer_cast<const DependencyDepTag>(it->tag)->package_id());
+ result->insert(std::tr1::static_pointer_cast<const DependencyDepTag>(it->tag())->package_id());
}
return result;
@@ -482,7 +485,7 @@ UninstallList::add_dependencies(const PackageID & e, const bool error)
for (DepListEntryTags::ConstIterator it(cache->second->begin()), it_end(cache->second->end());
it_end != it; ++it)
{
- std::tr1::shared_ptr<const DependencyDepTag> tag(std::tr1::static_pointer_cast<const DependencyDepTag>(it->tag));
+ std::tr1::shared_ptr<const DependencyDepTag> tag(std::tr1::static_pointer_cast<const DependencyDepTag>(it->tag()));
if (*tag->package_id() == e)
{
if (! logged)
diff --git a/python/dep_list.cc b/python/dep_list.cc
index 731962e..780e3ef 100644
--- a/python/dep_list.cc
+++ b/python/dep_list.cc
@@ -203,31 +203,28 @@ void expose_dep_list()
"An entry in a DepList.",
bp::no_init
)
- .def_readonly("kind", &DepListEntry::kind,
+ .add_property("kind",
+ &named_values_getter<DepListEntry, n::kind, DepListEntryKind, &DepListEntry::kind>,
"[ro] DepListEntryKind"
)
- .add_property("package_id", bp::make_getter(&DepListEntry::package_id,
- bp::return_value_policy<bp::return_by_value>()),
+ .add_property("package_id",
+ &named_values_getter<DepListEntry, n::package_id, std::tr1::shared_ptr<const PackageID>, &DepListEntry::package_id>,
"[ro] PackageID"
)
- .add_property("associated_entry", bp::make_getter(&DepListEntry::associated_entry,
- bp::return_value_policy<bp::reference_existing_object>()),
- "[ro] DepListEntry"
- )
-
- .add_property("tags", bp::make_getter(&DepListEntry::tags,
- bp::return_value_policy<bp::return_by_value>()),
+ .add_property("tags",
+ &named_values_getter<DepListEntry, n::tags, std::tr1::shared_ptr<DepListEntryTags>, &DepListEntry::tags>,
"[ro] DepListEntryTags"
)
- .add_property("destination", bp::make_getter(&DepListEntry::destination,
- bp::return_value_policy<bp::return_by_value>()),
+ .add_property("destination",
+ &named_values_getter<DepListEntry, n::destination, std::tr1::shared_ptr<Repository>, &DepListEntry::destination>,
"[ro] Repository"
)
- .def_readonly("state", &DepListEntry::state,
+ .add_property("state",
+ &named_values_getter<DepListEntry, n::state, DepListEntryState, &DepListEntry::state>,
"[ro] DepListEntryState"
)
;
@@ -272,3 +269,4 @@ void expose_dep_list()
.def("__iter__", bp::range<bp::return_internal_reference<> >(dl_begin_ptr, dl_end_ptr))
;
}
+
diff --git a/python/dep_list_TEST.py b/python/dep_list_TEST.py
index 4ef554a..129ea1e 100755
--- a/python/dep_list_TEST.py
+++ b/python/dep_list_TEST.py
@@ -180,7 +180,6 @@ class TestCase_03_DepListEntry(unittest.TestCase):
self.assertEquals(dle.kind, DepListEntryKind.PACKAGE)
self.assertEquals(dle.package_id.name, "foo/bar")
- self.assertEquals(dle.associated_entry, None)
self.assertEquals(list(dle.tags), [])
self.assertEquals(str(dle.destination.name), "installed")
self.assertEquals(dle.state, DepListEntryState.HAS_ALL_DEPS)
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 79d873b..eaf77a2 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -1021,7 +1021,7 @@ namespace
{
DepListEntry * p;
Data_Get_Struct(self, DepListEntry, p);
- return INT2FIX(p->kind);
+ return INT2FIX(p->kind());
}
catch (const std::exception & e)
{
@@ -1043,7 +1043,7 @@ namespace
{
DepListEntry * p;
Data_Get_Struct(self, DepListEntry, p);
- return(package_id_to_value(p->package_id));
+ return(package_id_to_value(p->package_id()));
}
catch (const std::exception & e)
{
@@ -1066,9 +1066,9 @@ namespace
Data_Get_Struct(self, DepListEntry, p);
VALUE result(rb_ary_new());
- for (DepListEntryTags::ConstIterator r(p->tags->begin()),
- r_end(p->tags->end()) ; r != r_end ; ++r)
- rb_ary_push(result, dep_tag_to_value((*r).tag));
+ for (DepListEntryTags::ConstIterator r(p->tags()->begin()),
+ r_end(p->tags()->end()) ; r != r_end ; ++r)
+ rb_ary_push(result, dep_tag_to_value((*r).tag()));
return result;
}
@@ -1091,7 +1091,7 @@ namespace
{
DepListEntry * p;
Data_Get_Struct(self, DepListEntry, p);
- return INT2FIX(p->state);
+ return INT2FIX(p->state());
}
catch (const std::exception & e)
{
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 7bd5150..db3ccbf 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -80,7 +80,7 @@ namespace
d.add(*env.set(SetName("system")), env.default_destinations());
for (DepList::ConstIterator e(d.begin()), e_end(d.end()) ; e != e_end ; ++e)
- cout << " " << *e->package_id << endl;
+ cout << " " << *e->package_id() << endl;
}
catch (const NoSuchPackageError & e)
{
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 2380af4..774fea9 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -128,17 +128,17 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
bool none(true);
for (DepList::ConstIterator p(d.begin()), p_end(d.end()) ; p != p_end ; ++p)
- if (dlk_masked == p->kind)
+ if (dlk_masked == p->kind())
{
none = false;
- cout << std::setw(30) << std::left << stringify(p->package_id->name());
- cout << std::setw(20) << std::left << stringify(p->package_id->canonical_form(idcf_version));
+ cout << std::setw(30) << std::left << stringify(p->package_id()->name());
+ cout << std::setw(20) << std::left << stringify(p->package_id()->canonical_form(idcf_version));
std::string current;
- if (p->package_id->keywords_key())
+ if (p->package_id()->keywords_key())
{
- std::tr1::shared_ptr<const KeywordNameSet> keywords(p->package_id->keywords_key()->value());
+ std::tr1::shared_ptr<const KeywordNameSet> keywords(p->package_id()->keywords_key()->value());
for (KeywordNameSet::ConstIterator k(keywords->begin()), k_end(keywords->end()) ;
k != k_end ; ++k)
if (*k == KeywordName("-*")
@@ -151,7 +151,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
std::string masks;
- for (PackageID::MasksConstIterator m(p->package_id->begin_masks()), m_end(p->package_id->end_masks()) ;
+ for (PackageID::MasksConstIterator m(p->package_id()->begin_masks()), m_end(p->package_id()->end_masks()) ;
m != m_end ; ++m)
masks.append(stringify((*m)->key()));
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index f824ab6..73e72fe 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -106,7 +106,7 @@ ConsoleInstallTask::ConsoleInstallTask(Environment * const env,
InstallTask(env, options, d),
_download_size(0),
_download_size_overflow(false),
- _all_tags(new Set<DepTagEntry>),
+ _all_tags(new Set<DepTagEntry, DepTagEntryComparator>),
_already_downloaded(new Set<FSEntry>),
_resolution_finished(false)
{
@@ -208,7 +208,7 @@ ConsoleInstallTask::on_build_deplist_post()
void
ConsoleInstallTask::on_build_cleanlist_pre(const DepListEntry & d)
{
- output_heading("Cleaning stale versions after installing " + stringify(*d.package_id));
+ output_heading("Cleaning stale versions after installing " + stringify(*d.package_id()));
}
void
@@ -379,7 +379,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
do
{
- switch (d.kind)
+ switch (d.kind())
{
case dlk_already_installed:
if (! want_full_install_reasons())
@@ -389,7 +389,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
case dlk_provided:
case dlk_virtual:
- if (d.tags->empty())
+ if (d.tags()->empty())
{
if (! want_full_install_reasons())
return;
@@ -424,32 +424,32 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
return;
std::tr1::shared_ptr<RepositoryName> repo;
- if (d.destination)
- repo.reset(new RepositoryName(d.destination->name()));
+ if (d.destination())
+ repo.reset(new RepositoryName(d.destination()->name()));
std::tr1::shared_ptr<const PackageIDSequence> existing_repo((*environment())[selection::AllVersionsSorted(
generator::Matches(repo ?
- make_package_dep_spec().package(d.package_id->name()).in_repository(*repo) :
- make_package_dep_spec().package(d.package_id->name()),
+ make_package_dep_spec().package(d.package_id()->name()).in_repository(*repo) :
+ make_package_dep_spec().package(d.package_id()->name()),
MatchPackageOptions()))]);
std::tr1::shared_ptr<const PackageIDSequence> existing_slot_repo((*environment())[selection::AllVersionsSorted(
generator::Matches(repo ?
make_package_dep_spec()
- .package(d.package_id->name())
- .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id->slot())))
+ .package(d.package_id()->name())
+ .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id()->slot())))
.in_repository(*repo) :
make_package_dep_spec()
- .package(d.package_id->name())
- .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id->slot()))),
+ .package(d.package_id()->name())
+ .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id()->slot()))),
MatchPackageOptions()))]);
display_merge_list_entry_start(d, m);
display_merge_list_entry_package_name(d, m);
display_merge_list_entry_repository(d, m);
- if (d.package_id->virtual_for_key())
- display_merge_list_entry_for(*d.package_id->virtual_for_key()->value(), m);
+ if (d.package_id()->virtual_for_key())
+ display_merge_list_entry_for(*d.package_id()->virtual_for_key()->value(), m);
display_merge_list_entry_slot(d, m);
@@ -464,7 +464,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
display_merge_list_entry_package_tags(d, m);
display_merge_list_entry_end(d, m);
- if (d.kind == dlk_masked)
+ if (d.kind() == dlk_masked)
display_merge_list_entry_mask_reasons(d);
}
@@ -476,7 +476,7 @@ ConsoleInstallTask::on_pretend_all_pre()
void
ConsoleInstallTask::on_pretend_pre(const DepListEntry & d)
{
- std::string m("Pretending for " + stringify(*d.package_id));
+ std::string m("Pretending for " + stringify(*d.package_id()));
output_xterm_title(m);
}
@@ -499,7 +499,7 @@ void
ConsoleInstallTask::on_fetch_pre(const DepListEntry & d, const int x, const int y,
const int s, const int f)
{
- std::string m("(" + make_x_of_y(x, y, s, f) + ") Fetching " + stringify(*d.package_id));
+ std::string m("(" + make_x_of_y(x, y, s, f) + ") Fetching " + stringify(*d.package_id()));
output_heading(m);
output_xterm_title(m);
@@ -525,7 +525,7 @@ void
ConsoleInstallTask::on_install_pre(const DepListEntry & d, const int x,
const int y, const int s, const int f)
{
- std::string m("(" + make_x_of_y(x, y, s, f) + ") Installing " + stringify(*d.package_id));
+ std::string m("(" + make_x_of_y(x, y, s, f) + ") Installing " + stringify(*d.package_id()));
output_heading(m);
output_xterm_title(m);
@@ -535,7 +535,7 @@ void
ConsoleInstallTask::on_skip_unsatisfied(const DepListEntry & d, const PackageDepSpec & spec,
const int x, const int y, const int s, const int f)
{
- std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id) +
+ std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id()) +
" (unsatisfied '" + stringify(spec) + "')");
output_heading(m);
@@ -545,7 +545,7 @@ void
ConsoleInstallTask::on_skip_dependent(const DepListEntry & d, const std::tr1::shared_ptr<const PackageID> & id,
const int x, const int y, const int s, const int f)
{
- std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id) +
+ std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id()) +
" (dependent upon '" + stringify(*id) + "')");
output_heading(m);
@@ -555,7 +555,7 @@ void
ConsoleInstallTask::on_skip_already_done(const DepListEntry & d,
const int x, const int y, const int s, const int f)
{
- std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id) +
+ std::string m("(" + make_x_of_y(x, y, s, f) + ") Skipping " + stringify(*d.package_id()) +
" (already done)");
output_heading(m);
@@ -571,7 +571,7 @@ void
ConsoleInstallTask::on_install_fail(const DepListEntry & d, const int x, const int y,
const int s, const int f)
{
- output_xterm_title("(" + make_x_of_y(x, y, s, f) + ") Failed install of " + stringify(*d.package_id));
+ output_xterm_title("(" + make_x_of_y(x, y, s, f) + ") Failed install of " + stringify(*d.package_id()));
}
void
@@ -730,9 +730,9 @@ ConsoleInstallTask::display_merge_list_post_tags()
return;
std::set<std::string> tag_categories;
- for (Set<DepTagEntry>::ConstIterator a(all_tags()->begin()),
+ for (Set<DepTagEntry, DepTagEntryComparator>::ConstIterator a(all_tags()->begin()),
a_end(all_tags()->end()) ; a != a_end ; ++a)
- tag_categories.insert(a->tag->category());
+ tag_categories.insert(a->tag()->category());
display_tag_summary_start();
@@ -747,12 +747,12 @@ ConsoleInstallTask::display_merge_list_post_tags()
display_tag_summary_tag_title(*c);
display_tag_summary_tag_pre_text(*c);
- for (Set<DepTagEntry>::ConstIterator t(all_tags()->begin()),
+ for (Set<DepTagEntry, DepTagEntryComparator>::ConstIterator t(all_tags()->begin()),
t_end(all_tags()->end()) ; t != t_end ; ++t)
{
- if (t->tag->category() != *cat)
+ if (t->tag()->category() != *cat)
continue;
- display_tag_summary_tag(t->tag);
+ display_tag_summary_tag(t->tag());
}
display_tag_summary_tag_post_text(*c);
@@ -842,7 +842,7 @@ DepTagSummaryDisplayer::visit(const GeneralSetDepTag & tag)
void
ConsoleInstallTask::display_merge_list_entry_start(const DepListEntry & e, const DisplayMode)
{
- switch (e.kind)
+ switch (e.kind())
{
case dlk_subpackage:
case dlk_suggested:
@@ -869,15 +869,15 @@ ConsoleInstallTask::display_merge_list_entry_package_name(const DepListEntry & d
{
case normal_entry:
case suggested_entry:
- output_no_endl(render_as_package_name(stringify(d.package_id->name())));
+ output_no_endl(render_as_package_name(stringify(d.package_id()->name())));
break;
case unimportant_entry:
- output_no_endl(render_as_unimportant(stringify(d.package_id->name())));
+ output_no_endl(render_as_unimportant(stringify(d.package_id()->name())));
break;
case error_entry:
- output_no_endl(render_as_error(stringify(d.package_id->name())));
+ output_no_endl(render_as_error(stringify(d.package_id()->name())));
break;
}
}
@@ -911,18 +911,18 @@ ConsoleInstallTask::display_merge_list_entry_repository(const DepListEntry & d,
// XXX fix this once the new resolver's in
std::tr1::shared_ptr<const PackageIDSequence> inst((*environment())[selection::BestVersionOnly(
generator::Matches(make_package_dep_spec()
- .package(d.package_id->name())
- .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id->slot()))),
+ .package(d.package_id()->name())
+ .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(d.package_id()->slot()))),
MatchPackageOptions()) |
filter::InstalledAtRoot(environment()->root()))]);
bool changed(normal_entry == m &&
! inst->empty() && (*inst->begin())->from_repositories_key() &&
(*inst->begin())->from_repositories_key()->value()->end() ==
(*inst->begin())->from_repositories_key()->value()->find(
- stringify(d.package_id->repository()->name())));
+ stringify(d.package_id()->repository()->name())));
- if (changed || environment()->package_database()->favourite_repository() != d.package_id->repository()->name())
- output_no_endl("::" + stringify(d.package_id->repository()->name()));
+ if (changed || environment()->package_database()->favourite_repository() != d.package_id()->repository()->name())
+ output_no_endl("::" + stringify(d.package_id()->repository()->name()));
if (changed)
output_no_endl(" (previously ::" + join((*inst->begin())->from_repositories_key()->value()->begin(),
(*inst->begin())->from_repositories_key()->value()->end(), ", ::") + ")");
@@ -931,22 +931,22 @@ ConsoleInstallTask::display_merge_list_entry_repository(const DepListEntry & d,
void
ConsoleInstallTask::display_merge_list_entry_slot(const DepListEntry & d, const DisplayMode m)
{
- if (d.package_id->slot() == SlotName("0"))
+ if (d.package_id()->slot() == SlotName("0"))
return;
switch (m)
{
case normal_entry:
case suggested_entry:
- output_no_endl(render_as_slot_name(" :" + stringify(d.package_id->slot())));
+ output_no_endl(render_as_slot_name(" :" + stringify(d.package_id()->slot())));
break;
case unimportant_entry:
- output_no_endl(render_as_unimportant(" :" + stringify(d.package_id->slot())));
+ output_no_endl(render_as_unimportant(" :" + stringify(d.package_id()->slot())));
break;
case error_entry:
- output_no_endl(render_as_slot_name(" :" + stringify(d.package_id->slot())));
+ output_no_endl(render_as_slot_name(" :" + stringify(d.package_id()->slot())));
break;
}
}
@@ -960,17 +960,17 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
switch (m)
{
case unimportant_entry:
- if (d.kind == dlk_provided)
+ if (d.kind() == dlk_provided)
output_no_endl(render_as_unimportant(" [provided " +
- stringify(d.package_id->canonical_form(idcf_version)) + "]"));
+ stringify(d.package_id()->canonical_form(idcf_version)) + "]"));
else
output_no_endl(render_as_unimportant(" [- " +
- stringify(d.package_id->canonical_form(idcf_version)) + "]"));
+ stringify(d.package_id()->canonical_form(idcf_version)) + "]"));
break;
case suggested_entry:
output_no_endl(render_as_update_mode(" [suggestion " +
- stringify(d.package_id->canonical_form(idcf_version)) + "]"));
+ stringify(d.package_id()->canonical_form(idcf_version)) + "]"));
set_count<suggested_count>(count<suggested_count>() + 1);
break;
@@ -979,44 +979,44 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
output_no_endl(render_as_update_mode(" ["));
std::string destination_str;
- if (! d.package_id->virtual_for_key())
+ if (! d.package_id()->virtual_for_key())
{
std::tr1::shared_ptr<const DestinationsSet> default_destinations(environment()->default_destinations());
- if (default_destinations->end() == default_destinations->find(d.destination))
- destination_str = " ::" + stringify(d.destination->name());
+ if (default_destinations->end() == default_destinations->find(d.destination()))
+ destination_str = " ::" + stringify(d.destination()->name());
}
if (existing_repo->empty())
{
- output_no_endl(render_as_update_mode("N " + stringify(d.package_id->canonical_form(idcf_version) + destination_str)));
+ output_no_endl(render_as_update_mode("N " + stringify(d.package_id()->canonical_form(idcf_version) + destination_str)));
set_count<new_count>(count<new_count>() + 1);
set_count<max_count>(count<max_count>() + 1);
}
else if (existing_slot_repo->empty())
{
- output_no_endl(render_as_update_mode("S " + d.package_id->canonical_form(idcf_version) + destination_str));
+ output_no_endl(render_as_update_mode("S " + d.package_id()->canonical_form(idcf_version) + destination_str));
set_count<new_slot_count>(count<new_slot_count>() + 1);
set_count<max_count>(count<max_count>() + 1);
}
- else if ((*existing_slot_repo->last())->version() < d.package_id->version())
+ else if ((*existing_slot_repo->last())->version() < d.package_id()->version())
{
output_no_endl(render_as_update_mode("U " +
stringify((*existing_slot_repo->last())->canonical_form(idcf_version)) + " -> " +
- stringify(d.package_id->canonical_form(idcf_version))));
+ stringify(d.package_id()->canonical_form(idcf_version))));
set_count<upgrade_count>(count<upgrade_count>() + 1);
set_count<max_count>(count<max_count>() + 1);
}
- else if ((*existing_slot_repo->last())->version() > d.package_id->version())
+ else if ((*existing_slot_repo->last())->version() > d.package_id()->version())
{
output_no_endl(render_as_update_mode("D " +
stringify((*existing_slot_repo->last())->canonical_form(idcf_version)) + " -> " +
- stringify(d.package_id->canonical_form(idcf_version))));
+ stringify(d.package_id()->canonical_form(idcf_version))));
set_count<downgrade_count>(count<downgrade_count>() + 1);
set_count<max_count>(count<max_count>() + 1);
}
else
{
- output_no_endl(render_as_update_mode("R " + stringify(d.package_id->canonical_form(idcf_version)) +
+ output_no_endl(render_as_update_mode("R " + stringify(d.package_id()->canonical_form(idcf_version)) +
destination_str));
set_count<rebuild_count>(count<rebuild_count>() + 1);
set_count<max_count>(count<max_count>() + 1);
@@ -1030,7 +1030,7 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
set_count<error_count>(count<error_count>() + 1);
do
{
- switch (d.kind)
+ switch (d.kind())
{
case dlk_masked:
output_no_endl(render_as_update_mode(" [! masked]"));
@@ -1071,7 +1071,7 @@ ConsoleInstallTask::display_merge_list_entry_choices(const DepListEntry & d,
case normal_entry:
{
- if (! d.package_id->choices_key())
+ if (! d.package_id()->choices_key())
break;
std::tr1::shared_ptr<const Choices> old_choices;
@@ -1082,8 +1082,8 @@ ConsoleInstallTask::display_merge_list_entry_choices(const DepListEntry & d,
ColourFormatter formatter;
std::string s;
bool non_blank_prefix(false);
- for (Choices::ConstIterator k(d.package_id->choices_key()->value()->begin()),
- k_end(d.package_id->choices_key()->value()->end()) ;
+ for (Choices::ConstIterator k(d.package_id()->choices_key()->value()->begin()),
+ k_end(d.package_id()->choices_key()->value()->end()) ;
k != k_end ; ++k)
{
if ((*k)->hidden())
@@ -1140,16 +1140,16 @@ ConsoleInstallTask::display_merge_list_entry_choices(const DepListEntry & d,
{
t = formatter.decorate(**i, t, format::Changed());
if (want_changed_use_flags())
- _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id);
+ _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id());
}
else if (added)
{
t = formatter.decorate(**i, t, format::Added());
if (want_new_use_flags())
- _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id);
+ _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id());
}
else if (want_unchanged_use_flags())
- _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id);
+ _choice_descriptions[(*k)->human_name()][(*i)->name_with_prefix()].push_back(d.package_id());
s.append(t);
}
@@ -1176,7 +1176,7 @@ ConsoleInstallTask::display_merge_list_entry_description(const DepListEntry & d,
const std::tr1::shared_ptr<const PackageIDSequence> &,
const DisplayMode m)
{
- if ((! d.package_id->short_description_key()) || d.package_id->short_description_key()->value().empty())
+ if ((! d.package_id()->short_description_key()) || d.package_id()->short_description_key()->value().empty())
return;
if (existing_slot_repo->empty())
@@ -1199,11 +1199,11 @@ ConsoleInstallTask::display_merge_list_entry_description(const DepListEntry & d,
case suggested_entry:
case normal_entry:
if (want_compact())
- output_no_endl(" \"" + d.package_id->short_description_key()->value() + "\"");
+ output_no_endl(" \"" + d.package_id()->short_description_key()->value() + "\"");
else
{
output_endl();
- output_no_endl(" \"" + d.package_id->short_description_key()->value() + "\"");
+ output_no_endl(" \"" + d.package_id()->short_description_key()->value() + "\"");
}
break;
}
@@ -1248,11 +1248,11 @@ ConsoleInstallTask::display_merge_list_entry_distsize(const DepListEntry & d,
return;
SupportsActionTest<PretendFetchAction> action_test;
- if (! d.package_id->supports_action(action_test))
+ if (! d.package_id()->supports_action(action_test))
return;
FindDistfilesSize action(fetch_action_options(), _already_downloaded);
- d.package_id->perform_action(action);
+ d.package_id()->perform_action(action);
if (! action.size)
return;
@@ -1286,24 +1286,24 @@ ConsoleInstallTask::display_merge_list_entry_distsize(const DepListEntry & d,
void
ConsoleInstallTask::display_merge_list_entry_non_package_tags(const DepListEntry & d, const DisplayMode m)
{
- if (d.tags->empty())
+ if (d.tags()->empty())
return;
std::string tag_titles;
std::stringstream s;
- for (Set<DepTagEntry>::ConstIterator
- tag(d.tags->begin()),
- tag_end(d.tags->end()) ;
+ for (Set<DepTagEntry, DepTagEntryComparator>::ConstIterator
+ tag(d.tags()->begin()),
+ tag_end(d.tags()->end()) ;
tag != tag_end ; ++tag)
{
- if (tag->tag->category() == "dependency")
+ if (tag->tag()->category() == "dependency")
continue;
all_tags()->insert(*tag);
std::tr1::shared_ptr<EntryDepTagDisplayer> displayer(make_entry_dep_tag_displayer());
- tag->tag->accept(*displayer.get());
+ tag->tag()->accept(*displayer.get());
tag_titles.append(displayer->text());
tag_titles.append(", ");
}
@@ -1340,35 +1340,35 @@ ConsoleInstallTask::display_merge_list_entry_non_package_tags(const DepListEntry
void
ConsoleInstallTask::display_merge_list_entry_package_tags(const DepListEntry & d, const DisplayMode m)
{
- if (d.tags->empty())
+ if (d.tags()->empty())
return;
std::stringstream s;
if (! want_install_reasons())
- if (d.kind != dlk_block)
+ if (d.kind() != dlk_block)
return;
std::string deps;
std::set<std::string> dependents, unsatisfied_dependents;
unsigned c(0), max_c(want_full_install_reasons() ? std::numeric_limits<long>::max() : 3);
- for (Set<DepTagEntry>::ConstIterator
- tag(d.tags->begin()),
- tag_end(d.tags->end()) ;
+ for (Set<DepTagEntry, DepTagEntryComparator>::ConstIterator
+ tag(d.tags()->begin()),
+ tag_end(d.tags()->end()) ;
tag != tag_end ; ++tag)
{
- if (tag->tag->category() != "dependency")
+ if (tag->tag()->category() != "dependency")
continue;
std::tr1::shared_ptr<const PackageDepSpec> spec(
- std::tr1::static_pointer_cast<const DependencyDepTag>(tag->tag)->dependency());
- if (d.kind != dlk_masked && d.kind != dlk_block && (*environment())[selection::SomeArbitraryVersion(
+ std::tr1::static_pointer_cast<const DependencyDepTag>(tag->tag())->dependency());
+ if (d.kind() != dlk_masked && d.kind() != dlk_block && (*environment())[selection::SomeArbitraryVersion(
generator::Matches(*spec, MatchPackageOptions()) |
filter::SupportsAction<InstalledAction>())]->empty())
- unsatisfied_dependents.insert(tag->tag->short_text());
+ unsatisfied_dependents.insert(tag->tag()->short_text());
else
- dependents.insert(tag->tag->short_text());
+ dependents.insert(tag->tag()->short_text());
}
for (std::set<std::string>::iterator it(unsatisfied_dependents.begin()),
@@ -1482,12 +1482,12 @@ ConsoleInstallTask::display_merge_list_entry_mask_reasons(const DepListEntry & e
bool need_comma(false);
output_no_endl(" Masked by: ");
- for (PackageID::MasksConstIterator m(e.package_id->begin_masks()), m_end(e.package_id->end_masks()) ;
+ for (PackageID::MasksConstIterator m(e.package_id()->begin_masks()), m_end(e.package_id()->end_masks()) ;
m != m_end ; ++m)
{
if (need_comma)
output_no_endl(", ");
- MaskDisplayer d(environment(), e.package_id, true);
+ MaskDisplayer d(environment(), e.package_id(), true);
(*m)->accept(d);
output_no_endl(d.result());
need_comma = true;
@@ -1737,7 +1737,7 @@ void
ConsoleInstallTask::on_display_failure_summary_failure(const DepListEntry & e)
{
output_starred_item_no_endl("");
- output_stream() << colour(cl_package_name, *e.package_id) << ": " << colour(cl_error, "failure");
+ output_stream() << colour(cl_package_name, *e.package_id()) << ": " << colour(cl_error, "failure");
output_endl();
}
@@ -1746,7 +1746,7 @@ ConsoleInstallTask::on_display_failure_summary_skipped_unsatisfied(const DepList
const PackageDepSpec & spec)
{
output_starred_item_no_endl("");
- output_stream() << colour(cl_package_name, *e.package_id) << ": skipped (dependency '"
+ output_stream() << colour(cl_package_name, *e.package_id()) << ": skipped (dependency '"
<< spec << "' unsatisfied)";
output_endl();
}
@@ -1756,7 +1756,7 @@ ConsoleInstallTask::on_display_failure_summary_skipped_dependent(const DepListEn
const std::tr1::shared_ptr<const PackageID> & id)
{
output_starred_item_no_endl("");
- output_stream() << colour(cl_package_name, *e.package_id) << ": skipped (dependent upon '"
+ output_stream() << colour(cl_package_name, *e.package_id()) << ": skipped (dependent upon '"
<< *id << "')";
output_endl();
}
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index ff0163f..0a85a3b 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -106,7 +106,7 @@ namespace paludis
int _counts[last_count];
unsigned long _download_size;
bool _download_size_overflow;
- std::tr1::shared_ptr<Set<DepTagEntry> > _all_tags;
+ std::tr1::shared_ptr<Set<DepTagEntry, DepTagEntryComparator> > _all_tags;
std::tr1::shared_ptr<Set<FSEntry> > _already_downloaded;
ChoiceDescriptions _choice_descriptions;
@@ -272,7 +272,7 @@ namespace paludis
return _download_size;
}
- std::tr1::shared_ptr<Set<DepTagEntry> > all_tags()
+ std::tr1::shared_ptr<Set<DepTagEntry, DepTagEntryComparator> > all_tags()
{
return _all_tags;
}