aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-03 23:26:46 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-03 23:26:46 +0100
commit8022c7fa08e2e81d3951f5376064732f8a502929 (patch)
treea6052d8fc93d24f8afdb6cc7eaaf3099f84f74a3
parent1069ae67a755c2cbe0bf95e26a90235bcc5828c5 (diff)
downloadpaludis-8022c7fa08e2e81d3951f5376064732f8a502929.tar.gz
paludis-8022c7fa08e2e81d3951f5376064732f8a502929.tar.xz
show when we're changing repos
-rw-r--r--src/clients/cave/cmd_display_resolution.cc42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 271f346..c2e4236 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -32,6 +32,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/set.hh>
#include <paludis/resolver/resolutions.hh>
#include <paludis/resolver/serialise.hh>
#include <paludis/resolver/reason.hh>
@@ -48,6 +49,7 @@
#include <paludis/choice.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/match_package.hh>
+#include <paludis/repository.hh>
#include <set>
#include <iterator>
@@ -181,10 +183,48 @@ namespace
if (! (*c)->destinations()->slash()->replacing()->empty())
{
cout << " replacing";
+ bool first(true);
for (PackageIDSequence::ConstIterator x((*c)->destinations()->slash()->replacing()->begin()),
x_end((*c)->destinations()->slash()->replacing()->end()) ;
x != x_end ; ++x)
- cout << " " << (*x)->canonical_form(idcf_version);
+ {
+ bool different(false);
+ std::string old_from;
+ if ((*x)->from_repositories_key())
+ {
+ for (Set<std::string>::ConstIterator k((*x)->from_repositories_key()->value()->begin()),
+ k_end((*x)->from_repositories_key()->value()->end()) ;
+ k != k_end ; ++k)
+ {
+ if (stringify(id->repository()->name()) != *k)
+ {
+ if (id->from_repositories_key() && (id->from_repositories_key()->value()->end() !=
+ id->from_repositories_key()->value()->find(*k)))
+ {
+ }
+ else
+ different = true;
+ }
+
+ if (old_from.empty())
+ old_from = " from ::";
+ else
+ old_from.append(", ::");
+
+ old_from.append(*k);
+ }
+ }
+
+ if (! first)
+ cout << ", ";
+ else
+ cout << " ";
+ first = false;
+
+ cout << (*x)->canonical_form(idcf_version);
+ if (different)
+ cout << old_from;
+ }
}
}