aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-08 21:07:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-08 21:07:07 +0100
commita0b37c33588030ed96e58365c063958d370491bc (patch)
tree98b309a0b7e65c14ac547d398a25ccca74be1720
parent164c5ff7ba0e7aae7695e4a287700b89b147b47e (diff)
downloadpaludis-a0b37c33588030ed96e58365c063958d370491bc.tar.gz
paludis-a0b37c33588030ed96e58365c063958d370491bc.tar.xz
show new-slot but not new packages differently
-rw-r--r--src/clients/cave/cmd_display_resolution.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 636398c..f1ba9b2 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -52,6 +52,11 @@
#include <paludis/match_package.hh>
#include <paludis/repository.hh>
#include <paludis/package_dep_spec_properties.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/environment.hh>
#include <set>
#include <iterator>
@@ -213,7 +218,7 @@ namespace
}
void display_resolution(
- const std::tr1::shared_ptr<Environment> &,
+ const std::tr1::shared_ptr<Environment> & env,
const ResolutionLists & lists,
const DisplayResolutionCommandLine &)
{
@@ -235,13 +240,21 @@ namespace
if (! id)
throw InternalError(PALUDIS_HERE, "why did that happen?");
- bool is_new(false), is_upgrade(false), is_downgrade(false), is_reinstall(false);
+ bool is_new(false), is_upgrade(false), is_downgrade(false), is_reinstall(false),
+ other_slots(false);
std::tr1::shared_ptr<const PackageID> old_id;
if ((*c)->destinations()->slash())
{
if ((*c)->destinations()->slash()->replacing()->empty())
+ {
is_new = true;
+ const std::tr1::shared_ptr<const PackageIDSequence> others((*env)[selection::SomeArbitraryVersion(
+ generator::Package(id->name()) &
+ generator::InRepository((*c)->destinations()->slash()->repository())
+ )]);
+ other_slots = ! others->empty();
+ }
else
for (PackageIDSequence::ConstIterator x((*c)->destinations()->slash()->replacing()->begin()),
x_end((*c)->destinations()->slash()->replacing()->end()) ;
@@ -262,7 +275,12 @@ namespace
}
if (is_new)
- cout << "[n] " << c::bold_blue() << id->canonical_form(idcf_no_version);
+ {
+ if (other_slots)
+ cout << "[s] " << c::bold_blue() << id->canonical_form(idcf_no_version);
+ else
+ cout << "[n] " << c::bold_blue() << id->canonical_form(idcf_no_version);
+ }
else if (is_upgrade)
cout << "[u] " << c::blue() << id->canonical_form(idcf_no_version);
else if (is_reinstall)