aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-02-23 21:19:04 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-02-23 21:19:04 +0000
commitf74b950a0277937a13b83cecd84615a11902ade5 (patch)
tree14d12258b661e265c14af8885cfa4eb469102a3d
parent2ebb819deae85af0ce88566986e7e8403d092113 (diff)
downloadpaludis-f74b950a0277937a13b83cecd84615a11902ade5.tar.gz
paludis-f74b950a0277937a13b83cecd84615a11902ade5.tar.xz
Indicate when a package to be installed was previously installed from a different repository.
-rw-r--r--src/output/console_install_task.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 949054a..3014fa5 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -951,8 +951,22 @@ ConsoleInstallTask::display_merge_list_entry_for(const PackageID & d, const Disp
void
ConsoleInstallTask::display_merge_list_entry_repository(const DepListEntry & d, const DisplayMode)
{
- if (environment()->package_database()->favourite_repository() != d.package_id->repository()->name())
+ // XXX fix this once the new resolver's in
+ tr1::shared_ptr<const PackageIDSequence> inst(
+ environment()->package_database()->query(
+ query::Matches(make_package_dep_spec()
+ .package(d.package_id->name())
+ .slot(d.package_id->slot())) &
+ query::InstalledAtRoot(environment()->root()),
+ qo_best_version_only));
+ bool changed(! inst->empty() && (*inst->begin())->source_origin_key() &&
+ (*inst->begin())->source_origin_key()->value() !=
+ 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 ::" + (*inst->begin())->source_origin_key()->value() + ")");
}
void