aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-06 15:35:17 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-06 17:21:25 +0100
commitcc7a319cdebc82fbca85ed9c954774e6def4da0f (patch)
tree923b4f6ee60f4ac6db85af6c916d1dd6ac9af629
parent4b437b846b25f0f9f0d626f902979082cef3e2f3 (diff)
downloadpaludis-cc7a319cdebc82fbca85ed9c954774e6def4da0f.tar.gz
paludis-cc7a319cdebc82fbca85ed9c954774e6def4da0f.tar.xz
Fall back to showing best not installed
-rw-r--r--src/clients/cave/cmd_show.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 05fe135..5d22f0b 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -804,7 +804,7 @@ namespace
if (ids->empty())
throw NothingMatching(s);
- std::tr1::shared_ptr<const PackageID> best_installable, best_masked_installable;
+ std::tr1::shared_ptr<const PackageID> best_installable, best_masked_installable, best_not_installed;
std::tr1::shared_ptr<PackageIDSequence> all_installed(new PackageIDSequence);
std::set<RepositoryName, RepositoryNameComparator> repos;
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
@@ -819,12 +819,16 @@ namespace
else
best_installable = *i;
}
+ else
+ best_not_installed = *i;
repos.insert((*i)->repository()->name());
}
if (! best_installable)
best_installable = best_masked_installable;
+ if (! best_installable)
+ best_installable = best_not_installed;
for (std::set<RepositoryName, RepositoryNameComparator>::const_iterator r(repos.begin()), r_end(repos.end()) ;
r != r_end ; ++r)