aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-07 09:35:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-07 09:35:20 +0000
commitd065ddde851601ad1784d626ac649e28ec3912a0 (patch)
tree6b695b1758bcdcd05fdfb837656197829d9a0a77
parent8ef98225e34c43856287e1ff5bba67bfa473c637 (diff)
downloadpaludis-d065ddde851601ad1784d626ac649e28ec3912a0.tar.gz
paludis-d065ddde851601ad1784d626ac649e28ec3912a0.tar.xz
_implementation -> _imp
-rw-r--r--paludis/dep_list.cc198
-rw-r--r--paludis/fake_repository.cc34
-rw-r--r--paludis/package_database.cc30
-rw-r--r--paludis/portage_repository.cc156
-rw-r--r--paludis/util/log.cc18
-rw-r--r--paludis/util/private_implementation_pattern.hh4
-rw-r--r--paludis/version_metadata.cc30
-rw-r--r--paludis/version_spec.cc134
8 files changed, 302 insertions, 302 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index b17bce1..ce2fe18 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -151,38 +151,38 @@ DepList::~DepList()
void
DepList::add(DepAtom::ConstPointer atom)
{
- std::list<DepListEntry> save_merge_list(_implementation->merge_list.begin(),
- _implementation->merge_list.end());
+ std::list<DepListEntry> save_merge_list(_imp->merge_list.begin(),
+ _imp->merge_list.end());
- _implementation->merge_list_insert_pos = _implementation->merge_list.end();
+ _imp->merge_list_insert_pos = _imp->merge_list.end();
_add(atom);
try
{
- std::list<DepListEntry>::iterator i(_implementation->merge_list.begin());
- _implementation->merge_list_insert_pos = _implementation->merge_list.end();
- while (i != _implementation->merge_list.end())
+ std::list<DepListEntry>::iterator i(_imp->merge_list.begin());
+ _imp->merge_list_insert_pos = _imp->merge_list.end();
+ while (i != _imp->merge_list.end())
{
- if (! i->get<dle_has_predeps>() && ! _implementation->drop_all)
+ if (! i->get<dle_has_predeps>() && ! _imp->drop_all)
throw InternalError(PALUDIS_HERE, "dle_has_predeps not set for " + stringify(*i));
- else if (! i->get<dle_has_trypredeps>() && ! _implementation->drop_all)
+ else if (! i->get<dle_has_trypredeps>() && ! _imp->drop_all)
{
Save<const DepListEntry *> save_current_package(
- &_implementation->current_package, &*i);
+ &_imp->current_package, &*i);
_add_in_role(DepParser::parse(
- _implementation->environment->package_database()->fetch_metadata(
+ _imp->environment->package_database()->fetch_metadata(
PackageDatabaseEntry(i->get<dle_name>(), i->get<dle_version>(),
i->get<dle_repository>()))->get(vmk_rdepend)), "RDEPEND");
i->set<dle_has_trypredeps>(true);
}
- else if (! i->get<dle_has_postdeps>() && ! _implementation->drop_all)
+ else if (! i->get<dle_has_postdeps>() && ! _imp->drop_all)
{
Save<const DepListEntry *> save_current_package(
- &_implementation->current_package, &*i);
+ &_imp->current_package, &*i);
_add_in_role(DepParser::parse(
- _implementation->environment->package_database()->fetch_metadata(
+ _imp->environment->package_database()->fetch_metadata(
PackageDatabaseEntry(i->get<dle_name>(), i->get<dle_version>(),
i->get<dle_repository>()))->get(vmk_pdepend)), "PDEPEND");
i->set<dle_has_postdeps>(true);
@@ -193,7 +193,7 @@ DepList::add(DepAtom::ConstPointer atom)
}
catch (...)
{
- _implementation->merge_list.swap(save_merge_list);
+ _imp->merge_list.swap(save_merge_list);
throw;
}
}
@@ -203,30 +203,30 @@ DepList::_add_raw(const DepAtom * const atom)
{
#if 0
/// \bug VV this is debug code. remove it once we're sure this works
- std::list<DepListEntry> backup_merge_list(_implementation->merge_list.begin(),
- _implementation->merge_list.end());
+ std::list<DepListEntry> backup_merge_list(_imp->merge_list.begin(),
+ _imp->merge_list.end());
#endif
/* keep track of stack depth */
- Save<int> old_stack_depth(&_implementation->stack_depth,
- _implementation->stack_depth + 1);
- if (_implementation->stack_depth > _implementation->max_stack_depth)
- throw DepListStackTooDeepError(_implementation->stack_depth);
+ Save<int> old_stack_depth(&_imp->stack_depth,
+ _imp->stack_depth + 1);
+ if (_imp->stack_depth > _imp->max_stack_depth)
+ throw DepListStackTooDeepError(_imp->stack_depth);
/* we need to make sure that merge_list doesn't get h0rked in the
* event of a failure. */
- bool merge_list_was_empty(_implementation->merge_list.empty()), irange_begin_is_begin(false);
+ bool merge_list_was_empty(_imp->merge_list.empty()), irange_begin_is_begin(false);
std::list<DepListEntry>::iterator save_last, save_first, save_irange_begin, save_irange_end;
if (! merge_list_was_empty)
{
- save_first = _implementation->merge_list.begin();
- save_last = previous(_implementation->merge_list.end());
+ save_first = _imp->merge_list.begin();
+ save_last = previous(_imp->merge_list.end());
- save_irange_end = _implementation->merge_list_insert_pos;
- if (_implementation->merge_list_insert_pos == _implementation->merge_list.begin())
+ save_irange_end = _imp->merge_list_insert_pos;
+ if (_imp->merge_list_insert_pos == _imp->merge_list.begin())
irange_begin_is_begin = true;
else
- save_irange_begin = previous(_implementation->merge_list_insert_pos);
+ save_irange_begin = previous(_imp->merge_list_insert_pos);
}
try
@@ -240,24 +240,24 @@ DepList::_add_raw(const DepAtom * const atom)
catch (...)
{
if (merge_list_was_empty)
- _implementation->merge_list.clear();
+ _imp->merge_list.clear();
else
{
- _implementation->merge_list.erase(next(save_last), _implementation->merge_list.end());
- _implementation->merge_list.erase(_implementation->merge_list.begin(), save_first);
- _implementation->merge_list.erase(
- irange_begin_is_begin ? _implementation->merge_list.begin() : next(save_irange_begin),
+ _imp->merge_list.erase(next(save_last), _imp->merge_list.end());
+ _imp->merge_list.erase(_imp->merge_list.begin(), save_first);
+ _imp->merge_list.erase(
+ irange_begin_is_begin ? _imp->merge_list.begin() : next(save_irange_begin),
save_irange_end);
}
#if 0
/// \bug VV this is debug code. remove it once we're sure this works
- if (backup_merge_list != _implementation->merge_list)
+ if (backup_merge_list != _imp->merge_list)
{
Log::get_instance()->message(ll_warning, "Old merge_list: " + join(backup_merge_list.begin(),
backup_merge_list.end(), " -> "));
- Log::get_instance()->message(ll_warning, "New merge_list: " + join(_implementation->merge_list.begin(),
- _implementation->merge_list.end(), " -> "));
+ Log::get_instance()->message(ll_warning, "New merge_list: " + join(_imp->merge_list.begin(),
+ _imp->merge_list.end(), " -> "));
throw InternalError(PALUDIS_HERE, "merge list restore failed");
}
#endif
@@ -275,13 +275,13 @@ DepList::_add_in_role_raw(const DepAtom * const atom, const std::string & role)
DepList::Iterator
DepList::begin() const
{
- return _implementation->merge_list.begin();
+ return _imp->merge_list.begin();
}
DepList::Iterator
DepList::end() const
{
- return _implementation->merge_list.end();
+ return _imp->merge_list.end();
}
void
@@ -320,20 +320,20 @@ DepList::visit(const PackageDepAtom * const p)
/* are we already there? */
std::list<DepListEntry>::iterator i;
- if (_implementation->merge_list.end() != ((i = std::find_if(
- _implementation->merge_list.begin(),
- _implementation->merge_list.end(),
+ if (_imp->merge_list.end() != ((i = std::find_if(
+ _imp->merge_list.begin(),
+ _imp->merge_list.end(),
DepListEntryMatcher(
- _implementation->environment->package_database().raw_pointer(), *p)))))
+ _imp->environment->package_database().raw_pointer(), *p)))))
{
/* what's our status? */
if (! i->get<dle_has_predeps>())
{
- if (_implementation->drop_circular)
+ if (_imp->drop_circular)
return;
- else if (_implementation->merge_list_insert_pos == i && (
- _implementation->drop_self_circular || (
- ! _implementation->dont_ignore_patch_dep && p->package() ==
+ else if (_imp->merge_list_insert_pos == i && (
+ _imp->drop_self_circular || (
+ ! _imp->dont_ignore_patch_dep && p->package() ==
QualifiedPackageName("sys-devel/patch"))))
return;
else
@@ -344,9 +344,9 @@ DepList::visit(const PackageDepAtom * const p)
}
/* are we allowed to install things? */
- if (_implementation->check_existing_only)
+ if (_imp->check_existing_only)
{
- _implementation->match_found = false;
+ _imp->match_found = false;
return;
}
@@ -355,15 +355,15 @@ DepList::visit(const PackageDepAtom * const p)
VersionMetadata::ConstPointer metadata(0);
PackageDatabaseEntryCollection::Pointer matches(0);
- matches = _implementation->environment->package_database()->query(p);
+ matches = _imp->environment->package_database()->query(p);
for (PackageDatabaseEntryCollection::ReverseIterator e(matches->rbegin()),
e_end(matches->rend()) ; e != e_end ; ++e)
{
/* check masks */
- if (_implementation->environment->mask_reasons(*e).any())
+ if (_imp->environment->mask_reasons(*e).any())
continue;
- metadata = _implementation->environment->package_database()->fetch_metadata(*e);
+ metadata = _imp->environment->package_database()->fetch_metadata(*e);
match = &*e;
break;
}
@@ -373,7 +373,7 @@ DepList::visit(const PackageDepAtom * const p)
/* make merge entry */
std::list<DepListEntry>::iterator merge_entry(
- _implementation->merge_list.insert(_implementation->merge_list_insert_pos,
+ _imp->merge_list.insert(_imp->merge_list_insert_pos,
DepListEntry(match->get<pde_name>(), match->get<pde_version>(),
metadata, match->get<pde_repository>(),
false, false, false)));
@@ -386,28 +386,28 @@ DepList::visit(const PackageDepAtom * const p)
CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag> e(0);
- if (_implementation->current_package)
+ if (_imp->current_package)
e = CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag>(
new PackageDatabaseEntry(
- _implementation->current_package->get<dle_name>(),
- _implementation->current_package->get<dle_version>(),
- _implementation->current_package->get<dle_repository>()));
+ _imp->current_package->get<dle_name>(),
+ _imp->current_package->get<dle_version>(),
+ _imp->current_package->get<dle_repository>()));
- DepAtomFlattener f(_implementation->environment, e.raw_pointer(), provide);
+ DepAtomFlattener f(_imp->environment, e.raw_pointer(), provide);
for (DepAtomFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
{
PackageDepAtom pp(QualifiedPackageName((*p)->text()));
- if (_implementation->merge_list.end() != std::find_if(
- _implementation->merge_list.begin(), _implementation->merge_list.end(),
+ if (_imp->merge_list.end() != std::find_if(
+ _imp->merge_list.begin(), _imp->merge_list.end(),
DepListEntryMatcher(
- _implementation->environment->package_database().raw_pointer(), pp)))
+ _imp->environment->package_database().raw_pointer(), pp)))
continue;
VersionMetadata::Pointer p_metadata(new VersionMetadata);
p_metadata->set(vmk_slot, merge_entry->get<dle_metadata>()->get(vmk_slot));
p_metadata->set(vmk_virtual, stringify(merge_entry->get<dle_name>()));
- _implementation->merge_list.insert(next(merge_entry),
+ _imp->merge_list.insert(next(merge_entry),
DepListEntry(pp.package(), merge_entry->get<dle_version>(),
p_metadata, merge_entry->get<dle_repository>(), true, true, true));
}
@@ -415,25 +415,25 @@ DepList::visit(const PackageDepAtom * const p)
Save<std::list<DepListEntry>::iterator> old_merge_list_insert_pos(
- &_implementation->merge_list_insert_pos, merge_entry);
+ &_imp->merge_list_insert_pos, merge_entry);
context.change_context("When resolving package dependency '" + stringify(*p) +
"' -> '" + stringify(*merge_entry) + "':");
/* new current package */
- Save<const DepListEntry *> old_current_package(&_implementation->current_package,
+ Save<const DepListEntry *> old_current_package(&_imp->current_package,
&*merge_entry);
/* merge depends */
- if ((! merge_entry->get<dle_has_predeps>()) && ! (_implementation->drop_all))
+ if ((! merge_entry->get<dle_has_predeps>()) && ! (_imp->drop_all))
{
_add_in_role(DepParser::parse(metadata->get(vmk_depend)), "DEPEND");
merge_entry->set<dle_has_predeps>(true);
}
/* merge rdepends */
- if (! merge_entry->get<dle_has_trypredeps>() && dlro_always != _implementation->rdepend_post
- && ! _implementation->drop_all)
+ if (! merge_entry->get<dle_has_trypredeps>() && dlro_always != _imp->rdepend_post
+ && ! _imp->drop_all)
{
try
{
@@ -442,7 +442,7 @@ DepList::visit(const PackageDepAtom * const p)
}
catch (const CircularDependencyError &)
{
- if (dlro_never == _implementation->rdepend_post)
+ if (dlro_never == _imp->rdepend_post)
throw;
}
}
@@ -453,14 +453,14 @@ DepList::visit(const UseDepAtom * const u)
{
CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag> e(0);
- if (_implementation->current_package)
+ if (_imp->current_package)
e = CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag>(
new PackageDatabaseEntry(
- _implementation->current_package->get<dle_name>(),
- _implementation->current_package->get<dle_version>(),
- _implementation->current_package->get<dle_repository>()));
+ _imp->current_package->get<dle_name>(),
+ _imp->current_package->get<dle_version>(),
+ _imp->current_package->get<dle_repository>()));
- if (_implementation->environment->query_use(u->flag(), e.raw_pointer()) ^ u->inverse())
+ if (_imp->environment->query_use(u->flag(), e.raw_pointer()) ^ u->inverse())
std::for_each(u->begin(), u->end(), std::bind1st(std::mem_fun(&DepList::_add), this));
}
@@ -510,12 +510,12 @@ DepList::visit(const AnyDepAtom * const a)
std::list<DepAtom::ConstPointer> viable_children;
std::copy(a->begin(), a->end(), filter_inserter(
- std::back_inserter(viable_children), IsViable(*_implementation)));
+ std::back_inserter(viable_children), IsViable(*_imp)));
if (viable_children.empty())
{
- if (_implementation->current_package)
- Log::get_instance()->message(ll_qa, "Package '" + stringify(*_implementation->current_package)
+ if (_imp->current_package)
+ Log::get_instance()->message(ll_qa, "Package '" + stringify(*_imp->current_package)
+ "' has suspicious || ( ) block that resolves to empty");
return;
}
@@ -524,18 +524,18 @@ DepList::visit(const AnyDepAtom * const a)
for (std::list<DepAtom::ConstPointer>::iterator i(viable_children.begin()),
i_end(viable_children.end()) ; i != i_end ; ++i)
{
- Save<bool> save_check(&_implementation->check_existing_only, true);
- Save<bool> save_match(&_implementation->match_found, true);
+ Save<bool> save_check(&_imp->check_existing_only, true);
+ Save<bool> save_match(&_imp->match_found, true);
_add(*i);
- if ((found = _implementation->match_found))
+ if ((found = _imp->match_found))
break;
}
if (found)
return;
- if (_implementation->check_existing_only)
+ if (_imp->check_existing_only)
{
- _implementation->match_found = false;
+ _imp->match_found = false;
return;
}
@@ -576,39 +576,39 @@ DepList::visit(const BlockDepAtom * const d)
/* special case: foo/bar can DEPEND upon !foo/bar. */
/* will we be installed by this point? */
- std::list<DepListEntry>::iterator m(_implementation->merge_list.begin());
- while (m != _implementation->merge_list.end())
+ std::list<DepListEntry>::iterator m(_imp->merge_list.begin());
+ while (m != _imp->merge_list.end())
{
- if (_implementation->merge_list.end() != ((m = std::find_if(m, _implementation->merge_list.end(),
- DepListEntryMatcher(_implementation->environment->package_database().raw_pointer(),
+ if (_imp->merge_list.end() != ((m = std::find_if(m, _imp->merge_list.end(),
+ DepListEntryMatcher(_imp->environment->package_database().raw_pointer(),
*(d->blocked_atom()))))))
{
- if (! _implementation->current_package)
+ if (! _imp->current_package)
throw BlockError("'" + stringify(*(d->blocked_atom())) + "' blocked by pending package '"
+ stringify(*m) + " (no current package)");
- if (*_implementation->current_package == *m)
+ if (*_imp->current_package == *m)
{
- Log::get_instance()->message(ll_qa, "Package '" + stringify(*_implementation->current_package)
+ Log::get_instance()->message(ll_qa, "Package '" + stringify(*_imp->current_package)
+ "' has suspicious block upon '!" + stringify(*d->blocked_atom()) + "'");
++m;
continue;
}
DepAtom::ConstPointer provide(DepParser::parse(
- _implementation->current_package->get<dle_metadata>()->get(vmk_provide),
+ _imp->current_package->get<dle_metadata>()->get(vmk_provide),
DepParserPolicy<PackageDepAtom, false>::get_instance()));
CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag> e(0);
- if (_implementation->current_package)
+ if (_imp->current_package)
e = CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag>(
new PackageDatabaseEntry(
- _implementation->current_package->get<dle_name>(),
- _implementation->current_package->get<dle_version>(),
- _implementation->current_package->get<dle_repository>()));
+ _imp->current_package->get<dle_name>(),
+ _imp->current_package->get<dle_version>(),
+ _imp->current_package->get<dle_repository>()));
- DepAtomFlattener f(_implementation->environment, e.raw_pointer(), provide);
+ DepAtomFlattener f(_imp->environment, e.raw_pointer(), provide);
bool skip(false);
for (IndirectIterator<DepAtomFlattener::Iterator, const StringDepAtom> i(f.begin()),
@@ -631,49 +631,49 @@ DepList::visit(const BlockDepAtom * const d)
void
DepList::set_rdepend_post(const DepListRdependOption value)
{
- _implementation->rdepend_post = value;
+ _imp->rdepend_post = value;
}
void
DepList::set_drop_circular(const bool value)
{
- _implementation->drop_circular = value;
+ _imp->drop_circular = value;
}
void
DepList::set_drop_self_circular(const bool value)
{
- _implementation->drop_self_circular = value;
+ _imp->drop_self_circular = value;
}
void
DepList::set_dont_ignore_patch_dep(const bool value)
{
- _implementation->dont_ignore_patch_dep = value;
+ _imp->dont_ignore_patch_dep = value;
}
void
DepList::set_drop_all(const bool value)
{
- _implementation->drop_all = value;
+ _imp->drop_all = value;
}
void
DepList::set_ignore_installed(const bool value)
{
- _implementation->ignore_installed = value;
+ _imp->ignore_installed = value;
}
void
DepList::set_recursive_deps(const bool value)
{
- _implementation->recursive_deps = value;
+ _imp->recursive_deps = value;
}
void
DepList::set_max_stack_depth(const int value)
{
- _implementation->max_stack_depth = value;
+ _imp->max_stack_depth = value;
}
void
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index d203894..2249078 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -68,7 +68,7 @@ FakeRepository::~FakeRepository()
bool
FakeRepository::do_has_category_named(const CategoryNamePart & c) const
{
- return (_implementation->category_names->end() != _implementation->category_names->find(c));
+ return (_imp->category_names->end() != _imp->category_names->find(c));
}
bool
@@ -76,14 +76,14 @@ FakeRepository::do_has_package_named(const CategoryNamePart & c,
const PackageNamePart & p) const
{
return has_category_named(c) &&
- (_implementation->package_names.find(c)->second->end() !=
- _implementation->package_names.find(c)->second->find(p));
+ (_imp->package_names.find(c)->second->end() !=
+ _imp->package_names.find(c)->second->find(p));
}
CategoryNamePartCollection::ConstPointer
FakeRepository::do_category_names() const
{
- return _implementation->category_names;
+ return _imp->category_names;
}
QualifiedPackageNameCollection::ConstPointer
@@ -92,8 +92,8 @@ FakeRepository::do_package_names(const CategoryNamePart & c) const
if (! has_category_named(c))
throw InternalError(PALUDIS_HERE, "no category named " + stringify(c));
QualifiedPackageNameCollection::Pointer result(new QualifiedPackageNameCollection);
- PackageNamePartCollection::Iterator p(_implementation->package_names.find(c)->second->begin()),
- p_end(_implementation->package_names.find(c)->second->end());
+ PackageNamePartCollection::Iterator p(_imp->package_names.find(c)->second->begin()),
+ p_end(_imp->package_names.find(c)->second->end());
for ( ; p != p_end ; ++p)
result->insert(QualifiedPackageName(c, *p));
return result;
@@ -106,7 +106,7 @@ FakeRepository::do_version_specs(const QualifiedPackageName & n) const
throw InternalError(PALUDIS_HERE, "no category");
if (! has_package_named(n.get<qpn_category>(), n.get<qpn_package>()))
throw InternalError(PALUDIS_HERE, "no package");
- return _implementation->versions.find(n)->second;
+ return _imp->versions.find(n)->second;
}
bool
@@ -117,23 +117,23 @@ FakeRepository::do_has_version(const CategoryNamePart & c,
throw InternalError(PALUDIS_HERE, "no category");
if (! has_package_named(c, p))
throw InternalError(PALUDIS_HERE, "no package");
- return _implementation->versions.find(QualifiedPackageName(c, p))->second->find(v) !=
- _implementation->versions.find(QualifiedPackageName(c, p))->second->end();
+ return _imp->versions.find(QualifiedPackageName(c, p))->second->find(v) !=
+ _imp->versions.find(QualifiedPackageName(c, p))->second->end();
}
void
FakeRepository::add_category(const CategoryNamePart & c)
{
- _implementation->category_names->insert(c);
- _implementation->package_names.insert(std::make_pair(c, new PackageNamePartCollection));
+ _imp->category_names->insert(c);
+ _imp->package_names.insert(std::make_pair(c, new PackageNamePartCollection));
}
void
FakeRepository::add_package(const CategoryNamePart & c, const PackageNamePart & p)
{
add_category(c);
- _implementation->package_names.find(c)->second->insert(p);
- _implementation->versions.insert(std::make_pair(QualifiedPackageName(c, p),
+ _imp->package_names.find(c)->second->insert(p);
+ _imp->versions.insert(std::make_pair(QualifiedPackageName(c, p),
new VersionSpecCollection));
}
@@ -142,10 +142,10 @@ FakeRepository::add_version(const CategoryNamePart & c, const PackageNamePart &
const VersionSpec & v)
{
add_package(c, p);
- _implementation->versions.find(QualifiedPackageName(c, p))->second->insert(v);
- _implementation->metadata.insert(
+ _imp->versions.find(QualifiedPackageName(c, p))->second->insert(v);
+ _imp->metadata.insert(
std::make_pair(stringify(c) + "/" + stringify(p) + "-" + stringify(v), new VersionMetadata));
- VersionMetadata::Pointer r(_implementation->metadata.find(stringify(c) +
+ VersionMetadata::Pointer r(_imp->metadata.find(stringify(c) +
"/" + stringify(p) + "-" + stringify(v))->second);
r->set(vmk_slot, "0");
r->set(vmk_keywords, "test");
@@ -158,7 +158,7 @@ FakeRepository::do_version_metadata(
{
if (! has_version(c, p, v))
throw InternalError(PALUDIS_HERE, "no version");
- return _implementation->metadata.find(stringify(c) + "/" + stringify(p) + "-" + stringify(v))->second;
+ return _imp->metadata.find(stringify(c) + "/" + stringify(p) + "-" + stringify(v))->second;
}
bool
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index cddbe55..bf738e7 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -97,13 +97,13 @@ PackageDatabase::add_repository(const Repository::ConstPointer r)
Context c("When adding a repository named '" + stringify(r->name()) + "':");
IndirectIterator<std::list<Repository::ConstPointer>::const_iterator, const Repository>
- r_c(_implementation->repositories.begin()),
- r_end(_implementation->repositories.end());
+ r_c(_imp->repositories.begin()),
+ r_end(_imp->repositories.end());
for ( ; r_c != r_end ; ++r_c)
if (r_c->name() == r->name())
throw DuplicateRepositoryError(stringify(r->name()));
- _implementation->repositories.push_back(r);
+ _imp->repositories.push_back(r);
}
VersionMetadata::ConstPointer
@@ -124,8 +124,8 @@ Repository::ConstPointer
PackageDatabase::fetch_repository(const RepositoryName & n) const
{
std::list<Repository::ConstPointer>::const_iterator
- r(_implementation->repositories.begin()),
- r_end(_implementation->repositories.end());
+ r(_imp->repositories.begin()),
+ r_end(_imp->repositories.end());
for ( ; r != r_end ; ++r)
if ((*r)->name() == n)
return *r;
@@ -140,8 +140,8 @@ PackageDatabase::fetch_unique_qualified_package_name(
QualifiedPackageNameCollection::Pointer result(new QualifiedPackageNameCollection);
IndirectIterator<std::list<Repository::ConstPointer>::const_iterator, const Repository>
- r(_implementation->repositories.begin()),
- r_end(_implementation->repositories.end());
+ r(_imp->repositories.begin()),
+ r_end(_imp->repositories.end());
for ( ; r != r_end ; ++r)
{
CategoryNamePartCollection::ConstPointer cats(r->category_names());
@@ -165,8 +165,8 @@ PackageDatabase::query(const PackageDepAtom * const a) const
PackageDatabaseEntryCollection::Pointer result(new PackageDatabaseEntryCollection);
IndirectIterator<std::list<Repository::ConstPointer>::const_iterator, const Repository>
- r(_implementation->repositories.begin()),
- r_end(_implementation->repositories.end());
+ r(_imp->repositories.begin()),
+ r_end(_imp->repositories.end());
for ( ; r != r_end ; ++r)
{
if (! r->has_category_named(a->package().get<qpn_category>()))
@@ -196,8 +196,8 @@ PackageDatabase::better_repository(const RepositoryName & r1,
const RepositoryName & r2) const
{
IndirectIterator<std::list<Repository::ConstPointer>::const_iterator, const Repository>
- r(_implementation->repositories.begin()),
- r_end(_implementation->repositories.end());
+ r(_imp->repositories.begin()),
+ r_end(_imp->repositories.end());
for ( ; r != r_end ; ++r)
{
if (r->name() == r1)
@@ -212,10 +212,10 @@ PackageDatabase::better_repository(const RepositoryName & r1,
RepositoryName
PackageDatabase::favourite_repository() const
{
- if (_implementation->repositories.empty())
+ if (_imp->repositories.empty())
return RepositoryName("unnamed");
else
- return (*_implementation->repositories.begin())->name();
+ return (*_imp->repositories.begin())->name();
}
PackageDatabaseEntryCollection::Pointer
@@ -227,11 +227,11 @@ PackageDatabase::query(PackageDepAtom::ConstPointer a) const
PackageDatabase::RepositoryIterator
PackageDatabase::begin_repositories() const
{
- return _implementation->repositories.begin();
+ return _imp->repositories.begin();
}
PackageDatabase::RepositoryIterator
PackageDatabase::end_repositories() const
{
- return _implementation->repositories.end();
+ return _imp->repositories.end();
}
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 90bf260..a96c384 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -275,8 +275,8 @@ PortageRepository::do_has_category_named(const CategoryNamePart & c) const
"' in " + stringify(name()) + ":");
need_category_names();
- return _implementation->category_names.end() !=
- _implementation->category_names.find(c);
+ return _imp->category_names.end() !=
+ _imp->category_names.find(c);
}
bool
@@ -290,28 +290,28 @@ PortageRepository::do_has_package_named(const CategoryNamePart & c,
need_virtual_names();
CategoryMap::iterator cat_iter(
- _implementation->category_names.find(c));
+ _imp->category_names.find(c));
- if (_implementation->category_names.end() == cat_iter)
+ if (_imp->category_names.end() == cat_iter)
return false;
const QualifiedPackageName n(c, p);
if (cat_iter->second)
- return _implementation->package_names.find(n) !=
- _implementation->package_names.end();
+ return _imp->package_names.find(n) !=
+ _imp->package_names.end();
else
{
- if (_implementation->package_names.find(n) !=
- _implementation->package_names.end())
+ if (_imp->package_names.find(n) !=
+ _imp->package_names.end())
return true;
- FSEntry fs(_implementation->location);
+ FSEntry fs(_imp->location);
fs /= stringify(c);
fs /= stringify(p);
if (! fs.is_directory())
return false;
- _implementation->package_names.insert(std::make_pair(n, false));
+ _imp->package_names.insert(std::make_pair(n, false));
return true;
}
}
@@ -342,8 +342,8 @@ PortageRepository::do_category_names() const
need_category_names();
CategoryNamePartCollection::Pointer result(new CategoryNamePartCollection);
- CategoryMap::const_iterator i(_implementation->category_names.begin()),
- i_end(_implementation->category_names.end());
+ CategoryMap::const_iterator i(_imp->category_names.begin()),
+ i_end(_imp->category_names.end());
for ( ; i != i_end ; ++i)
result->insert(i->first);
return result;
@@ -362,10 +362,10 @@ PortageRepository::do_package_names(const CategoryNamePart & c) const
need_category_names();
need_virtual_names();
- if (_implementation->category_names.end() == _implementation->category_names.find(c))
+ if (_imp->category_names.end() == _imp->category_names.find(c))
return QualifiedPackageNameCollection::Pointer(new QualifiedPackageNameCollection);
- for (DirIterator d(_implementation->location / stringify(c)), d_end ; d != d_end ; ++d)
+ for (DirIterator d(_imp->location / stringify(c)), d_end ; d != d_end ; ++d)
{
if (! d->is_directory())
continue;
@@ -375,7 +375,7 @@ PortageRepository::do_package_names(const CategoryNamePart & c) const
try
{
- _implementation->package_names.insert(std::make_pair(
+ _imp->package_names.insert(std::make_pair(
QualifiedPackageName(c, PackageNamePart(d->basename())), false));
}
catch (const NameError &)
@@ -386,11 +386,11 @@ PortageRepository::do_package_names(const CategoryNamePart & c) const
}
}
- _implementation->category_names[c] = true;
+ _imp->category_names[c] = true;
QualifiedPackageNameCollection::Pointer result(new QualifiedPackageNameCollection);
- std::copy(_implementation->package_names.begin(), _implementation->package_names.end(),
+ std::copy(_imp->package_names.begin(), _imp->package_names.end(),
transform_inserter(filter_inserter(result->inserter(), CategoryFilter(c)),
SelectFirst<QualifiedPackageName, bool>()));
@@ -406,7 +406,7 @@ PortageRepository::do_version_specs(const QualifiedPackageName & n) const
if (has_package_named(n))
{
need_version_names(n);
- return _implementation->version_specs.find(n)->second;
+ return _imp->version_specs.find(n)->second;
}
else
return VersionSpecCollection::Pointer(new VersionSpecCollection);
@@ -423,7 +423,7 @@ PortageRepository::do_has_version(const CategoryNamePart & c,
{
need_version_names(QualifiedPackageName(c, p));
VersionSpecCollection::Pointer vv(
- _implementation->version_specs.find(QualifiedPackageName(c, p))->second);
+ _imp->version_specs.find(QualifiedPackageName(c, p))->second);
return vv->end() != vv->find(v);
}
else
@@ -433,18 +433,18 @@ PortageRepository::do_has_version(const CategoryNamePart & c,
void
PortageRepository::need_category_names() const
{
- if (_implementation->has_category_names)
+ if (_imp->has_category_names)
return;
Context context("When loading category names for " + stringify(name()) + ":");
- LineConfigFile cats(_implementation->location / "profiles" / "categories");
+ LineConfigFile cats(_imp->location / "profiles" / "categories");
for (LineConfigFile::Iterator line(cats.begin()), line_end(cats.end()) ;
line != line_end ; ++line)
- _implementation->category_names.insert(std::make_pair(CategoryNamePart(*line), false));
+ _imp->category_names.insert(std::make_pair(CategoryNamePart(*line), false));
- _implementation->has_category_names = true;
+ _imp->has_category_names = true;
}
void
@@ -452,7 +452,7 @@ PortageRepository::need_version_names(const QualifiedPackageName & n) const
{
need_virtual_names();
- if (_implementation->package_names[n])
+ if (_imp->package_names[n])
return;
Context context("When loading versions for '" + stringify(n) + "' in "
@@ -460,12 +460,12 @@ PortageRepository::need_version_names(const QualifiedPackageName & n) const
VersionSpecCollection::Pointer v(new VersionSpecCollection);
- FSEntry path(_implementation->location / stringify(n.get<qpn_category>()) /
+ FSEntry path(_imp->location / stringify(n.get<qpn_category>()) /
stringify(n.get<qpn_package>()));
if (CategoryNamePart("virtual") == n.get<qpn_category>() && ! path.exists())
{
VirtualsMap::iterator i(
- _implementation->virtuals_map.find(n));
+ _imp->virtuals_map.find(n));
need_version_names(i->second->package());
VersionSpecCollection::ConstPointer versions(version_specs(i->second->package()));
@@ -473,7 +473,7 @@ PortageRepository::need_version_names(const QualifiedPackageName & n) const
vv != vv_end ; ++vv)
{
PackageDatabaseEntry e(i->second->package(), *vv, name());
- if (! match_package(_implementation->db, i->second, e))
+ if (! match_package(_imp->db, i->second, e))
continue;
v->insert(*vv);
@@ -491,8 +491,8 @@ PortageRepository::need_version_names(const QualifiedPackageName & n) const
IsFileWithExtension(stringify(n.get<qpn_package>()) + "-", ".ebuild")));
- _implementation->version_specs.insert(std::make_pair(n, v));
- _implementation->package_names[n] = true;
+ _imp->version_specs.insert(std::make_pair(n, v));
+ _imp->package_names[n] = true;
}
RepositoryName
@@ -528,9 +528,9 @@ VersionMetadata::ConstPointer
PortageRepository::do_version_metadata(
const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
{
- if (_implementation->metadata.end() != _implementation->metadata.find(
+ if (_imp->metadata.end() != _imp->metadata.find(
std::make_pair(QualifiedPackageName(c, p), v)))
- return _implementation->metadata.find(std::make_pair(QualifiedPackageName(c, p), v))->second;
+ return _imp->metadata.find(std::make_pair(QualifiedPackageName(c, p), v))->second;
Context context("When fetching metadata for " + stringify(c) + "/" + stringify(p) +
"-" + stringify(v));
@@ -545,12 +545,12 @@ PortageRepository::do_version_metadata(
VersionMetadata::Pointer result(new VersionMetadata);
- FSEntry cache_file(_implementation->cache);
+ FSEntry cache_file(_imp->cache);
cache_file /= stringify(c);
cache_file /= stringify(p) + "-" + stringify(v);
bool ok(false);
- VirtualsMap::iterator vi(_implementation->virtuals_map.end());
+ VirtualsMap::iterator vi(_imp->virtuals_map.end());
if (cache_file.is_regular_file())
{
std::ifstream cache(std::string(cache_file).c_str());
@@ -582,7 +582,7 @@ PortageRepository::do_version_metadata(
Log::get_instance()->message(ll_warning, "Couldn't read the cache file at '"
+ stringify(cache_file) + "'");
}
- else if (_implementation->virtuals_map.end() != ((vi = _implementation->virtuals_map.find(
+ else if (_imp->virtuals_map.end() != ((vi = _imp->virtuals_map.find(
QualifiedPackageName(c, p)))))
{
VersionMetadata::ConstPointer m(version_metadata(vi->second->package(), v));
@@ -596,7 +596,7 @@ PortageRepository::do_version_metadata(
if (! ok)
{
- if (_implementation->cache.basename() != "empty")
+ if (_imp->cache.basename() != "empty")
Log::get_instance()->message(ll_warning, "No cache entry for '" + stringify(c) + "/" +
stringify(p) + "-" + stringify(v) + "' in '" + stringify(name()) + "'");
@@ -609,11 +609,11 @@ PortageRepository::do_version_metadata(
"PF='" + stringify(p) + "-" + stringify(v) + "' " +
"A='' " +
"CATEGORY='" + stringify(c) + "' " +
- "FILESDIR='" + stringify(_implementation->location) + "/" + stringify(c) + "/" +
+ "FILESDIR='" + stringify(_imp->location) + "/" + stringify(c) + "/" +
stringify(p) + "/files/' " +
- "ECLASSDIR='" + stringify(_implementation->location) + "/eclass/' " +
- "PORTDIR='" + stringify(_implementation->location) + "/' " +
- "DISTDIR='" + stringify(_implementation->location) + "/distfiles/' " +
+ "ECLASSDIR='" + stringify(_imp->location) + "/eclass/' " +
+ "PORTDIR='" + stringify(_imp->location) + "/' " +
+ "DISTDIR='" + stringify(_imp->location) + "/distfiles/' " +
"WORKDIR='/dev/null' " +
"T='/dev/null' " +
"D='/dev/null' " +
@@ -621,7 +621,7 @@ PortageRepository::do_version_metadata(
"KV='" + kernel_version() + "' " +
getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/ebuild.bash metadata '" +
- stringify(_implementation->location) + "/" + stringify(c) + "/" + stringify(p) + "/" +
+ stringify(_imp->location) + "/" + stringify(c) + "/" + stringify(p) + "/" +
stringify(p) + "-" + stringify(v) + ".ebuild'");
PStream prog(cmd);
@@ -655,7 +655,7 @@ PortageRepository::do_version_metadata(
ok = true;
}
- _implementation->metadata.insert(std::make_pair(std::make_pair(QualifiedPackageName(c, p), v), result));
+ _imp->metadata.insert(std::make_pair(std::make_pair(QualifiedPackageName(c, p), v), result));
return result;
}
@@ -663,12 +663,12 @@ bool
PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
const PackageNamePart & p, const VersionSpec & v) const
{
- if (! _implementation->has_repo_mask)
+ if (! _imp->has_repo_mask)
{
Context context("When querying repository mask for '" + stringify(c) + "/" + stringify(p) + "-"
+ stringify(v) + "':");
- FSEntry fff(_implementation->location / "profiles" / "package.mask");
+ FSEntry fff(_imp->location / "profiles" / "package.mask");
if (fff.exists())
{
LineConfigFile ff(fff);
@@ -676,21 +676,21 @@ PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
line != line_end ; ++line)
{
PackageDepAtom::ConstPointer a(new PackageDepAtom(*line));
- _implementation->repo_mask[a->package()].push_back(a);
+ _imp->repo_mask[a->package()].push_back(a);
}
}
- _implementation->has_repo_mask = true;
+ _imp->has_repo_mask = true;
}
RepositoryMaskMap::iterator r(
- _implementation->repo_mask.find(QualifiedPackageName(c, p)));
- if (_implementation->repo_mask.end() == r)
+ _imp->repo_mask.find(QualifiedPackageName(c, p)));
+ if (_imp->repo_mask.end() == r)
return false;
else
for (IndirectIterator<std::deque<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
- if (match_package(_implementation->db, *k, PackageDatabaseEntry(
+ if (match_package(_imp->db, *k, PackageDatabaseEntry(
QualifiedPackageName(c, p), v, name())))
return true;
@@ -708,15 +708,15 @@ PortageRepository::do_query_profile_masks(const CategoryNamePart &,
UseFlagState
PortageRepository::do_query_use(const UseFlagName & f) const
{
- if (! _implementation->has_profile)
+ if (! _imp->has_profile)
{
Context context("When checking USE state for '" + stringify(f) + "':");
- _implementation->add_profile(_implementation->profile.realpath());
- _implementation->has_profile = true;
+ _imp->add_profile(_imp->profile.realpath());
+ _imp->has_profile = true;
}
- UseMap::iterator p(_implementation->use.end());
- if (_implementation->use.end() == ((p = _implementation->use.find(f))))
+ UseMap::iterator p(_imp->use.end());
+ if (_imp->use.end() == ((p = _imp->use.find(f))))
return use_unspecified;
else
return p->second;
@@ -725,29 +725,29 @@ PortageRepository::do_query_use(const UseFlagName & f) const
bool
PortageRepository::do_query_use_mask(const UseFlagName & u) const
{
- if (! _implementation->has_profile)
+ if (! _imp->has_profile)
{
Context context("When checking USE mask for '" + stringify(u) + "':");
- _implementation->add_profile(_implementation->profile.realpath());
- _implementation->has_profile = true;
+ _imp->add_profile(_imp->profile.realpath());
+ _imp->has_profile = true;
}
- return _implementation->use_mask.end() != _implementation->use_mask.find(u);
+ return _imp->use_mask.end() != _imp->use_mask.find(u);
}
void
PortageRepository::need_virtual_names() const
{
- if (! _implementation->has_profile)
+ if (! _imp->has_profile)
{
Context context("When loading virtual names:");
- _implementation->add_profile(_implementation->profile.realpath());
- _implementation->has_profile = true;
+ _imp->add_profile(_imp->profile.realpath());
+ _imp->has_profile = true;
for (VirtualsMap::const_iterator
- v(_implementation->virtuals_map.begin()), v_end(_implementation->virtuals_map.end()) ;
+ v(_imp->virtuals_map.begin()), v_end(_imp->virtuals_map.end()) ;
v != v_end ; ++v)
- _implementation->package_names.insert(
+ _imp->package_names.insert(
std::make_pair(v->first, false));
}
}
@@ -784,33 +784,33 @@ PortageRepositoryConfigurationError::PortageRepositoryConfigurationError(
bool
PortageRepository::do_is_arch_flag(const UseFlagName & u) const
{
- if (! _implementation->has_arch_list)
+ if (! _imp->has_arch_list)
{
Context context("When checking arch list for '" + stringify(u) + "':");
- LineConfigFile archs(_implementation->location / "profiles" / "arch.list");
+ LineConfigFile archs(_imp->location / "profiles" / "arch.list");
std::copy(archs.begin(), archs.end(), create_inserter<UseFlagName>(
- std::inserter(_implementation->arch_list, _implementation->arch_list.begin())));
+ std::inserter(_imp->arch_list, _imp->arch_list.begin())));
- _implementation->has_arch_list = true;
+ _imp->has_arch_list = true;
}
- return _implementation->arch_list.end() != _implementation->arch_list.find(u);
+ return _imp->arch_list.end() != _imp->arch_list.find(u);
}
bool
PortageRepository::do_is_expand_flag(const UseFlagName & u) const
{
- if (! _implementation->has_profile)
+ if (! _imp->has_profile)
{
Context context("When checking USE_EXPAND list for '" + stringify(u) + "':");
- _implementation->add_profile(_implementation->profile.realpath());
- _implementation->has_profile = true;
+ _imp->add_profile(_imp->profile.realpath());
+ _imp->has_profile = true;
}
/// \todo VV no need for this to be linear
- for (UseFlagSet::const_iterator i(_implementation->expand_list.begin()),
- i_end(_implementation->expand_list.end()) ; i != i_end ; ++i)
+ for (UseFlagSet::const_iterator i(_imp->expand_list.begin()),
+ i_end(_imp->expand_list.end()) ; i != i_end ; ++i)
if (0 == strncasecmp(
stringify(u).c_str(),
(stringify(*i) + "_").c_str(),
@@ -823,7 +823,7 @@ PortageRepository::do_is_expand_flag(const UseFlagName & u) const
bool
PortageRepository::do_is_licence(const std::string & s) const
{
- FSEntry l(_implementation->location);
+ FSEntry l(_imp->location);
l /= "licenses";
if (! l.is_directory())
@@ -836,21 +836,21 @@ PortageRepository::do_is_licence(const std::string & s) const
bool
PortageRepository::do_is_mirror(const std::string & s) const
{
- if (! _implementation->has_mirrors)
+ if (! _imp->has_mirrors)
{
static Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- LineConfigFile mirrors(_implementation->location / "profiles" / "thirdpartymirrors");
+ LineConfigFile mirrors(_imp->location / "profiles" / "thirdpartymirrors");
for (LineConfigFile::Iterator line(mirrors.begin()) ; line != mirrors.end() ; ++line)
{
std::vector<std::string> entries;
tokeniser.tokenise(*line, std::back_inserter(entries));
if (! entries.empty())
- _implementation->mirrors.insert(entries.at(0));
+ _imp->mirrors.insert(entries.at(0));
}
- _implementation->has_mirrors = true;
+ _imp->has_mirrors = true;
}
- return _implementation->mirrors.end() != _implementation->mirrors.find(s);
+ return _imp->mirrors.end() != _imp->mirrors.find(s);
}
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index 390b813..5dd8eb3 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.cc
@@ -42,8 +42,8 @@ namespace paludis
Log::Log() :
PrivateImplementationPattern<Log>(new Implementation<Log>)
{
- _implementation->log_level = initial_ll;
- _implementation->stream = &std::cerr;
+ _imp->log_level = initial_ll;
+ _imp->stream = &std::cerr;
}
Log::~Log()
@@ -53,28 +53,28 @@ Log::~Log()
void
Log::set_log_level(const LogLevel l)
{
- _implementation->log_level = l;
+ _imp->log_level = l;
}
void
Log::message(const LogLevel l, const std::string & s)
{
- if (l >= _implementation->log_level)
+ if (l >= _imp->log_level)
{
do
{
switch (l)
{
case ll_debug:
- *_implementation->stream << "[DEBUG] ";
+ *_imp->stream << "[DEBUG] ";
continue;
case ll_qa:
- *_implementation->stream << "[QA] ";
+ *_imp->stream << "[QA] ";
continue;
case ll_warning:
- *_implementation->stream << "[WARNING] ";
+ *_imp->stream << "[WARNING] ";
continue;
case ll_silent:
@@ -88,12 +88,12 @@ Log::message(const LogLevel l, const std::string & s)
} while (false);
- *_implementation->stream << s << std::endl;
+ *_imp->stream << s << std::endl;
}
}
void
Log::set_log_stream(std::ostream * const s)
{
- _implementation->stream = s;
+ _imp->stream = s;
}
diff --git a/paludis/util/private_implementation_pattern.hh b/paludis/util/private_implementation_pattern.hh
index 1a32982..f1b6693 100644
--- a/paludis/util/private_implementation_pattern.hh
+++ b/paludis/util/private_implementation_pattern.hh
@@ -44,14 +44,14 @@ namespace paludis
/**
* Pointer to our implementation data.
*/
- CountedPtr<Implementation<C_>, count_policy::InternalCountTag> _implementation;
+ CountedPtr<Implementation<C_>, count_policy::InternalCountTag> _imp;
public:
/**
* Constructor.
*/
explicit PrivateImplementationPattern(Implementation<C_> * i) :
- _implementation(i)
+ _imp(i)
{
}
};
diff --git a/paludis/version_metadata.cc b/paludis/version_metadata.cc
index 01ea8ca..87a79a6 100644
--- a/paludis/version_metadata.cc
+++ b/paludis/version_metadata.cc
@@ -78,31 +78,31 @@ VersionMetadata::~VersionMetadata()
const std::string &
VersionMetadata::get(const VersionMetadataKey key) const
{
- if (key < 0 || key >= static_cast<int>(_implementation->values.size()))
+ if (key < 0 || key >= static_cast<int>(_imp->values.size()))
throw InternalError(PALUDIS_HERE, "Bad value for key");
- return _implementation->values[key];
+ return _imp->values[key];
}
VersionMetadata &
VersionMetadata::set(const VersionMetadataKey key, const std::string & value)
{
- if (key < 0 || key >= static_cast<int>(_implementation->values.size()))
+ if (key < 0 || key >= static_cast<int>(_imp->values.size()))
throw InternalError(PALUDIS_HERE, "Bad value for key");
- _implementation->values[key] = value;
+ _imp->values[key] = value;
switch (key)
{
case vmk_iuse:
- _implementation->iuse.clear();
+ _imp->iuse.clear();
break;
case vmk_keywords:
- _implementation->keywords.clear();
+ _imp->keywords.clear();
break;
case vmk_provide:
- _implementation->provide.clear();
+ _imp->provide.clear();
break;
default:
@@ -115,37 +115,37 @@ VersionMetadata::set(const VersionMetadataKey key, const std::string & value)
VersionMetadata::IuseIterator
VersionMetadata::begin_iuse() const
{
- if (_implementation->iuse.empty())
+ if (_imp->iuse.empty())
{
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
tokeniser.tokenise(get(vmk_iuse), create_inserter<UseFlagName>(
- std::inserter(_implementation->iuse, _implementation->iuse.begin())));
+ std::inserter(_imp->iuse, _imp->iuse.begin())));
}
- return _implementation->iuse.begin();
+ return _imp->iuse.begin();
}
VersionMetadata::IuseIterator
VersionMetadata::end_iuse() const
{
- return _implementation->iuse.end();
+ return _imp->iuse.end();
}
VersionMetadata::KeywordIterator
VersionMetadata::begin_keywords() const
{
- if (_implementation->keywords.empty())
+ if (_imp->keywords.empty())
{
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
tokeniser.tokenise(get(vmk_keywords), create_inserter<KeywordName>(
- std::inserter(_implementation->keywords, _implementation->keywords.begin())));
+ std::inserter(_imp->keywords, _imp->keywords.begin())));
}
- return _implementation->keywords.begin();
+ return _imp->keywords.begin();
}
VersionMetadata::KeywordIterator
VersionMetadata::end_keywords() const
{
- return _implementation->keywords.end();
+ return _imp->keywords.end();
}
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index f7d941e..1bcd430 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -79,14 +79,14 @@ VersionSpec::VersionSpec(const std::string & text) :
Context c("When parsing version spec '" + text + "':");
/* set us up with some sane defaults */
- _implementation->text = text;
- std::fill_n(&_implementation->version_parts[0],
+ _imp->text = text;
+ std::fill_n(&_imp->version_parts[0],
VersionSpec::max_version_parts_count, 0);
- _implementation->letter_part = '\0';
- _implementation->revision_part = 0;
- _implementation->suffix_part = none;
- _implementation->suffix_level_part = 0;
- _implementation->patch_level_part = -1;
+ _imp->letter_part = '\0';
+ _imp->revision_part = 0;
+ _imp->suffix_part = none;
+ _imp->suffix_level_part = 0;
+ _imp->patch_level_part = -1;
/* parse */
unsigned version_part_idx(0);
@@ -98,8 +98,8 @@ VersionSpec::VersionSpec(const std::string & text) :
if (text.at(p) < '0' || text.at(p) > '9')
throw BadVersionSpecError(text);
- _implementation->version_parts[version_part_idx] *= 10;
- _implementation->version_parts[version_part_idx] += text.at(p) - '0';
+ _imp->version_parts[version_part_idx] *= 10;
+ _imp->version_parts[version_part_idx] += text.at(p) - '0';
if (++p >= text.length())
break;
@@ -114,12 +114,12 @@ VersionSpec::VersionSpec(const std::string & text) :
if (text.at(p) < '0' || text.at(p) > '9')
break;
}
- _implementation->max_star_count = version_part_idx + 1;
+ _imp->max_star_count = version_part_idx + 1;
/* letter */
if (p < text.length())
if (text.at(p) >= 'a' && text.at(p) <= 'z')
- _implementation->letter_part = text.at(p++);
+ _imp->letter_part = text.at(p++);
/* suffix */
if (p < text.length())
@@ -127,22 +127,22 @@ VersionSpec::VersionSpec(const std::string & text) :
{
if (0 == text.compare(p, 6, "_alpha"))
{
- _implementation->suffix_part = alpha;
+ _imp->suffix_part = alpha;
p += 6;
}
else if (0 == text.compare(p, 5, "_beta"))
{
- _implementation->suffix_part = beta;
+ _imp->suffix_part = beta;
p += 5;
}
else if (0 == text.compare(p, 4, "_pre"))
{
- _implementation->suffix_part = pre;
+ _imp->suffix_part = pre;
p += 4;
}
else if (0 == text.compare(p, 3, "_rc"))
{
- _implementation->suffix_part = rc;
+ _imp->suffix_part = rc;
p += 3;
}
else
@@ -152,22 +152,22 @@ VersionSpec::VersionSpec(const std::string & text) :
{
if (text.at(p) < '0' || text.at(p) > '9')
break;
- _implementation->suffix_level_part *= 10;
- _implementation->suffix_level_part += text.at(p) - '0';
+ _imp->suffix_level_part *= 10;
+ _imp->suffix_level_part += text.at(p) - '0';
}
} while (false);
/* patch level */
if (p < text.length() && 0 == text.compare(p, 2, "_p"))
{
- _implementation->patch_level_part = 0;
+ _imp->patch_level_part = 0;
for (p += 2 ; p < text.length() ; ++p)
{
if (text.at(p) < '0' || text.at(p) > '9')
break;
- _implementation->patch_level_part *= 10;
- _implementation->patch_level_part += text.at(p) - '0';
+ _imp->patch_level_part *= 10;
+ _imp->patch_level_part += text.at(p) - '0';
}
}
@@ -180,8 +180,8 @@ VersionSpec::VersionSpec(const std::string & text) :
{
if (text.at(p) < '0' || text.at(p) > '9')
break;
- _implementation->revision_part *= 10;
- _implementation->revision_part += text.at(p) - '0';
+ _imp->revision_part *= 10;
+ _imp->revision_part += text.at(p) - '0';
++p;
}
}
@@ -196,17 +196,17 @@ VersionSpec::VersionSpec(const VersionSpec & other) :
PrivateImplementationPattern<VersionSpec>(new Implementation<VersionSpec>),
ComparisonPolicyType(other)
{
- _implementation->text = other._implementation->text;
+ _imp->text = other._imp->text;
/* don't change this to std::copy_n, it's non-portable. */
- std::copy(&other._implementation->version_parts[0],
- &other._implementation->version_parts[max_version_parts_count] + 1,
- &_implementation->version_parts[0]);
- _implementation->letter_part = other._implementation->letter_part;
- _implementation->revision_part = other._implementation->revision_part;
- _implementation->suffix_part = other._implementation->suffix_part;
- _implementation->suffix_level_part = other._implementation->suffix_level_part;
- _implementation->patch_level_part = other._implementation->patch_level_part;
- _implementation->max_star_count = other._implementation->max_star_count;
+ std::copy(&other._imp->version_parts[0],
+ &other._imp->version_parts[max_version_parts_count] + 1,
+ &_imp->version_parts[0]);
+ _imp->letter_part = other._imp->letter_part;
+ _imp->revision_part = other._imp->revision_part;
+ _imp->suffix_part = other._imp->suffix_part;
+ _imp->suffix_level_part = other._imp->suffix_level_part;
+ _imp->patch_level_part = other._imp->patch_level_part;
+ _imp->max_star_count = other._imp->max_star_count;
}
const VersionSpec &
@@ -214,17 +214,17 @@ VersionSpec::operator= (const VersionSpec & other)
{
if (this != &other)
{
- _implementation->text = other._implementation->text;
+ _imp->text = other._imp->text;
/* don't change this to std::copy_n, it's non-portable. */
- std::copy(&other._implementation->version_parts[0],
- &other._implementation->version_parts[max_version_parts_count] + 1,
- &_implementation->version_parts[0]);
- _implementation->letter_part = other._implementation->letter_part;
- _implementation->revision_part = other._implementation->revision_part;
- _implementation->suffix_part = other._implementation->suffix_part;
- _implementation->suffix_level_part = other._implementation->suffix_level_part;
- _implementation->patch_level_part = other._implementation->patch_level_part;
- _implementation->max_star_count = other._implementation->max_star_count;
+ std::copy(&other._imp->version_parts[0],
+ &other._imp->version_parts[max_version_parts_count] + 1,
+ &_imp->version_parts[0]);
+ _imp->letter_part = other._imp->letter_part;
+ _imp->revision_part = other._imp->revision_part;
+ _imp->suffix_part = other._imp->suffix_part;
+ _imp->suffix_level_part = other._imp->suffix_level_part;
+ _imp->patch_level_part = other._imp->patch_level_part;
+ _imp->max_star_count = other._imp->max_star_count;
}
return *this;
}
@@ -238,35 +238,35 @@ VersionSpec::compare(const VersionSpec & other) const
{
for (unsigned i(0) ; i < VersionSpec::max_version_parts_count ; ++i)
{
- if (_implementation->version_parts[i] < other._implementation->version_parts[i])
+ if (_imp->version_parts[i] < other._imp->version_parts[i])
return -1;
- else if (_implementation->version_parts[i] > other._implementation->version_parts[i])
+ else if (_imp->version_parts[i] > other._imp->version_parts[i])
return 1;
}
- if (_implementation->letter_part < other._implementation->letter_part)
+ if (_imp->letter_part < other._imp->letter_part)
return -1;
- if (_implementation->letter_part > other._implementation->letter_part)
+ if (_imp->letter_part > other._imp->letter_part)
return 1;
- if (_implementation->suffix_part < other._implementation->suffix_part)
+ if (_imp->suffix_part < other._imp->suffix_part)
return -1;
- if (_implementation->suffix_part > other._implementation->suffix_part)
+ if (_imp->suffix_part > other._imp->suffix_part)
return 1;
- if (_implementation->suffix_level_part < other._implementation->suffix_level_part)
+ if (_imp->suffix_level_part < other._imp->suffix_level_part)
return -1;
- if (_implementation->suffix_level_part > other._implementation->suffix_level_part)
+ if (_imp->suffix_level_part > other._imp->suffix_level_part)
return 1;
- if (_implementation->patch_level_part < other._implementation->patch_level_part)
+ if (_imp->patch_level_part < other._imp->patch_level_part)
return -1;
- if (_implementation->patch_level_part > other._implementation->patch_level_part)
+ if (_imp->patch_level_part > other._imp->patch_level_part)
return 1;
- if (_implementation->revision_part < other._implementation->revision_part)
+ if (_imp->revision_part < other._imp->revision_part)
return -1;
- if (_implementation->revision_part > other._implementation->revision_part)
+ if (_imp->revision_part > other._imp->revision_part)
return 1;
return 0;
@@ -276,19 +276,19 @@ bool
VersionSpec::tilde_compare(const VersionSpec & other) const
{
for (unsigned i(0) ; i < VersionSpec::max_version_parts_count ; ++i)
- if (_implementation->version_parts[i] != other._implementation->version_parts[i])
+ if (_imp->version_parts[i] != other._imp->version_parts[i])
return false;
- if (_implementation->letter_part != other._implementation->letter_part)
+ if (_imp->letter_part != other._imp->letter_part)
return false;
- if (_implementation->suffix_part != other._implementation->suffix_part)
+ if (_imp->suffix_part != other._imp->suffix_part)
return false;
- if (_implementation->suffix_level_part != other._implementation->suffix_level_part)
+ if (_imp->suffix_level_part != other._imp->suffix_level_part)
return false;
- if (_implementation->patch_level_part != other._implementation->patch_level_part)
+ if (_imp->patch_level_part != other._imp->patch_level_part)
return false;
return true;
@@ -297,26 +297,26 @@ VersionSpec::tilde_compare(const VersionSpec & other) const
bool
VersionSpec::equal_star_compare(const VersionSpec & other) const
{
- return 0 == _implementation->text.compare(0, other._implementation->text.length(), other._implementation->text);
+ return 0 == _imp->text.compare(0, other._imp->text.length(), other._imp->text);
}
std::size_t
VersionSpec::hash_value() const
{
/// \todo Improve this;
- return _implementation->version_parts[0];
+ return _imp->version_parts[0];
}
VersionSpec
VersionSpec::remove_revision() const
{
VersionSpec result(*this);
- result._implementation->revision_part = 0;
+ result._imp->revision_part = 0;
std::string::size_type p;
- if (std::string::npos != ((p = result._implementation->text.rfind("-r"))))
- if (std::string::npos == result._implementation->text.find_first_not_of("0123456789", p + 2))
- result._implementation->text.erase(p);
+ if (std::string::npos != ((p = result._imp->text.rfind("-r"))))
+ if (std::string::npos == result._imp->text.find_first_not_of("0123456789", p + 2))
+ result._imp->text.erase(p);
return result;
}
@@ -324,12 +324,12 @@ VersionSpec::remove_revision() const
std::string
VersionSpec::revision_only() const
{
- return "r" + stringify(_implementation->revision_part);
+ return "r" + stringify(_imp->revision_part);
}
std::ostream &
paludis::operator<< (std::ostream & s, const VersionSpec & v)
{
- s << v._implementation->text;
+ s << v._imp->text;
return s;
}