aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-26 13:59:35 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-26 13:59:35 +0000
commitf4ae26ad23992b74c86d6c6a5054d1e0a8d4ae6b (patch)
tree84b2f8d3ff2ba1ad20a6aef81d0cb09c678c678b
parent575fb3bc3a760799efbea3fab4d41f361299fe5f (diff)
downloadpaludis-f4ae26ad23992b74c86d6c6a5054d1e0a8d4ae6b.tar.gz
paludis-f4ae26ad23992b74c86d6c6a5054d1e0a8d4ae6b.tar.xz
Load HOMEPAGE, DESCRIPTION from vdb repo. When handling --query, prefer installed packages to uninstalled packages regardless of version.
-rw-r--r--paludis/vdb_repository.cc20
-rw-r--r--src/query.cc13
2 files changed, 20 insertions, 13 deletions
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index 80eca26..b7ad45b 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -311,15 +311,17 @@ Implementation<VDBRepository>::load_entry(std::vector<VDBEntry>::iterator p) con
+ "-" + stringify(p->version) + "' from '" + stringify(location) + "':");
p->metadata = VersionMetadata::Pointer(new VersionMetadata);
- p->metadata->set(vmk_depend, file_contents(location, p->name, p->version, "DEPEND"));
- p->metadata->set(vmk_rdepend, file_contents(location, p->name, p->version, "RDEPEND"));
- p->metadata->set(vmk_license, file_contents(location, p->name, p->version, "LICENSE"));
- p->metadata->set(vmk_keywords, "*");
- p->metadata->set(vmk_inherited, file_contents(location, p->name, p->version, "INHERITED"));
- p->metadata->set(vmk_iuse, file_contents(location, p->name, p->version, "IUSE"));
- p->metadata->set(vmk_pdepend, file_contents(location, p->name, p->version, "PDEPEND"));
- p->metadata->set(vmk_provide, file_contents(location, p->name, p->version, "PROVIDE"));
- p->metadata->set(vmk_eapi, file_contents(location, p->name, p->version, "EAPI"));
+ p->metadata->set(vmk_depend, file_contents(location, p->name, p->version, "DEPEND"));
+ p->metadata->set(vmk_rdepend, file_contents(location, p->name, p->version, "RDEPEND"));
+ p->metadata->set(vmk_license, file_contents(location, p->name, p->version, "LICENSE"));
+ p->metadata->set(vmk_keywords, "*");
+ p->metadata->set(vmk_inherited, file_contents(location, p->name, p->version, "INHERITED"));
+ p->metadata->set(vmk_iuse, file_contents(location, p->name, p->version, "IUSE"));
+ p->metadata->set(vmk_pdepend, file_contents(location, p->name, p->version, "PDEPEND"));
+ p->metadata->set(vmk_provide, file_contents(location, p->name, p->version, "PROVIDE"));
+ p->metadata->set(vmk_eapi, file_contents(location, p->name, p->version, "EAPI"));
+ p->metadata->set(vmk_homepage, file_contents(location, p->name, p->version, "HOMEPAGE"));
+ p->metadata->set(vmk_description, file_contents(location, p->name, p->version, "DESCRIPTION"));
std::string slot(file_contents(location, p->name, p->version, "SLOT"));
if (slot.empty())
diff --git a/src/query.cc b/src/query.cc
index 6acdef9..a80b22d 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -47,10 +47,15 @@ void do_one_query(
p::PackageNamePart(q))) :
new p::PackageDepAtom(q));
- p::PackageDatabaseEntryCollection::ConstPointer entries(env->package_database()->query(
- atom, p::is_either));
+ p::PackageDatabaseEntryCollection::ConstPointer
+ entries(env->package_database()->query(atom, p::is_either)),
+ preferred_entries(env->package_database()->query(atom, p::is_installed_only));
if (entries->empty())
throw p::NoSuchPackageError(q);
+ if (preferred_entries->empty())
+ preferred_entries = entries;
+
+ const p::PackageDatabaseEntry display_entry(*preferred_entries->last());
/* match! display it. */
cout << "* " << colour(cl_package_name, entries->begin()->get<p::pde_name>());
@@ -112,7 +117,7 @@ void do_one_query(
}
/// \todo ^^ text description of masks
- if (e == entries->last())
+ if (*e == display_entry)
cout << "*";
cout << " ";
}
@@ -125,7 +130,7 @@ void do_one_query(
}
/* display metadata */
- p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(*entries->last()));
+ p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(display_entry));
if (CommandLine::get_instance()->a_show_metadata.specified())
{