aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-22 04:35:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-22 04:35:22 +0000
commitd0dbaa56f85163971704047667792756fe9c33e7 (patch)
tree40fb97f6b3beb1e1dfa0d7822ef1d513d3633125
parent3ef8b4de9b51e30c517202c7b6179c6b40dfa849 (diff)
downloadpaludis-d0dbaa56f85163971704047667792756fe9c33e7.tar.gz
paludis-d0dbaa56f85163971704047667792756fe9c33e7.tar.xz
Prefer visible packages over masked packages for --query metadata selection. Fixes: Berlios#8848.
-rw-r--r--src/paludis/query.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/paludis/query.cc b/src/paludis/query.cc
index d0ce74e..c0386d8 100644
--- a/src/paludis/query.cc
+++ b/src/paludis/query.cc
@@ -43,6 +43,8 @@ void do_one_package_query(
MaskReasons & mask_reasons_to_explain,
PackageDepAtom::Pointer atom)
{
+ /* prefer the best installed version, then the best visible version, then
+ * the best version */
PackageDatabaseEntryCollection::ConstPointer
entries(env->package_database()->query(atom, is_either)),
preferred_entries(env->package_database()->query(atom, is_installed_only));
@@ -51,7 +53,11 @@ void do_one_package_query(
if (preferred_entries->empty())
preferred_entries = entries;
- const PackageDatabaseEntry display_entry(*preferred_entries->last());
+ PackageDatabaseEntry display_entry(*preferred_entries->last());
+ for (PackageDatabaseEntryCollection::Iterator i(preferred_entries->begin()),
+ i_end(preferred_entries->end()) ; i != i_end ; ++i)
+ if (! env->mask_reasons(*i).any())
+ display_entry = *i;
/* match! display it. */
cout << "* " << colour(cl_package_name, entries->begin()->name);