aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-08 13:49:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-08 13:49:44 +0000
commit16ff1369105265ec6d8fcbebfbdb74f50338e908 (patch)
tree26b7048cbb478302542a29b4c8e97c9c04c0fc39
parentba9ae41ee7e6d6afd412bc2998b850b8f95d7cc9 (diff)
downloadpaludis-16ff1369105265ec6d8fcbebfbdb74f50338e908.tar.gz
paludis-16ff1369105265ec6d8fcbebfbdb74f50338e908.tar.xz
inquisitio --all-versions
-rw-r--r--NEWS6
-rw-r--r--src/clients/inquisitio/command_line.cc1
-rw-r--r--src/clients/inquisitio/command_line.hh1
-rw-r--r--src/clients/inquisitio/do_search.cc13
4 files changed, 16 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 700f132..1da09ea 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@ News for Paludis
This file lists the major changes between versions. For a more detailed list
of every change, see the ChangeLog.
+trunk/:
+ * STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
+ dep specs.
+
+ * inquisitio --all-versions.
+
0.26.0_alpha3:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
dep specs.
diff --git a/src/clients/inquisitio/command_line.cc b/src/clients/inquisitio/command_line.cc
index 048f8bd..e2493e4 100644
--- a/src/clients/inquisitio/command_line.cc
+++ b/src/clients/inquisitio/command_line.cc
@@ -65,6 +65,7 @@ CommandLine::CommandLine() :
a_package(&filter_args, "package", '\0', "Matches with this package name only",
paludis::args::StringSetArg::StringSetArgOptions(), &paludis::PackageNamePartValidator::validate),
a_visible_only(&filter_args, "visible-only", 'v', "Only consider visible packages"),
+ a_all_versions(&filter_args, "all-versions", 'a', "Check all versions, rather than only one (slower)"),
a_kind(&filter_args, "kind", 'K', "Packages of this kind only",
paludis::args::EnumArg::EnumArgOptions
("installable", "Installable packages")
diff --git a/src/clients/inquisitio/command_line.hh b/src/clients/inquisitio/command_line.hh
index 128ea2c..70988ce 100644
--- a/src/clients/inquisitio/command_line.hh
+++ b/src/clients/inquisitio/command_line.hh
@@ -86,6 +86,7 @@ class CommandLine :
paludis::args::StringSetArg a_category;
paludis::args::StringSetArg a_package;
paludis::args::SwitchArg a_visible_only;
+ paludis::args::SwitchArg a_all_versions;
paludis::args::EnumArg a_kind;
///\}
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index c2da1cb..2dd6030 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -113,7 +113,8 @@ namespace
const tr1::shared_ptr<const Repository> & r,
const QualifiedPackageName & q,
const tr1::function<bool (const PackageID &)> & e,
- const tr1::function<bool (const PackageID &)> & m)
+ const tr1::function<bool (const PackageID &)> & m,
+ const bool all_versions)
{
tr1::shared_ptr<const PackageIDSequence> ids(r->package_ids(q));
if (ids->empty())
@@ -130,7 +131,7 @@ namespace
{
if (m(**i))
return *i;
- else
+ else if (! all_versions)
return tr1::shared_ptr<const PackageID>();
}
@@ -143,13 +144,14 @@ namespace
const std::list<tr1::shared_ptr<const Repository> > & repos,
std::pair<const QualifiedPackageName, tr1::shared_ptr<const PackageID> > & q,
const tr1::function<bool (const PackageID &)> & e,
- const tr1::function<bool (const PackageID &)> & m)
+ const tr1::function<bool (const PackageID &)> & m,
+ const bool all_versions)
{
tr1::shared_ptr<const PackageID> best_id;
for (std::list<tr1::shared_ptr<const Repository> >::const_iterator r(repos.begin()), r_end(repos.end()) ;
r != r_end ; ++r)
{
- tr1::shared_ptr<const PackageID> id(fetch_id(env, *r, q.first, e, m));
+ tr1::shared_ptr<const PackageID> id(fetch_id(env, *r, q.first, e, m, all_versions));
if (id)
{
if (best_id)
@@ -272,7 +274,8 @@ do_search(const Environment & env)
extractors
);
- std::for_each(ids.begin(), ids.end(), tr1::bind(&set_id, tr1::cref(env), tr1::cref(repos), _1, eligible, matches));
+ std::for_each(ids.begin(), ids.end(), tr1::bind(&set_id, tr1::cref(env), tr1::cref(repos), _1, eligible, matches,
+ CommandLine::get_instance()->a_all_versions.specified()));
bool any(false);
InquisitioQueryTask task(&env);