aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-06-05 20:00:41 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-06-05 20:00:41 +0000
commit41e6de161a3701068edf7373e4869da494db1ee3 (patch)
treee838832d0cdc8bf896a8b990969a30725295cd21 /src
parent66b1c876c09833a4dd57d2be968a9acb1052e068 (diff)
downloadpaludis-41e6de161a3701068edf7373e4869da494db1ee3.tar.gz
paludis-41e6de161a3701068edf7373e4869da494db1ee3.tar.xz
Add TargetDepTag and extra members to DependencyDepTag. Indicate which dependents are really pulling in a new package, versus which are satisfied by the currently installed version.
Diffstat (limited to 'src')
-rw-r--r--src/output/console_install_task.cc37
-rw-r--r--src/output/console_install_task.hh2
2 files changed, 36 insertions, 3 deletions
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index c0c610fc3..8390dda0f 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -685,6 +685,11 @@ DepTagSummaryDisplayer::visit(const DependencyDepTag &)
}
void
+DepTagSummaryDisplayer::visit(const TargetDepTag &)
+{
+}
+
+void
DepTagSummaryDisplayer::visit(const GeneralSetDepTag & tag)
{
std::string desc;
@@ -991,6 +996,7 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
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 (SortedCollection<DepTagEntry>::Iterator
@@ -1001,19 +1007,39 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
if (tag->tag->category() != "dependency")
continue;
+ tr1::shared_ptr<const PackageDepSpec> spec(
+ tr1::static_pointer_cast<const DependencyDepTag>(tag->tag)->dependency());
+ if (d.kind != dlk_masked && d.kind != dlk_block && environment()->package_database()->query(
+ query::Matches(*spec) & query::RepositoryHasInstalledInterface(), qo_whatever)->empty())
+ unsatisfied_dependents.insert(tag->tag->short_text());
+ else
+ dependents.insert(tag->tag->short_text());
+ }
+
+ for (std::set<std::string>::iterator it(unsatisfied_dependents.begin()),
+ it_end(unsatisfied_dependents.end()); it_end != it; ++it)
if (++c < max_c)
{
- deps.append(tag->tag->short_text());
+ deps.append("*");
+ deps.append(*it);
+ deps.append(", ");
+ }
+ for (std::set<std::string>::iterator it(dependents.begin()),
+ it_end(dependents.end()); it_end != it; ++it)
+ if (unsatisfied_dependents.end() == unsatisfied_dependents.find(*it) &&
+ ++c < max_c)
+ {
+ deps.append(*it);
deps.append(", ");
}
- }
if (! deps.empty())
{
if (c >= max_c)
deps.append(stringify(c - max_c + 1) + " more, ");
- deps.erase(deps.length() - 2);
+ if (! deps.empty())
+ deps.erase(deps.length() - 2);
if (! deps.empty())
switch (m)
@@ -1075,6 +1101,11 @@ EntryDepTagDisplayer::visit(const DependencyDepTag &)
}
void
+EntryDepTagDisplayer::visit(const TargetDepTag &)
+{
+}
+
+void
EntryDepTagDisplayer::visit(const GeneralSetDepTag & tag)
{
text() = tag.short_text(); // + "<" + tag->source() + ">";
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 9d94bb0bb..f59009f7a 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -57,6 +57,7 @@ namespace paludis
void visit(const GLSADepTag &);
void visit(const DependencyDepTag &);
void visit(const GeneralSetDepTag &);
+ void visit(const TargetDepTag &);
ConsoleInstallTask * task()
{
@@ -77,6 +78,7 @@ namespace paludis
void visit(const GLSADepTag & tag);
void visit(const DependencyDepTag &);
void visit(const GeneralSetDepTag & tag);
+ void visit(const TargetDepTag &);
std::string & text()
{