aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-28 17:35:27 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-28 17:35:27 +0000
commit8f96a70ce9121ca86e9b15f42bfb7b1970cc4d5c (patch)
tree31afa973f64185f9d16595bd9a8379109cc3a491
parentd3d3a01010015d7563ad71176281b48d6dcd1dd3 (diff)
downloadpaludis-8f96a70ce9121ca86e9b15f42bfb7b1970cc4d5c.tar.gz
paludis-8f96a70ce9121ca86e9b15f42bfb7b1970cc4d5c.tar.xz
Be consistent in how we use Installable and Installed. is_uninstalled_only is now is_installable_only, and is_either is is_any.
-rw-r--r--paludis/dep_list/dep_list.cc4
-rw-r--r--paludis/package_database.cc10
-rw-r--r--paludis/package_database.hh4
-rw-r--r--paludis/package_database_TEST.cc16
-rw-r--r--paludis/qa/deps_exist_check.cc5
-rw-r--r--paludis/qa/deps_visible_check.cc2
-rw-r--r--paludis/repositories/portage/portage_repository_sets.cc4
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc2
-rw-r--r--paludis/tasks/report_task.cc2
-rw-r--r--ruby/package_database_TEST.rb10
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc2
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc6
-rw-r--r--src/clients/contrarius/install.cc2
-rw-r--r--src/clients/gtkpaludis/package_overview.cc2
-rw-r--r--src/clients/gtkpaludis/packages_list.cc2
-rw-r--r--src/clients/paludis/applets.cc2
-rw-r--r--src/clients/paludis/install.cc2
-rw-r--r--src/clients/paludis/query.cc2
18 files changed, 40 insertions, 39 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 14d1cb2..758d2a4 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -406,7 +406,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
/* find installable candidates, and find the best visible candidate */
const PackageDatabaseEntry * best_visible_candidate(0);
PackageDatabaseEntryCollection::ConstPointer installable_candidates(
- d->_imp->env->package_database()->query(*a, is_uninstalled_only));
+ d->_imp->env->package_database()->query(*a, is_installable_only));
for (PackageDatabaseEntryCollection::ReverseIterator p(installable_candidates->rbegin()),
p_end(installable_candidates->rend()) ; p != p_end ; ++p)
@@ -450,7 +450,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
if (already_installed->empty() || ! can_fall_back)
{
if (a->use_requirements_ptr() && d->_imp->env->package_database()->query(
- a->without_use_requirements(), is_either))
+ a->without_use_requirements(), is_any))
throw UseRequirementsNotMetError(stringify(*a));
else
throw AllMaskedError(stringify(*a));
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index fe69936..b28ee40 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -215,7 +215,7 @@ PackageDatabase::_do_query(const PackageDepAtom & a, const InstallState installe
if ((installed_state == is_installed_only) && ! r->installed_interface)
continue;
- if ((installed_state == is_uninstalled_only) && r->installed_interface)
+ if ((installed_state == is_installable_only) && ! r->installable_interface)
continue;
VersionSpecCollection::ConstPointer versions(r->version_specs(a.package()));
@@ -310,12 +310,12 @@ paludis::operator<< (std::ostream & o, const InstallState & s)
o << "installed_only";
continue;
- case is_uninstalled_only:
- o << "uninstalled_only";
+ case is_installable_only:
+ o << "installable_only";
continue;
- case is_either:
- o << "either";
+ case is_any:
+ o << "any";
continue;
case last_install_state:
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index b6174d1..67f474f 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -204,8 +204,8 @@ namespace paludis
enum InstallState
{
is_installed_only, ///< Installed only
- is_uninstalled_only, ///< Uninstalled only
- is_either, ///< Either
+ is_installable_only, ///< Installable only
+ is_any, ///< Either
last_install_state
};
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index fe71f8f..568b22c 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -118,35 +118,35 @@ namespace test_cases
TEST_CHECK(true);
PackageDepAtom d1("r1c1/r1c1p1");
- const PackageDatabaseEntryCollection::Pointer q1(p.query(d1, is_either));
+ const PackageDatabaseEntryCollection::Pointer q1(p.query(d1, is_any));
TEST_CHECK_EQUAL(q1->size(), 1);
PackageDepAtom d2("r1c1/r1c1p2");
- const PackageDatabaseEntryCollection::Pointer q2(p.query(d2, is_either));
+ const PackageDatabaseEntryCollection::Pointer q2(p.query(d2, is_any));
TEST_CHECK_EQUAL(q2->size(), 2);
PackageDepAtom d3(">=r1c1/r1c1p2-1");
- const PackageDatabaseEntryCollection::Pointer q3(p.query(d3, is_either));
+ const PackageDatabaseEntryCollection::Pointer q3(p.query(d3, is_any));
TEST_CHECK_EQUAL(q3->size(), 2);
PackageDepAtom d4(">=r1c1/r1c1p2-2");
- const PackageDatabaseEntryCollection::Pointer q4(p.query(d4, is_either));
+ const PackageDatabaseEntryCollection::Pointer q4(p.query(d4, is_any));
TEST_CHECK_EQUAL(q4->size(), 1);
PackageDepAtom d5(">=r1c1/r1c1p2-3");
- const PackageDatabaseEntryCollection::Pointer q5(p.query(d5, is_either));
+ const PackageDatabaseEntryCollection::Pointer q5(p.query(d5, is_any));
TEST_CHECK_EQUAL(q5->size(), 0);
PackageDepAtom d6("<r1c1/r1c1p2-3");
- const PackageDatabaseEntryCollection::Pointer q6(p.query(d6, is_either));
+ const PackageDatabaseEntryCollection::Pointer q6(p.query(d6, is_any));
TEST_CHECK_EQUAL(q6->size(), 2);
PackageDepAtom d7("rac1/rac1pa");
- const PackageDatabaseEntryCollection::Pointer q7(p.query(d7, is_either));
+ const PackageDatabaseEntryCollection::Pointer q7(p.query(d7, is_any));
TEST_CHECK_EQUAL(q7->size(), 4);
PackageDepAtom d8("foo/bar");
- const PackageDatabaseEntryCollection::Pointer q8(p.query(d8, is_either));
+ const PackageDatabaseEntryCollection::Pointer q8(p.query(d8, is_any));
TEST_CHECK_EQUAL(q8->size(), 0);
}
} package_database_query_test;
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index cfb8aa7..4bc034e 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -47,7 +47,8 @@ namespace
void visit(const PackageDepAtom * const p)
{
- if (env->package_database()->query(PackageDepAtom::Pointer(new PackageDepAtom(p->package())), is_either)->empty())
+ if (env->package_database()->query(PackageDepAtom::Pointer(
+ new PackageDepAtom(p->package())), is_any)->empty())
{
if (in_any)
result << Message(qal_maybe, "No match for " + role + " entry '"
@@ -77,7 +78,7 @@ namespace
void visit(const BlockDepAtom * const b)
{
- if (env->package_database()->query(b->blocked_atom(), is_either)->empty())
+ if (env->package_database()->query(b->blocked_atom(), is_any)->empty())
result << Message(qal_maybe, "No match for " + role + " block '!"
+ stringify(*b->blocked_atom()) + "'");
}
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index c6393e7..896264b 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -99,7 +99,7 @@ namespace
bool found(false);
std::string candidates;
PackageDatabaseEntryCollection::Pointer matches(env->package_database()->query(
- *p, is_either));
+ *p, is_any));
for (PackageDatabaseEntryCollection::ReverseIterator m(matches->rbegin()),
m_end(matches->rend()) ; m != m_end ; ++m)
{
diff --git a/paludis/repositories/portage/portage_repository_sets.cc b/paludis/repositories/portage/portage_repository_sets.cc
index ba9c2f3..8d28aad 100644
--- a/paludis/repositories/portage/portage_repository_sets.cc
+++ b/paludis/repositories/portage/portage_repository_sets.cc
@@ -297,7 +297,7 @@ PortageRepositorySets::security_set(bool insecurity) const
{
PackageDatabaseEntryCollection::ConstPointer candidates(_imp->environment->package_database()->query(
PackageDepAtom::Pointer(new PackageDepAtom(stringify(glsa_pkg->name()))),
- insecurity ? is_either : is_installed_only));
+ insecurity ? is_any : is_installed_only));
for (PackageDatabaseEntryCollection::Iterator c(candidates->begin()), c_end(candidates->end()) ;
c != c_end ; ++c)
{
@@ -326,7 +326,7 @@ PortageRepositorySets::security_set(bool insecurity) const
PackageDatabaseEntryCollection::ConstPointer available(
_imp->environment->package_database()->query(PackageDepAtom::Pointer(
- new PackageDepAtom(stringify(glsa_pkg->name()))), is_uninstalled_only));
+ new PackageDepAtom(stringify(glsa_pkg->name()))), is_installable_only));
for (PackageDatabaseEntryCollection::ReverseIterator r(available->rbegin()),
r_end(available->rend()) ; r != r_end ; ++r)
{
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 49175fa..bc198f6 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -172,7 +172,7 @@ VirtualsRepository::need_entries() const
v(_imp->names.begin()), v_end(_imp->names.end()) ; v != v_end ; ++v)
{
PackageDatabaseEntryCollection::ConstPointer matches(_imp->env->package_database()->query(v->second,
- is_uninstalled_only));
+ is_installable_only));
if (matches->empty())
Log::get_instance()->message(ll_warning, lc_context, "No packages matching '"
diff --git a/paludis/tasks/report_task.cc b/paludis/tasks/report_task.cc
index 7e2cd8b..62bac98 100644
--- a/paludis/tasks/report_task.cc
+++ b/paludis/tasks/report_task.cc
@@ -95,7 +95,7 @@ namespace
VulnerableChecker::visit(const PackageDepAtom * const a)
{
PackageDatabaseEntryCollection::ConstPointer insecure(
- _env.package_database()->query(*a, is_either));
+ _env.package_database()->query(*a, is_any));
for (PackageDatabaseEntryCollection::Iterator i(insecure->begin()),
i_end(insecure->end()) ; i != i_end ; ++i)
if (a->tag())
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index 8aafd97..daa92fe 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -65,18 +65,18 @@ module Paludis
end
def test_package_database_query
- a = db.query("=foo/bar-1.0", InstallState::UninstalledOnly)
+ a = db.query("=foo/bar-1.0", InstallState::InstallableOnly)
assert_equal a, [ PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo") ]
- a = db.query(PackageDepAtom.new("=foo/bar-1.0"), InstallState::Either)
+ a = db.query(PackageDepAtom.new("=foo/bar-1.0"), InstallState::Any)
assert_equal a, [ PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo") ]
- a = db.query("foo/bar", InstallState::UninstalledOnly)
+ a = db.query("foo/bar", InstallState::InstallableOnly)
assert_equal a, [
PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo"),
PackageDatabaseEntry.new("foo/bar", "2.0", "testrepo") ]
- a = db.query(">=foo/bar-27", InstallState::UninstalledOnly)
+ a = db.query(">=foo/bar-27", InstallState::InstallableOnly)
assert a.empty?
a = db.query("foo/bar", InstallState::InstalledOnly)
@@ -85,7 +85,7 @@ module Paludis
def test_package_database_query_bad
assert_raise TypeError do
- db.query(123, InstallState::Either)
+ db.query(123, InstallState::Any)
end
assert_raise TypeError do
db.query(PackageDepAtom.new("foo/bar"), "Either")
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 9cb5b53..7067963 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -90,7 +90,7 @@ namespace
void visit(const PackageDepAtom * const a)
{
PackageDatabaseEntryCollection::ConstPointer insecure(
- _env.package_database()->query(*a, is_either));
+ _env.package_database()->query(*a, is_any));
for (PackageDatabaseEntryCollection::Iterator i(insecure->begin()),
i_end(insecure->end()) ; i != i_end ; ++i)
if (a->tag())
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index c7fe91c..13b35cf 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -121,7 +121,7 @@ namespace
void
ReverseDepChecker::visit(const PackageDepAtom * const a)
{
- PackageDatabaseEntryCollection::ConstPointer dep_entries(_db->query(*a, is_either));
+ PackageDatabaseEntryCollection::ConstPointer dep_entries(_db->query(*a, is_any));
PackageDatabaseEntryCollection::Pointer matches(new PackageDatabaseEntryCollection::Concrete);
bool header_written = false;
@@ -181,7 +181,7 @@ namespace
Context context("When checking package '" + stringify(p) + "':");
PackageDatabaseEntryCollection::Pointer p_entries(env.package_database()->query(
- PackageDepAtom::Pointer(new PackageDepAtom(stringify(p))), is_either));
+ PackageDepAtom::Pointer(new PackageDepAtom(stringify(p))), is_any));
bool found_matches(false);
@@ -241,7 +241,7 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
return 4;
}
- PackageDatabaseEntryCollection::Pointer entries(env.package_database()->query(atom, is_either));
+ PackageDatabaseEntryCollection::Pointer entries(env.package_database()->query(atom, is_any));
int ret(0);
if (entries->empty())
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 8fe984d..42c5e03 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -267,7 +267,7 @@ do_install(PackageDepAtom::ConstPointer atom)
PackageDatabaseEntryCollection::ConstPointer p(
DefaultEnvironment::get_instance()->package_database()->query(
PackageDepAtom::ConstPointer(new PackageDepAtom(e.query())),
- is_uninstalled_only));
+ is_installable_only));
if (p->empty())
{
cout << endl;
diff --git a/src/clients/gtkpaludis/package_overview.cc b/src/clients/gtkpaludis/package_overview.cc
index be00d8a..172810d 100644
--- a/src/clients/gtkpaludis/package_overview.cc
+++ b/src/clients/gtkpaludis/package_overview.cc
@@ -167,7 +167,7 @@ namespace
PackageDepAtom::Pointer atom(new PackageDepAtom(stringify(_pkg)));
PackageDatabaseEntryCollection::ConstPointer
- entries(DefaultEnvironment::get_instance()->package_database()->query(atom, is_either)),
+ entries(DefaultEnvironment::get_instance()->package_database()->query(atom, is_any)),
preferred_entries(DefaultEnvironment::get_instance()->package_database()->query(atom, is_installed_only));
if (preferred_entries->empty())
preferred_entries = entries;
diff --git a/src/clients/gtkpaludis/packages_list.cc b/src/clients/gtkpaludis/packages_list.cc
index 319df52..99db010 100644
--- a/src/clients/gtkpaludis/packages_list.cc
+++ b/src/clients/gtkpaludis/packages_list.cc
@@ -165,7 +165,7 @@ namespace
{
is_installed = false;
results = DefaultEnvironment::get_instance()->package_database()->query(
- PackageDepAtom::Pointer(new PackageDepAtom(stringify(i->first))), is_either);
+ PackageDepAtom::Pointer(new PackageDepAtom(stringify(i->first))), is_any);
}
if (results->empty())
continue;
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index e75ca9e..d039e8e 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -115,7 +115,7 @@ int do_environment_variable()
atom, is_installed_only));
if (entries->empty())
- entries = env->package_database()->query(atom, is_uninstalled_only);
+ entries = env->package_database()->query(atom, is_any);
if (entries->empty())
throw NoSuchPackageError(atom_str);
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 4ab4d53..951f04f 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -367,7 +367,7 @@ do_install()
PackageDatabaseEntryCollection::ConstPointer p(
DefaultEnvironment::get_instance()->package_database()->query(
PackageDepAtom::ConstPointer(new PackageDepAtom(e.query())),
- is_uninstalled_only));
+ is_installable_only));
if (p->empty())
{
cout << endl;
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index f60a884..75ad564 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -47,7 +47,7 @@ void do_one_package_query(
/* prefer the best installed version, then the best visible version, then
* the best version */
PackageDatabaseEntryCollection::ConstPointer
- entries(env->package_database()->query(atom, is_either)),
+ entries(env->package_database()->query(atom, is_any)),
preferred_entries(env->package_database()->query(atom, is_installed_only));
if (entries->empty())
throw NoSuchPackageError(q);