aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Dimitry Ishenko <dimitry.ishenko@gmail.com> 2014-06-06 11:26:45 -0400
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2014-06-06 20:15:26 +0100
commitcd6c8c4a026b84517b7e775a2dfc614227241a6b (patch)
treef6e803aae9fa93ce452d754f96bc1abc77124dca
parent5d893d669d71875a8a36b06e0e15e3badc96092b (diff)
downloadpaludis-cd6c8c4a026b84517b7e775a2dfc614227241a6b.tar.gz
paludis-cd6c8c4a026b84517b7e775a2dfc614227241a6b.tar.xz
Report stale packages
-rw-r--r--src/clients/cave/cmd_report-fmt.hh3
-rw-r--r--src/clients/cave/cmd_report.cc17
2 files changed, 20 insertions, 0 deletions
diff --git a/src/clients/cave/cmd_report-fmt.hh b/src/clients/cave/cmd_report-fmt.hh
index 3fe48a5..09a9a81 100644
--- a/src/clients/cave/cmd_report-fmt.hh
+++ b/src/clients/cave/cmd_report-fmt.hh
@@ -18,3 +18,6 @@ const auto fs_package_insecure = make_format_string_fetcher("report/insecure", 1
const auto fs_package_unused = make_format_string_fetcher("report/unused", 1)
<< " Not used by any package in world\\n";
+const auto fs_package_not_best = make_format_string_fetcher("report/not_best", 1)
+ << " Has better version available: " << param<'s'>() << "\\n";
+
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index 526f630..e25c87a 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.cc
@@ -250,6 +250,23 @@ ReportCommand::run(
}
}
+ auto superiors((*env)[selection::BestVersionOnly((
+ generator::Matches(make_package_dep_spec({ })
+ .package((*i)->name())
+ .version_requirement(make_named_values<VersionRequirement>(
+ n::version_operator() = vo_greater,
+ n::version_spec() = (*i)->version())),
+ nullptr, { })) |
+ filter::SameSlot(*i) |
+ filter::NotMasked() |
+ filter::SupportsAction<InstallAction>())]);
+
+ if (! superiors->empty())
+ {
+ need_heading(done_heading, *i);
+ cout << fuc(fs_package_not_best(), fv<'s'>(stringify(**superiors->begin())));
+ }
+
if (done_heading)
errors = true;
}