aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 22:57:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 22:57:56 +0000
commitd52fbd642f04e6c89d601891f9195367ce0723a6 (patch)
treee50cb5ec337a72a65608eea4b6911814461a8e0c
parente1e7f5f089748c8ce72446cf8f69b80fa2992400 (diff)
downloadpaludis-d52fbd642f04e6c89d601891f9195367ce0723a6.tar.gz
paludis-d52fbd642f04e6c89d601891f9195367ce0723a6.tar.xz
db -> database
-rw-r--r--paludis/default_environment.cc10
-rw-r--r--paludis/dep_list.cc18
-rw-r--r--paludis/dep_list_TEST.cc48
-rw-r--r--paludis/environment.cc10
-rw-r--r--paludis/environment.hh12
-rw-r--r--src/install.cc8
-rw-r--r--src/list.cc4
-rw-r--r--src/query.cc10
8 files changed, 60 insertions, 60 deletions
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 34cfe10..453695c 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -42,7 +42,7 @@ DefaultEnvironment::DefaultEnvironment() :
throw DefaultConfigError("Unknown repository format '" + r->get<rce_format>() + "'");
Repository::Pointer repo(new PortageRepository(r->get<rce_location>(),
r->get<rce_profile>()));
- package_db()->add_repository(repo);
+ package_database()->add_repository(repo);
}
/// \bug vdb
@@ -104,7 +104,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
throw InternalError(PALUDIS_HERE, "bad state " + stringify(state));
} while (false);
- switch (package_db()->fetch_repository(e.get<pde_repository>())->query_use(f))
+ switch (package_database()->fetch_repository(e.get<pde_repository>())->query_use(f))
{
case use_disabled:
case use_unspecified:
@@ -134,7 +134,7 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
k_end(DefaultConfig::get_instance()->end_package_keywords(d->get<pde_name>())) ;
k != k_end ; ++k)
{
- if (! match_package(package_db(), k->first, d))
+ if (! match_package(package_database(), k->first, d))
continue;
result |= k->second == keyword;
@@ -156,7 +156,7 @@ DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
k_end(DefaultConfig::get_instance()->end_user_masks(d.get<pde_name>())) ;
k != k_end ; ++k)
{
- if (! match_package(package_db(), *k, d))
+ if (! match_package(package_database(), *k, d))
continue;
return true;
@@ -173,7 +173,7 @@ DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
k_end(DefaultConfig::get_instance()->end_user_unmasks(d.get<pde_name>())) ;
k != k_end ; ++k)
{
- if (! match_package(package_db(), *k, d))
+ if (! match_package(package_database(), *k, d))
continue;
return true;
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 9fedc51..11bfed3 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -206,13 +206,13 @@ DepList::visit(const PackageDepAtom * const p)
/* are we already installed? */
if ((! _implementation->ignore_installed) &&
- (! _implementation->environment->installed_db()->query(p)->empty()))
+ (! _implementation->environment->installed_database()->query(p)->empty()))
already_there = true;
/* will we be installed by this point? */
if ((! already_there) && (_implementation->merge_list.end() != std::find_if(
_implementation->merge_list.begin(), _implementation->merge_list.end(),
- DepListEntryMatcher(_implementation->environment->package_db().raw_pointer(), *p))))
+ DepListEntryMatcher(_implementation->environment->package_database().raw_pointer(), *p))))
return;
if (already_there && ((! _implementation->recursive_deps) || (_implementation->check_existing_only)))
@@ -230,7 +230,7 @@ DepList::visit(const PackageDepAtom * const p)
std::list<DepListEntry>::iterator i;
if (_implementation->pending_list.end() != ((i = std::find_if(
_implementation->pending_list.begin(), _implementation->pending_list.end(),
- DepListEntryMatcher(_implementation->environment->package_db().raw_pointer(), *p)))))
+ DepListEntryMatcher(_implementation->environment->package_database().raw_pointer(), *p)))))
{
std::list<std::string> entries;
entries.push_front(stringify(*p));
@@ -256,7 +256,7 @@ DepList::visit(const PackageDepAtom * const p)
/* find the matching package */
PackageDatabaseEntryCollection::Pointer matches(
- _implementation->environment->package_db()->query(p));
+ _implementation->environment->package_database()->query(p));
const PackageDatabaseEntry * match(0);
VersionMetadata::ConstPointer metadata(0);
@@ -267,7 +267,7 @@ DepList::visit(const PackageDepAtom * const p)
if (_implementation->environment->mask_reasons(*e).any())
continue;
- metadata = _implementation->environment->package_db()->fetch_metadata(*e);
+ metadata = _implementation->environment->package_database()->fetch_metadata(*e);
match = &*e;
break;
}
@@ -433,14 +433,14 @@ DepList::visit(const BlockDepAtom * const d)
std::list<DepListEntry>::const_iterator m;
/* are we already installed? */
- if (! ((q = _implementation->environment->installed_db()->query(d->blocked_atom())))->empty())
+ if (! ((q = _implementation->environment->installed_database()->query(d->blocked_atom())))->empty())
{
if (! _implementation->current_package)
throw BlockError("'" + stringify(*(d->blocked_atom())) + "' blocked by installed package '"
+ stringify(*q->begin()) + "'");
VersionMetadata::ConstPointer metadata(
- _implementation->environment->installed_db()->fetch_metadata(
+ _implementation->environment->installed_database()->fetch_metadata(
*_implementation->current_package));
if (metadata->end_provide() == std::find(
metadata->begin_provide(), metadata->end_provide(),
@@ -452,14 +452,14 @@ DepList::visit(const BlockDepAtom * const d)
/* will we be installed by this point? */
if (_implementation->merge_list.end() != ((m = std::find_if(
_implementation->merge_list.begin(), _implementation->merge_list.end(),
- DepListEntryMatcher(_implementation->environment->package_db().raw_pointer(),
+ DepListEntryMatcher(_implementation->environment->package_database().raw_pointer(),
*(d->blocked_atom()))))))
{
if (! _implementation->current_package)
throw BlockError("'" + stringify(*(d->blocked_atom())) + "' blocked by pending package '"
+ stringify(*m));
- VersionMetadata::ConstPointer metadata(_implementation->environment->package_db()->fetch_metadata(
+ VersionMetadata::ConstPointer metadata(_implementation->environment->package_database()->fetch_metadata(
*_implementation->current_package));
if (metadata->end_provide() == std::find(
metadata->begin_provide(), metadata->end_provide(),
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index b0a41d4..6775cc7 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -43,10 +43,10 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(RepositoryName("repo")));
repo->add_version(CategoryNamePart("t"), PackageNamePart("one"), VersionSpec("1.0"))->
set(vmk_slot, "slot1");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -75,12 +75,12 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(RepositoryName("repo")));
repo->add_version(CategoryNamePart("t"), PackageNamePart("one"), VersionSpec("1.0"))->
set(vmk_slot, "slot1");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
installed->add_version(CategoryNamePart("t"), PackageNamePart("one"), VersionSpec("0.9"))->
set(vmk_slot, "slot1");
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -111,10 +111,10 @@ namespace test_cases
repo->add_version(CategoryNamePart("t"), PackageNamePart("two"), VersionSpec("1.0"))->
set(vmk_slot, "slot2");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -154,10 +154,10 @@ namespace test_cases
repo->add_version(CategoryNamePart("t"), PackageNamePart("two"), VersionSpec("1.0"))->
set(vmk_slot, "slot2");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -201,10 +201,10 @@ namespace test_cases
repo->add_version(CategoryNamePart("t"), PackageNamePart("three"), VersionSpec("1.0"))->
set(vmk_slot, "slot3");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -265,10 +265,10 @@ namespace test_cases
set(vmk_slot, "slot3").
set(dep_kind, "t/bad");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
TEST_CHECK_THROWS(d.add(DepParser::parse("t/one")), Exception);
@@ -322,10 +322,10 @@ namespace test_cases
set(vmk_slot, "slot3").
set(vmk_depend, "t/two");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
TEST_CHECK_THROWS(d.add(DepParser::parse("t/one")), CircularDependencyError);
@@ -371,10 +371,10 @@ namespace test_cases
set(vmk_slot, "slot2").
set(vmk_depend, "t/two");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
TEST_CHECK_THROWS(d.add(DepParser::parse("t/one")), CircularDependencyError);
@@ -413,13 +413,13 @@ namespace test_cases
set(vmk_slot, "slot1").
set(vmk_depend, "|| ( t/two t/three )");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
installed->add_version(CategoryNamePart("t"), PackageNamePart("three"), VersionSpec("1.0"))->
set(vmk_slot, "slot2");
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -476,7 +476,7 @@ namespace test_cases
set(vmk_slot, "1").
set(vmk_depend, "|| ( ( t/two t/three ) ( t/four || ( t/five ( t/six t/seven ) ) ) )");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
@@ -497,7 +497,7 @@ namespace test_cases
installed->add_version(CategoryNamePart("t"), PackageNamePart("seven"), VersionSpec("1.0"));
}
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
@@ -552,7 +552,7 @@ namespace test_cases
set(vmk_slot, "1").
set(vmk_depend, "|| ( ( t/two t/three ) ( t/four || ( t/five ( t/six t/seven ) ) ) )");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
@@ -574,7 +574,7 @@ namespace test_cases
installed->add_version(CategoryNamePart("t"), PackageNamePart("seven"), VersionSpec("1.0"));
}
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
TEST_CHECK(d.begin() == d.end());
@@ -607,10 +607,10 @@ namespace test_cases
repo->add_version(CategoryNamePart("t"), PackageNamePart("three"), VersionSpec("1.0"))->
set(vmk_slot, "1");
- e.package_db()->add_repository(repo);
+ e.package_database()->add_repository(repo);
FakeRepository::Pointer installed(new FakeRepository(RepositoryName("installed")));
- e.installed_db()->add_repository(installed);
+ e.installed_database()->add_repository(installed);
DepList d(&e);
d.add(DepParser::parse("t/one"));
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 66b23d4c..68114b1 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -23,8 +23,8 @@
using namespace paludis;
Environment::Environment(PackageDatabase::Pointer d, PackageDatabase::Pointer i) :
- _package_db(d),
- _installed_db(i)
+ _package_database(d),
+ _installed_database(i)
{
}
@@ -36,7 +36,7 @@ MaskReasons
Environment::mask_reasons(const PackageDatabaseEntry & e) const
{
MaskReasons result;
- VersionMetadata::ConstPointer metadata(package_db()->fetch_metadata(e));
+ VersionMetadata::ConstPointer metadata(package_database()->fetch_metadata(e));
if (metadata->get(vmk_eapi) != "0" && metadata->get(vmk_eapi) != "")
result.set(mr_eapi);
@@ -57,11 +57,11 @@ Environment::mask_reasons(const PackageDatabaseEntry & e) const
if (query_user_masks(e))
result.set(mr_user_mask);
- if (package_db()->fetch_repository(e.get<pde_repository>())->query_profile_masks(e.get<pde_name>(),
+ if (package_database()->fetch_repository(e.get<pde_repository>())->query_profile_masks(e.get<pde_name>(),
e.get<pde_version>()))
result.set(mr_profile_mask);
- if (package_db()->fetch_repository(e.get<pde_repository>())->query_repository_masks(e.get<pde_name>(),
+ if (package_database()->fetch_repository(e.get<pde_repository>())->query_repository_masks(e.get<pde_name>(),
e.get<pde_version>()))
result.set(mr_repository_mask);
}
diff --git a/paludis/environment.hh b/paludis/environment.hh
index a004000..aa12176 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -46,8 +46,8 @@ namespace paludis
private InstantiationPolicy<Environment, instantiation_method::NonCopyableTag>
{
private:
- PackageDatabase::Pointer _package_db;
- PackageDatabase::Pointer _installed_db;
+ PackageDatabase::Pointer _package_database;
+ PackageDatabase::Pointer _installed_database;
protected:
/**
@@ -85,17 +85,17 @@ namespace paludis
/**
* Fetch our package database.
*/
- PackageDatabase::Pointer package_db() const
+ PackageDatabase::Pointer package_database() const
{
- return _package_db;
+ return _package_database;
}
/**
* Fetch our installed database.
*/
- PackageDatabase::Pointer installed_db() const
+ PackageDatabase::Pointer installed_database() const
{
- return _installed_db;
+ return _installed_database;
}
/**
diff --git a/src/install.cc b/src/install.cc
index cc39d83..e16ea3e 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -54,7 +54,7 @@ do_install()
targets->add_child(p::DepParser::parse(*q));
else if (std::string::npos == q->find('/'))
targets->add_child(p::DepAtom::Pointer(new p::PackageDepAtom(
- env->package_db()->fetch_unique_qualified_package_name(
+ env->package_database()->fetch_unique_qualified_package_name(
p::PackageNamePart(*q)))));
else
targets->add_child(p::DepAtom::Pointer(new p::PackageDepAtom(*q)));
@@ -91,7 +91,7 @@ do_install()
cout << "-" << dep->get<p::dle_version>();
/* display repository, unless it's our main repository */
- if (env->package_db()->favourite_repository() != dep->get<p::dle_repository>())
+ if (env->package_database()->favourite_repository() != dep->get<p::dle_repository>())
cout << "::" << dep->get<p::dle_repository>();
/* display slot name, unless it's 0 */
@@ -101,7 +101,7 @@ do_install()
/* fetch metadata */
p::PackageDatabaseEntry p(p::PackageDatabaseEntry(dep->get<p::dle_name>(),
dep->get<p::dle_version>(), dep->get<p::dle_repository>()));
- p::VersionMetadata::ConstPointer metadata(env->package_db()->fetch_metadata(p));
+ p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(p));
/* display USE flags */
for (p::VersionMetadata::IuseIterator i(metadata->begin_iuse()),
@@ -109,7 +109,7 @@ do_install()
{
if (env->query_use(*i, p))
cout << " " << colour(cl_flag_on, *i);
- else if (env->package_db()->fetch_repository(dep->get<p::dle_repository>())->query_use_mask(*i))
+ else if (env->package_database()->fetch_repository(dep->get<p::dle_repository>())->query_use_mask(*i))
cout << " " << colour(cl_flag_off, "(-" + p::stringify(*i) + ")");
else
cout << " " << colour(cl_flag_off, "-" + p::stringify(*i));
diff --git a/src/list.cc b/src/list.cc
index 51b60c6..c3c6230 100644
--- a/src/list.cc
+++ b/src/list.cc
@@ -35,7 +35,7 @@ do_list_repositories()
p::Environment * const env(p::DefaultEnvironment::get_instance());
for (p::IndirectIterator<p::PackageDatabase::RepositoryIterator, const p::Repository>
- r(env->package_db()->begin_repositories()), r_end(env->package_db()->end_repositories()) ;
+ r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
{
std::cout << "* " << colour(cl_package_name, r->name()) << std::endl;
@@ -59,7 +59,7 @@ do_list_categories()
std::map<p::CategoryNamePart, std::list<p::RepositoryName> > cats;
for (p::IndirectIterator<p::PackageDatabase::RepositoryIterator, const p::Repository>
- r(env->package_db()->begin_repositories()), r_end(env->package_db()->end_repositories()) ;
+ r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
{
p::CategoryNamePartCollection::ConstPointer cat_names(r->category_names());
diff --git a/src/query.cc b/src/query.cc
index 7c70e16..5410aa8 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -41,16 +41,16 @@ void do_one_query(
/* we might have a dep atom, but we might just have a simple package name
* without a category. either should work. */
p::PackageDepAtom::Pointer atom(std::string::npos == q.find('/') ?
- new p::PackageDepAtom(env->package_db()->fetch_unique_qualified_package_name(
+ new p::PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
p::PackageNamePart(q))) :
new p::PackageDepAtom(q));
- p::PackageDatabaseEntryCollection::ConstPointer entries(env->package_db()->query(atom));
+ p::PackageDatabaseEntryCollection::ConstPointer entries(env->package_database()->query(atom));
if (entries->empty())
throw p::NoSuchPackageError(q);
/* match! display it. */
- std::cout << "* " << colour(cl_package_name, entries->begin()->get<p::pde_package>());
+ std::cout << "* " << colour(cl_package_name, entries->begin()->get<p::pde_name>());
if (atom->version_spec_ptr())
std::cout << " (" << atom->version_operator() << *atom->version_spec_ptr() << ")";
std::cout << std::endl;
@@ -72,7 +72,7 @@ void do_one_query(
for (e = entries->begin() ; e != e_end ; ++e)
if (e->get<p::pde_repository>() == *r)
{
- p::VersionMetadata::ConstPointer metadata(env->package_db()->fetch_metadata(*e));
+ p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(*e));
if (CommandLine::get_instance()->a_show_slot.specified())
{
/* show the slot, if we're about to move onto a new slot */
@@ -118,7 +118,7 @@ void do_one_query(
}
/* display metadata */
- p::VersionMetadata::ConstPointer metadata(env->package_db()->fetch_metadata(*entries->last()));
+ p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(*entries->last()));
std::cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
" " << metadata->get(p::vmk_homepage) << std::endl;
std::cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<