aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-22 01:16:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-22 01:16:22 +0000
commitd64ac544e733912643c6d19eeed94981d23beff1 (patch)
treecbd411973d62ccc489ba6adea0c4e5967c8f3071
parentce219d257ad400a9ecd09124e70bb70a682ac0a1 (diff)
downloadpaludis-d64ac544e733912643c6d19eeed94981d23beff1.tar.gz
paludis-d64ac544e733912643c6d19eeed94981d23beff1.tar.xz
Atom -> Spec throughout.
-rw-r--r--doc/examples/pwp_basic_cplusplus_app.cc2
-rw-r--r--paludis/dep_list/dep_list.cc220
-rw-r--r--paludis/dep_list/dep_list.hh16
-rw-r--r--paludis/dep_list/exceptions.hh4
-rw-r--r--paludis/dep_list/range_rewriter.cc22
-rw-r--r--paludis/dep_list/range_rewriter.hh24
-rw-r--r--paludis/dep_list/range_rewriter_TEST.cc14
-rw-r--r--paludis/dep_list/uninstall_list.cc24
-rw-r--r--paludis/dep_spec.cc (renamed from paludis/dep_atom.cc)120
-rw-r--r--paludis/dep_spec.hh (renamed from paludis/dep_atom.hh)202
-rw-r--r--paludis/dep_spec_TEST.cc (renamed from paludis/dep_atom_TEST.cc)68
-rw-r--r--paludis/dep_spec_flattener.cc (renamed from paludis/dep_atom_flattener.cc)66
-rw-r--r--paludis/dep_spec_flattener.hh (renamed from paludis/dep_atom_flattener.hh)38
-rw-r--r--paludis/dep_spec_pretty_printer.cc (renamed from paludis/dep_atom_pretty_printer.cc)30
-rw-r--r--paludis/dep_spec_pretty_printer.hh (renamed from paludis/dep_atom_pretty_printer.hh)38
-rw-r--r--paludis/dep_tag.hh2
-rw-r--r--paludis/environment.cc74
-rw-r--r--paludis/environment.hh18
-rw-r--r--paludis/environment/default/default_config.cc124
-rw-r--r--paludis/environment/default/default_config.hh12
-rw-r--r--paludis/environment/default/default_environment.cc40
-rw-r--r--paludis/environment/default/default_environment.hh2
-rw-r--r--paludis/environment/default/use_config_entry.sr12
-rw-r--r--paludis/files.m46
-rw-r--r--paludis/match_package.cc56
-rw-r--r--paludis/match_package.hh12
-rw-r--r--paludis/package_database.cc6
-rw-r--r--paludis/package_database.hh8
-rw-r--r--paludis/package_database_TEST.cc18
-rw-r--r--paludis/portage_dep_lexer.cc2
-rw-r--r--paludis/portage_dep_lexer_TEST.cc14
-rw-r--r--paludis/portage_dep_parser.cc26
-rw-r--r--paludis/portage_dep_parser.hh38
-rw-r--r--paludis/portage_dep_parser_TEST.cc48
-rw-r--r--paludis/qa/dep_any_check.cc20
-rw-r--r--paludis/qa/dep_flags_check.cc26
-rw-r--r--paludis/qa/dep_packages_check.cc22
-rw-r--r--paludis/qa/deps_exist_check.cc24
-rw-r--r--paludis/qa/deps_visible_check.cc38
-rw-r--r--paludis/qa/extract_check.cc24
-rw-r--r--paludis/qa/license_check.cc32
-rw-r--r--paludis/qa/pdepend_overlap_check.cc22
-rw-r--r--paludis/qa/src_uri_check.cc32
-rw-r--r--paludis/query.cc20
-rw-r--r--paludis/query.hh4
-rw-r--r--paludis/repositories/cran/cran_dep_parser.cc24
-rw-r--r--paludis/repositories/cran/cran_dep_parser.hh6
-rw-r--r--paludis/repositories/cran/cran_dep_parser_TEST.cc8
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc22
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh2
-rw-r--r--paludis/repositories/cran/cran_repository.cc10
-rw-r--r--paludis/repositories/cran/cran_repository.hh2
-rw-r--r--paludis/repositories/cran/cran_repository_TEST.cc4
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc10
-rw-r--r--paludis/repositories/fake/fake_repository.cc10
-rw-r--r--paludis/repositories/fake/fake_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc12
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh4
-rw-r--r--paludis/repositories/gems/gems_repository.cc4
-rw-r--r--paludis/repositories/gems/gems_repository.hh2
-rw-r--r--paludis/repositories/gentoo/ebin_entries.cc10
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc54
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc26
-rw-r--r--paludis/repositories/gentoo/portage_repository.hh4
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.cc46
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.hh6
-rw-r--r--paludis/repositories/gentoo/portage_repository_sets.cc38
-rw-r--r--paludis/repositories/gentoo/portage_repository_sets.hh6
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc50
-rw-r--r--paludis/repositories/gentoo/vdb_repository.hh2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc42
-rw-r--r--paludis/repository.hh6
-rw-r--r--paludis/repository.sr2
-rw-r--r--paludis/tasks/find_unused_packages_task.cc2
-rw-r--r--paludis/tasks/install_task.cc32
-rw-r--r--paludis/tasks/install_task.hh6
-rw-r--r--paludis/tasks/report_task.cc24
-rw-r--r--paludis/tasks/uninstall_task.cc32
-rw-r--r--paludis/tasks/uninstall_task.hh4
-rw-r--r--paludis/version_metadata.cc14
-rw-r--r--paludis/version_metadata.hh4
-rw-r--r--paludis/version_metadata.sr12
-rw-r--r--paludis/version_requirements.hh4
-rw-r--r--ruby/Makefile.am4
-rw-r--r--ruby/dep_atom.cc453
-rw-r--r--ruby/dep_list.cc12
-rw-r--r--ruby/dep_list_TEST.rb14
-rw-r--r--ruby/dep_spec.cc453
-rw-r--r--ruby/dep_spec_TEST.rb (renamed from ruby/dep_atom_TEST.rb)68
-rw-r--r--ruby/dep_tag.cc2
-rw-r--r--ruby/environment.cc4
-rw-r--r--ruby/environment_TEST.rb4
-rw-r--r--ruby/package_database.cc8
-rw-r--r--ruby/package_database_TEST.rb12
-rw-r--r--ruby/paludis_ruby.cc20
-rw-r--r--ruby/paludis_ruby.hh6
-rw-r--r--ruby/paludis_ruby_TEST.rb16
-rw-r--r--ruby/portage_dep_parser.cc32
-rw-r--r--ruby/portage_dep_parser_TEST.rb62
-rw-r--r--ruby/qualified_package_name_TEST.rb4
-rw-r--r--ruby/query.cc6
-rw-r--r--ruby/query_TEST.rb2
-rw-r--r--ruby/repository_TEST.rb4
-rw-r--r--ruby/version_metadata.cc24
-rw-r--r--ruby/version_metadata_TEST.rb10
-rw-r--r--src/clients/adjutrix/command_line.cc6
-rw-r--r--src/clients/adjutrix/downgrade_check.cc2
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc22
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc46
-rw-r--r--src/clients/adjutrix/keywords_graph.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc4
-rw-r--r--src/clients/contrarius/contrarius_stage_options.sr8
-rw-r--r--src/clients/contrarius/install.cc6
-rw-r--r--src/clients/contrarius/install.hh4
-rw-r--r--src/clients/contrarius/stage.cc12
-rw-r--r--src/clients/contrarius/stage.hh2
-rw-r--r--src/clients/gtkpaludis/install.cc4
-rw-r--r--src/clients/gtkpaludis/install.hh4
-rw-r--r--src/clients/gtkpaludis/package_overview.cc6
-rw-r--r--src/clients/gtkpaludis/packages_list.cc4
-rw-r--r--src/clients/gtkpaludis/queue_list.cc4
-rw-r--r--src/clients/gtkpaludis/set_overview.cc60
-rw-r--r--src/clients/inquisitio/do_search.cc2
-rw-r--r--src/clients/paludis/applets.cc18
-rw-r--r--src/clients/paludis/command_line.cc18
-rw-r--r--src/clients/paludis/command_line.hh5
-rw-r--r--src/clients/paludis/do_config.cc10
-rw-r--r--src/clients/paludis/do_contents.cc10
-rw-r--r--src/clients/paludis/install.cc16
-rw-r--r--src/clients/paludis/paludis.cc10
-rw-r--r--src/clients/paludis/query.cc22
-rw-r--r--src/clients/paludis/uninstall.cc2
-rw-r--r--src/output/console_install_task.cc8
-rw-r--r--src/output/console_install_task.hh4
-rw-r--r--src/output/console_query_task.cc42
-rw-r--r--src/output/console_query_task.hh14
-rw-r--r--src/output/licence.cc24
-rw-r--r--src/output/licence.hh16
138 files changed, 1933 insertions, 1922 deletions
diff --git a/doc/examples/pwp_basic_cplusplus_app.cc b/doc/examples/pwp_basic_cplusplus_app.cc
index 3e25d7f..adf693b 100644
--- a/doc/examples/pwp_basic_cplusplus_app.cc
+++ b/doc/examples/pwp_basic_cplusplus_app.cc
@@ -17,7 +17,7 @@ int main(int, char *[])
{
std::tr1::shared_ptr<const paludis::PackageDatabaseEntryCollection> packages(
paludis::DefaultEnvironment::get_instance()->package_database()->query(
- paludis::PackageDepAtom("app-editors/vim"), paludis::is_installed_only, paludis::qo_order_by_version));
+ paludis::PackageDepSpec("app-editors/vim"), paludis::is_installed_only, paludis::qo_order_by_version));
if (packages->empty())
cout << "Vim is not installed" << endl;
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 2ce4aeb..1eebcc7 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -17,9 +17,9 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
-#include <paludis/dep_atom_pretty_printer.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/dep_list/dep_list.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/dep_list/range_rewriter.hh>
@@ -85,7 +85,7 @@ namespace paludis
MergeListIndex merge_list_index;
- std::tr1::shared_ptr<const DepAtom> current_top_level_target;
+ std::tr1::shared_ptr<const DepSpec> current_top_level_target;
bool throw_on_blocker;
@@ -225,13 +225,13 @@ namespace
}
};
- struct MatchDepListEntryAgainstPackageDepAtom
+ struct MatchDepListEntryAgainstPackageDepSpec
{
const Environment * const env;
- const PackageDepAtom * const a;
+ const PackageDepSpec * const a;
- MatchDepListEntryAgainstPackageDepAtom(const Environment * const ee,
- const PackageDepAtom * const aa) :
+ MatchDepListEntryAgainstPackageDepSpec(const Environment * const ee,
+ const PackageDepSpec * const aa) :
env(ee),
a(aa)
{
@@ -261,20 +261,20 @@ namespace
}
};
- struct IsViableAnyDepAtomChild
+ struct IsViableAnyDepSpecChild
{
const Environment * const env;
const PackageDatabaseEntry * const pde;
- IsViableAnyDepAtomChild(const Environment * const e, const PackageDatabaseEntry * const p) :
+ IsViableAnyDepSpecChild(const Environment * const e, const PackageDatabaseEntry * const p) :
env(e),
pde(p)
{
}
- bool operator() (std::tr1::shared_ptr<const DepAtom> atom)
+ bool operator() (std::tr1::shared_ptr<const DepSpec> spec)
{
- const UseDepAtom * const u(atom->as_use_dep_atom());
+ const UseDepSpec * const u(spec->as_use_dep_spec());
if (0 != u)
return env->query_use(u->flag(), pde) ^ u->inverse();
else
@@ -282,21 +282,21 @@ namespace
}
};
- struct IsInterestingPDADepAtomChild
+ struct IsInterestingPDADepSpecChild
{
const Environment * const env;
- IsInterestingPDADepAtomChild(const Environment * const e) :
+ IsInterestingPDADepSpecChild(const Environment * const e) :
env(e)
{
}
- bool operator() (std::tr1::shared_ptr<const DepAtom> atom)
+ bool operator() (std::tr1::shared_ptr<const DepSpec> spec)
{
- const PackageDepAtom * const u(atom->as_package_dep_atom());
+ const PackageDepSpec * const u(spec->as_package_dep_spec());
if (0 != u)
{
- return ! env->package_database()->query(PackageDepAtom(u->package()),
+ return ! env->package_database()->query(PackageDepSpec(u->package()),
is_installed_only, qo_whatever)->empty();
}
else
@@ -306,7 +306,7 @@ namespace
}
struct DepList::QueryVisitor :
- DepAtomVisitorTypes::ConstVisitor
+ DepSpecVisitorTypes::ConstVisitor
{
bool result;
const DepList * const d;
@@ -319,22 +319,22 @@ struct DepList::QueryVisitor :
{
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const PackageDepAtom * const);
- void visit(const UseDepAtom * const);
- void visit(const AnyDepAtom * const);
- void visit(const BlockDepAtom * const);
- void visit(const AllDepAtom * const);
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PackageDepSpec * const);
+ void visit(const UseDepSpec * const);
+ void visit(const AnyDepSpec * const);
+ void visit(const BlockDepSpec * const);
+ void visit(const AllDepSpec * const);
};
void
-DepList::QueryVisitor::visit(const PlainTextDepAtom * const)
+DepList::QueryVisitor::visit(const PlainTextDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Got PlainTextDepAtom?");
+ throw InternalError(PALUDIS_HERE, "Got PlainTextDepSpec?");
}
void
-DepList::QueryVisitor::visit(const PackageDepAtom * const a)
+DepList::QueryVisitor::visit(const PackageDepSpec * const a)
{
/* a pda matches if we'll be installed by the time we reach the current point. This
* means that merely being installed is not enough, if we'll have our version changed
@@ -358,9 +358,9 @@ DepList::QueryVisitor::visit(const PackageDepAtom * const a)
d->_imp->merge_list_index.equal_range(a->package()));
bool replaced(false);
- PackageDepAtom atom(a->package());
+ PackageDepSpec spec(a->package());
while (p.second != ((p.first = std::find_if(p.first, p.second,
- MatchDepListEntryAgainstPackageDepAtom(d->_imp->env, &atom)))))
+ MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, &spec)))))
{
if (p.first->second->metadata->slot != slot)
p.first = next(p.first);
@@ -383,7 +383,7 @@ DepList::QueryVisitor::visit(const PackageDepAtom * const a)
d->_imp->merge_list_index.equal_range(a->package()));
if (p.second != std::find_if(p.first, p.second,
- MatchDepListEntryAgainstPackageDepAtom(d->_imp->env, a)))
+ MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, a)))
{
// TODO: check destination
result = true;
@@ -392,14 +392,14 @@ DepList::QueryVisitor::visit(const PackageDepAtom * const a)
}
void
-DepList::QueryVisitor::visit(const UseDepAtom * const a)
+DepList::QueryVisitor::visit(const UseDepSpec * const a)
{
- /* for use? ( ) dep atoms, return true if we're not enabled, so that
+ /* for use? ( ) dep specs, return true if we're not enabled, so that
* weird || ( ) cases work. */
if (d->_imp->env->query_use(a->flag(), d->_imp->current_pde()) ^ a->inverse())
{
result = true;
- for (CompositeDepAtom::Iterator c(a->begin()), c_end(a->end()) ; c != c_end ; ++c)
+ for (CompositeDepSpec::Iterator c(a->begin()), c_end(a->end()) ; c != c_end ; ++c)
{
(*c)->accept(this);
if (! result)
@@ -411,23 +411,23 @@ DepList::QueryVisitor::visit(const UseDepAtom * const a)
}
void
-DepList::QueryVisitor::visit(const AnyDepAtom * const a)
+DepList::QueryVisitor::visit(const AnyDepSpec * const a)
{
/* empty || ( ) must resolve to true */
- std::list<std::tr1::shared_ptr<const DepAtom> > viable_children;
+ std::list<std::tr1::shared_ptr<const DepSpec> > viable_children;
std::copy(a->begin(), a->end(), filter_inserter(std::back_inserter(viable_children),
- IsViableAnyDepAtomChild(d->_imp->env, d->_imp->current_pde())));
+ IsViableAnyDepSpecChild(d->_imp->env, d->_imp->current_pde())));
RangeRewriter r;
std::for_each(viable_children.begin(), viable_children.end(), accept_visitor(&r));
- if (r.atom())
+ if (r.spec())
{
viable_children.clear();
- viable_children.push_back(r.atom());
+ viable_children.push_back(r.spec());
}
result = true;
- for (std::list<std::tr1::shared_ptr<const DepAtom> >::const_iterator c(viable_children.begin()),
+ for (std::list<std::tr1::shared_ptr<const DepSpec> >::const_iterator c(viable_children.begin()),
c_end(viable_children.end()) ; c != c_end ; ++c)
{
(*c)->accept(this);
@@ -437,16 +437,16 @@ DepList::QueryVisitor::visit(const AnyDepAtom * const a)
}
void
-DepList::QueryVisitor::visit(const BlockDepAtom * const a)
+DepList::QueryVisitor::visit(const BlockDepSpec * const a)
{
- a->blocked_atom()->accept(this);
+ a->blocked_spec()->accept(this);
result = !result;
}
void
-DepList::QueryVisitor::visit(const AllDepAtom * const a)
+DepList::QueryVisitor::visit(const AllDepSpec * const a)
{
- for (CompositeDepAtom::Iterator c(a->begin()), c_end(a->end()) ; c != c_end ; ++c)
+ for (CompositeDepSpec::Iterator c(a->begin()), c_end(a->end()) ; c != c_end ; ++c)
{
(*c)->accept(this);
if (! result)
@@ -455,8 +455,8 @@ DepList::QueryVisitor::visit(const AllDepAtom * const a)
}
struct DepList::AddVisitor :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<AddVisitor, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<AddVisitor, AllDepSpec>
{
DepList * const d;
std::tr1::shared_ptr<const DestinationsCollection> destinations;
@@ -467,24 +467,24 @@ struct DepList::AddVisitor :
{
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const PackageDepAtom * const);
- void visit(const UseDepAtom * const);
- void visit(const AnyDepAtom * const);
- void visit(const BlockDepAtom * const);
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<AddVisitor, AllDepAtom>::visit;
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PackageDepSpec * const);
+ void visit(const UseDepSpec * const);
+ void visit(const AnyDepSpec * const);
+ void visit(const BlockDepSpec * const);
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<AddVisitor, AllDepSpec>::visit;
};
void
-DepList::AddVisitor::visit(const PlainTextDepAtom * const)
+DepList::AddVisitor::visit(const PlainTextDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Got PlainTextDepAtom?");
+ throw InternalError(PALUDIS_HERE, "Got PlainTextDepSpec?");
}
void
-DepList::AddVisitor::visit(const PackageDepAtom * const a)
+DepList::AddVisitor::visit(const PackageDepSpec * const a)
{
- Context context("When adding PackageDepAtom '" + stringify(*a) + "':");
+ Context context("When adding PackageDepSpec '" + stringify(*a) + "':");
/* find already installed things */
// TODO: check destinations
@@ -495,7 +495,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
std::pair<MergeListIndex::iterator, MergeListIndex::iterator> q(
d->_imp->merge_list_index.equal_range(a->package()));
MergeListIndex::iterator qq(std::find_if(q.first, q.second,
- MatchDepListEntryAgainstPackageDepAtom(d->_imp->env, a)));
+ MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, a)));
MergeList::iterator existing_merge_list_entry(qq == q.second ? d->_imp->merge_list.end() : qq->second);
if (existing_merge_list_entry != d->_imp->merge_list.end())
@@ -727,7 +727,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
case dl_downgrade_warning:
{
std::tr1::shared_ptr<PackageDatabaseEntryCollection> are_we_downgrading(
- d->_imp->env->package_database()->query(PackageDepAtom(
+ d->_imp->env->package_database()->query(PackageDepSpec(
stringify(a->package()) + ":" + stringify(slot)),
is_installed_only, qo_order_by_version));
@@ -764,7 +764,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
}
void
-DepList::AddVisitor::visit(const UseDepAtom * const a)
+DepList::AddVisitor::visit(const UseDepSpec * const a)
{
if (d->_imp->opts->use == dl_use_deps_standard)
{
@@ -791,27 +791,27 @@ DepList::AddVisitor::visit(const UseDepAtom * const a)
}
void
-DepList::AddVisitor::visit(const AnyDepAtom * const a)
+DepList::AddVisitor::visit(const AnyDepSpec * const a)
{
/* annoying requirement: || ( foo? ( ... ) ) resolves to empty if !foo. */
- std::list<std::tr1::shared_ptr<const DepAtom> > viable_children;
+ std::list<std::tr1::shared_ptr<const DepSpec> > viable_children;
std::copy(a->begin(), a->end(), filter_inserter(std::back_inserter(viable_children),
- IsViableAnyDepAtomChild(d->_imp->env, d->_imp->current_pde())));
+ IsViableAnyDepSpecChild(d->_imp->env, d->_imp->current_pde())));
if (viable_children.empty())
return;
RangeRewriter r;
std::for_each(viable_children.begin(), viable_children.end(), accept_visitor(&r));
- if (r.atom())
+ if (r.spec())
{
viable_children.clear();
- viable_children.push_back(r.atom());
+ viable_children.push_back(r.spec());
}
/* see if any of our children is already installed. if any is, add it so that
* any upgrades kick in */
- for (std::list<std::tr1::shared_ptr<const DepAtom> >::const_iterator c(viable_children.begin()),
+ for (std::list<std::tr1::shared_ptr<const DepSpec> >::const_iterator c(viable_children.begin()),
c_end(viable_children.end()) ; c != c_end ; ++c)
{
if (d->already_installed(**c, destinations))
@@ -823,11 +823,11 @@ DepList::AddVisitor::visit(const AnyDepAtom * const a)
/* if we have something like || ( a >=b-2 ) and b-1 is installed, try to go for
* the b-2 bit first */
- std::list<std::tr1::shared_ptr<const DepAtom> > pda_children;
+ std::list<std::tr1::shared_ptr<const DepSpec> > pda_children;
std::copy(viable_children.begin(), viable_children.end(),
- filter_inserter(std::back_inserter(pda_children), IsInterestingPDADepAtomChild(d->_imp->env)));
+ filter_inserter(std::back_inserter(pda_children), IsInterestingPDADepSpecChild(d->_imp->env)));
- for (std::list<std::tr1::shared_ptr<const DepAtom> >::const_iterator c(pda_children.begin()),
+ for (std::list<std::tr1::shared_ptr<const DepSpec> >::const_iterator c(pda_children.begin()),
c_end(pda_children.end()) ; c != c_end ; ++c)
{
try
@@ -844,7 +844,7 @@ DepList::AddVisitor::visit(const AnyDepAtom * const a)
}
/* install first available viable option */
- for (std::list<std::tr1::shared_ptr<const DepAtom> >::const_iterator c(viable_children.begin()),
+ for (std::list<std::tr1::shared_ptr<const DepSpec> >::const_iterator c(viable_children.begin()),
c_end(viable_children.end()) ; c != c_end ; ++c)
{
try
@@ -869,23 +869,23 @@ DepList::AddVisitor::visit(const AnyDepAtom * const a)
}
void
-DepList::AddVisitor::visit(const BlockDepAtom * const a)
+DepList::AddVisitor::visit(const BlockDepSpec * const a)
{
if (dl_blocks_discard_completely == d->_imp->opts->blocks)
return;
// TODO: check destinations
- Context context("When checking BlockDepAtom '!" + stringify(*a->blocked_atom()) + "':");
+ Context context("When checking BlockDepSpec '!" + stringify(*a->blocked_spec()) + "':");
- PackageDepAtom just_package(a->blocked_atom()->package());
+ PackageDepSpec just_package(a->blocked_spec()->package());
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> already_installed(d->_imp->env->package_database()->query(
just_package, is_installed_only, qo_whatever));
std::list<MergeList::const_iterator> will_be_installed;
- MatchDepListEntryAgainstPackageDepAtom m(d->_imp->env, &just_package);
+ MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, &just_package);
for (std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
- d->_imp->merge_list_index.equal_range(a->blocked_atom()->package())) ;
+ d->_imp->merge_list_index.equal_range(a->blocked_spec()->package())) ;
p.first != p.second ; ++p.first)
{
if (d->_imp->current_merge_list_entry != d->_imp->merge_list.end())
@@ -907,7 +907,7 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
for (PackageDatabaseEntryCollection::Iterator aa(already_installed->begin()),
aa_end(already_installed->end()) ; aa != aa_end ; ++aa)
{
- if (! match_package(*d->_imp->env, *a->blocked_atom(), *aa))
+ if (! match_package(*d->_imp->env, *a->blocked_spec(), *aa))
continue;
std::tr1::shared_ptr<const VersionMetadata> metadata(d->_imp->env->package_database()->fetch_repository(
@@ -932,8 +932,8 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
* ourself */
- if (! (a->blocked_atom()->version_requirements_ptr() || a->blocked_atom()->slot_ptr()
- || a->blocked_atom()->use_requirements_ptr() || a->blocked_atom()->repository_ptr())
+ if (! (a->blocked_spec()->version_requirements_ptr() || a->blocked_spec()->slot_ptr()
+ || a->blocked_spec()->use_requirements_ptr() || a->blocked_spec()->repository_ptr())
&& d->_imp->current_pde())
{
if (aa->name == d->_imp->current_pde()->name)
@@ -947,11 +947,11 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
switch (d->_imp->throw_on_blocker ? dl_blocks_error : d->_imp->opts->blocks)
{
case dl_blocks_error:
- throw BlockError(stringify(*a->blocked_atom()));
+ throw BlockError(stringify(*a->blocked_spec()));
case dl_blocks_discard:
Log::get_instance()->message(ll_warning, lc_context, "Discarding block '!"
- + stringify(*a->blocked_atom()) + "'");
+ + stringify(*a->blocked_spec()) + "'");
break;
case dl_blocks_discard_completely:
@@ -969,13 +969,13 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
for (std::list<MergeList::const_iterator>::const_iterator r(will_be_installed.begin()),
r_end(will_be_installed.end()) ; r != r_end ; ++r)
{
- if (! match_package(*d->_imp->env, *a->blocked_atom(), (*r)->package))
+ if (! match_package(*d->_imp->env, *a->blocked_spec(), (*r)->package))
continue;
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
* ourself */
- if (! (a->blocked_atom()->version_requirements_ptr() || a->blocked_atom()->slot_ptr()
- || a->blocked_atom()->use_requirements_ptr() || a->blocked_atom()->repository_ptr())
+ if (! (a->blocked_spec()->version_requirements_ptr() || a->blocked_spec()->slot_ptr()
+ || a->blocked_spec()->use_requirements_ptr() || a->blocked_spec()->repository_ptr())
&& d->_imp->current_pde())
{
if ((*r)->package.name == d->_imp->current_pde()->name)
@@ -986,14 +986,14 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
continue;
}
- throw BlockError(stringify(*a->blocked_atom()));
+ throw BlockError(stringify(*a->blocked_spec()));
}
}
struct DepList::ShowSuggestVisitor :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AnyDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AnyDepSpec>
{
DepList * const d;
std::tr1::shared_ptr<const DestinationsCollection> destinations;
@@ -1004,34 +1004,34 @@ struct DepList::ShowSuggestVisitor :
{
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const PackageDepAtom * const);
- void visit(const UseDepAtom * const);
- void visit(const BlockDepAtom * const);
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AnyDepAtom>::visit;
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PackageDepSpec * const);
+ void visit(const UseDepSpec * const);
+ void visit(const BlockDepSpec * const);
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ShowSuggestVisitor, AnyDepSpec>::visit;
};
void
-DepList::ShowSuggestVisitor::visit(const PlainTextDepAtom * const)
+DepList::ShowSuggestVisitor::visit(const PlainTextDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Got PlainTextDepAtom?");
+ throw InternalError(PALUDIS_HERE, "Got PlainTextDepSpec?");
}
void
-DepList::ShowSuggestVisitor::visit(const UseDepAtom * const a)
+DepList::ShowSuggestVisitor::visit(const UseDepSpec * const a)
{
if (d->_imp->env->query_use(a->flag(), d->_imp->current_pde()) ^ a->inverse())
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
void
-DepList::ShowSuggestVisitor::visit(const BlockDepAtom * const)
+DepList::ShowSuggestVisitor::visit(const BlockDepSpec * const)
{
}
void
-DepList::ShowSuggestVisitor::visit(const PackageDepAtom * const a)
+DepList::ShowSuggestVisitor::visit(const PackageDepSpec * const a)
{
Context context("When adding suggested dep '" + stringify(*a) + "':");
@@ -1079,23 +1079,23 @@ DepList::clear()
}
void
-DepList::add_in_role(std::tr1::shared_ptr<const DepAtom> atom, const std::string & role,
+DepList::add_in_role(std::tr1::shared_ptr<const DepSpec> spec, const std::string & role,
std::tr1::shared_ptr<const DestinationsCollection> destinations)
{
Context context("When adding " + role + ":");
- add(atom, destinations);
+ add(spec, destinations);
}
void
-DepList::add(std::tr1::shared_ptr<const DepAtom> atom, std::tr1::shared_ptr<const DestinationsCollection> destinations)
+DepList::add(std::tr1::shared_ptr<const DepSpec> spec, std::tr1::shared_ptr<const DestinationsCollection> destinations)
{
DepListTransaction transaction(_imp->merge_list, _imp->merge_list_index, _imp->merge_list_generation);
- Save<std::tr1::shared_ptr<const DepAtom> > save_current_top_level_target(&_imp->current_top_level_target,
- _imp->current_top_level_target ? _imp->current_top_level_target : atom);
+ Save<std::tr1::shared_ptr<const DepSpec> > save_current_top_level_target(&_imp->current_top_level_target,
+ _imp->current_top_level_target ? _imp->current_top_level_target : spec);
AddVisitor visitor(this, destinations);
- atom->accept(&visitor);
+ spec->accept(&visitor);
transaction.commit();
}
@@ -1152,15 +1152,15 @@ DepList::add_package(const PackageDatabaseEntry & p, std::tr1::shared_ptr<const
/* add provides */
if (metadata->ebuild_interface)
{
- DepAtomFlattener f(_imp->env, _imp->current_pde(), metadata->ebuild_interface->provide());
- for (DepAtomFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
+ DepSpecFlattener f(_imp->env, _imp->current_pde(), metadata->ebuild_interface->provide());
+ for (DepSpecFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
{
- std::tr1::shared_ptr<PackageDepAtom> pp(new PackageDepAtom("=" + (*i)->text() + "-" + stringify(p.version)));
+ std::tr1::shared_ptr<PackageDepSpec> pp(new PackageDepSpec("=" + (*i)->text() + "-" + stringify(p.version)));
std::pair<MergeListIndex::iterator, MergeListIndex::iterator> z(
_imp->merge_list_index.equal_range(pp->package()));
MergeListIndex::iterator zz(std::find_if(z.first, z.second,
- MatchDepListEntryAgainstPackageDepAtom(_imp->env, pp.get())));
+ MatchDepListEntryAgainstPackageDepSpec(_imp->env, pp.get())));
if (z.first != z.second)
continue;
@@ -1312,7 +1312,7 @@ DepList::add_suggested_package(const PackageDatabaseEntry & p,
}
void
-DepList::add_predeps(std::tr1::shared_ptr<const DepAtom> d, const DepListDepsOption opt, const std::string & s,
+DepList::add_predeps(std::tr1::shared_ptr<const DepSpec> d, const DepListDepsOption opt, const std::string & s,
std::tr1::shared_ptr<const DestinationsCollection> destinations)
{
if (dl_deps_pre == opt || dl_deps_pre_or_post == opt)
@@ -1333,7 +1333,7 @@ DepList::add_predeps(std::tr1::shared_ptr<const DepAtom> d, const DepListDepsOpt
}
void
-DepList::add_postdeps(std::tr1::shared_ptr<const DepAtom> d, const DepListDepsOption opt, const std::string & s,
+DepList::add_postdeps(std::tr1::shared_ptr<const DepSpec> d, const DepListDepsOption opt, const std::string & s,
std::tr1::shared_ptr<const DestinationsCollection> destinations)
{
if (dl_deps_pre_or_post == opt || dl_deps_post == opt || dl_deps_try_post == opt)
@@ -1549,10 +1549,10 @@ DepList::prefer_installed_over_uninstalled(const PackageDatabaseEntry & installe
}
bool
-DepList::already_installed(const DepAtom & atom, std::tr1::shared_ptr<const DestinationsCollection> destinations) const
+DepList::already_installed(const DepSpec & spec, std::tr1::shared_ptr<const DestinationsCollection> destinations) const
{
QueryVisitor visitor(this, destinations);
- atom.accept(&visitor);
+ spec.accept(&visitor);
return visitor.result;
}
diff --git a/paludis/dep_list/dep_list.hh b/paludis/dep_list/dep_list.hh
index a1d44a6..bdf4f36 100644
--- a/paludis/dep_list/dep_list.hh
+++ b/paludis/dep_list/dep_list.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEP_LIST_HH
#define PALUDIS_GUARD_PALUDIS_DEP_LIST_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/dep_tag.hh>
#include <paludis/dep_list/options.hh>
#include <paludis/name.hh>
@@ -61,7 +61,7 @@ namespace paludis
std::tr1::shared_ptr<Repository> find_destination(const PackageDatabaseEntry &,
std::tr1::shared_ptr<const DestinationsCollection>);
- void add_in_role(std::tr1::shared_ptr<const DepAtom>, const std::string & role,
+ void add_in_role(std::tr1::shared_ptr<const DepSpec>, const std::string & role,
std::tr1::shared_ptr<const DestinationsCollection>);
bool prefer_installed_over_uninstalled(const PackageDatabaseEntry &,
const PackageDatabaseEntry &);
@@ -74,9 +74,9 @@ namespace paludis
void add_suggested_package(const PackageDatabaseEntry &,
std::tr1::shared_ptr<const DestinationsCollection> destinations);
- void add_predeps(std::tr1::shared_ptr<const DepAtom>, const DepListDepsOption, const std::string &,
+ void add_predeps(std::tr1::shared_ptr<const DepSpec>, const DepListDepsOption, const std::string &,
std::tr1::shared_ptr<const DestinationsCollection> destinations);
- void add_postdeps(std::tr1::shared_ptr<const DepAtom>, const DepListDepsOption, const std::string &,
+ void add_postdeps(std::tr1::shared_ptr<const DepSpec>, const DepListDepsOption, const std::string &,
std::tr1::shared_ptr<const DestinationsCollection> destinations);
bool is_top_level_target(const PackageDatabaseEntry &) const;
@@ -98,9 +98,9 @@ namespace paludis
/**
* Add the packages required to resolve an additional dependency
- * atom.
+ * spec.
*/
- void add(std::tr1::shared_ptr<const DepAtom>,
+ void add(std::tr1::shared_ptr<const DepSpec>,
std::tr1::shared_ptr<const DestinationsCollection> target_destinations);
/**
@@ -109,9 +109,9 @@ namespace paludis
void clear();
/**
- * Return whether an atom structure already installed.
+ * Return whether a spec structure is already installed.
*/
- bool already_installed(const DepAtom &,
+ bool already_installed(const DepSpec &,
std::tr1::shared_ptr<const DestinationsCollection> target_destinations) const;
/**
diff --git a/paludis/dep_list/exceptions.hh b/paludis/dep_list/exceptions.hh
index 99091fd..2c7d347 100644
--- a/paludis/dep_list/exceptions.hh
+++ b/paludis/dep_list/exceptions.hh
@@ -45,7 +45,7 @@ namespace paludis
};
/**
- * Thrown if all versions of a particular atom are masked.
+ * Thrown if all versions of a particular spec are masked.
*
* \ingroup grpdepresolver
* \ingroup grpexceptions
@@ -78,7 +78,7 @@ namespace paludis
};
/**
- * Thrown if all versions of a particular atom are masked,
+ * Thrown if all versions of a particular spec are masked,
* but would not be if use requirements were not in effect.
*
* \ingroup grpdepresolver
diff --git a/paludis/dep_list/range_rewriter.cc b/paludis/dep_list/range_rewriter.cc
index 3b4d263..75dae7f 100644
--- a/paludis/dep_list/range_rewriter.cc
+++ b/paludis/dep_list/range_rewriter.cc
@@ -31,33 +31,33 @@ RangeRewriter::~RangeRewriter()
}
void
-RangeRewriter::visit(const AllDepAtom * a)
+RangeRewriter::visit(const AllDepSpec * a)
{
if (a->begin() != a->end())
_invalid = true;
}
void
-RangeRewriter::visit(const AnyDepAtom * a)
+RangeRewriter::visit(const AnyDepSpec * a)
{
if (a->begin() != a->end())
_invalid = true;
}
void
-RangeRewriter::visit(const UseDepAtom *)
+RangeRewriter::visit(const UseDepSpec *)
{
_invalid = true;
}
void
-RangeRewriter::visit(const PlainTextDepAtom *)
+RangeRewriter::visit(const PlainTextDepSpec *)
{
_invalid = true;
}
void
-RangeRewriter::visit(const PackageDepAtom * a)
+RangeRewriter::visit(const PackageDepSpec * a)
{
if (_invalid)
return;
@@ -75,9 +75,9 @@ RangeRewriter::visit(const PackageDepAtom * a)
return;
}
- if (_atom)
+ if (_spec)
{
- if (a->package() != _atom->package())
+ if (a->package() != _spec->package())
{
_invalid = true;
return;
@@ -85,17 +85,17 @@ RangeRewriter::visit(const PackageDepAtom * a)
for (VersionRequirements::Iterator v(a->version_requirements_ptr()->begin()),
v_end(a->version_requirements_ptr()->end()) ; v != v_end ; ++v)
- _atom->version_requirements_ptr()->push_back(*v);
+ _spec->version_requirements_ptr()->push_back(*v);
}
else
{
- _atom.reset(new PackageDepAtom(*a));
- _atom->set_version_requirements_mode(vr_or);
+ _spec.reset(new PackageDepSpec(*a));
+ _spec->set_version_requirements_mode(vr_or);
}
}
void
-RangeRewriter::visit(const BlockDepAtom *)
+RangeRewriter::visit(const BlockDepSpec *)
{
_invalid = true;
}
diff --git a/paludis/dep_list/range_rewriter.hh b/paludis/dep_list/range_rewriter.hh
index 9a3ef5c..40884d7 100644
--- a/paludis/dep_list/range_rewriter.hh
+++ b/paludis/dep_list/range_rewriter.hh
@@ -20,35 +20,35 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEP_LIST_RANGE_REWRITER_HH
#define PALUDIS_GUARD_PALUDIS_DEP_LIST_RANGE_REWRITER_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
namespace paludis
{
class RangeRewriter :
- public DepAtomVisitorTypes::ConstVisitor
+ public DepSpecVisitorTypes::ConstVisitor
{
private:
- std::tr1::shared_ptr<PackageDepAtom> _atom;
+ std::tr1::shared_ptr<PackageDepSpec> _spec;
bool _invalid;
public:
RangeRewriter();
virtual ~RangeRewriter();
- std::tr1::shared_ptr<const PackageDepAtom> atom() const
+ std::tr1::shared_ptr<const PackageDepSpec> spec() const
{
if (_invalid)
- return std::tr1::shared_ptr<const PackageDepAtom>();
+ return std::tr1::shared_ptr<const PackageDepSpec>();
- return _atom;
+ return _spec;
}
- void visit(const AllDepAtom *);
- void visit(const AnyDepAtom *);
- void visit(const UseDepAtom *);
- void visit(const PlainTextDepAtom *);
- void visit(const PackageDepAtom *);
- void visit(const BlockDepAtom *);
+ void visit(const AllDepSpec *);
+ void visit(const AnyDepSpec *);
+ void visit(const UseDepSpec *);
+ void visit(const PlainTextDepSpec *);
+ void visit(const PackageDepSpec *);
+ void visit(const BlockDepSpec *);
};
}
diff --git a/paludis/dep_list/range_rewriter_TEST.cc b/paludis/dep_list/range_rewriter_TEST.cc
index 50ea97d..f1f0b5c 100644
--- a/paludis/dep_list/range_rewriter_TEST.cc
+++ b/paludis/dep_list/range_rewriter_TEST.cc
@@ -18,8 +18,8 @@
*/
#include <paludis/dep_list/range_rewriter.hh>
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_pretty_printer.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/portage_dep_parser.hh>
#include <test/test_runner.hh>
@@ -37,15 +37,15 @@ namespace test_cases
void run()
{
- std::tr1::shared_ptr<const CompositeDepAtom> p(PortageDepParser::parse_depend("=a/b-1 =a/b-2"));
+ std::tr1::shared_ptr<const CompositeDepSpec> p(PortageDepParser::parse_depend("=a/b-1 =a/b-2"));
RangeRewriter r;
- TEST_CHECK(! r.atom());
+ TEST_CHECK(! r.spec());
std::for_each(p->begin(), p->end(), accept_visitor(&r));
- TEST_CHECK(r.atom());
+ TEST_CHECK(r.spec());
- DepAtomPrettyPrinter w(0, false);
- r.atom()->accept(&w);
+ DepSpecPrettyPrinter w(0, false);
+ r.spec()->accept(&w);
TEST_CHECK_STRINGIFY_EQUAL(w, "=|=a/b-1,2 ");
}
} test_range_rewriter;
diff --git a/paludis/dep_list/uninstall_list.cc b/paludis/dep_list/uninstall_list.cc
index ac91104..53e48db 100644
--- a/paludis/dep_list/uninstall_list.cc
+++ b/paludis/dep_list/uninstall_list.cc
@@ -236,12 +236,12 @@ UninstallList::collect_all_installed() const
namespace
{
struct DepCollector :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AnyDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AnyDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<DepCollector, AnyDepSpec>::visit;
const Environment * const env;
const PackageDatabaseEntry pkg;
@@ -254,26 +254,26 @@ namespace
{
}
- void visit(const PackageDepAtom * const a)
+ void visit(const PackageDepSpec * const a)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> m(env->package_database()->query(
*a, is_installed_only, qo_order_by_version));
matches->insert(m->begin(), m->end());
}
- void visit(const UseDepAtom * const u)
+ void visit(const UseDepSpec * const u)
{
if (env->query_use(UseFlagName(u->flag()), &pkg) ^ u->inverse())
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn))
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "Got PlainTextDepAtom?");
+ throw InternalError(PALUDIS_HERE, "Got PlainTextDepSpec?");
}
};
}
@@ -361,7 +361,7 @@ UninstallList::add_unused_dependencies()
ArbitrarilyOrderedPackageDatabaseEntryCollectionComparator());
/* if any of them aren't already on the list, and aren't in world, add them and recurse */
- std::tr1::shared_ptr<DepAtom> world(_imp->env->package_set(SetName("world")));
+ std::tr1::shared_ptr<DepSpec> world(_imp->env->package_set(SetName("world")));
for (PackageDatabaseEntryCollection::Iterator i(unused_dependencies->begin()),
i_end(unused_dependencies->end()) ; i != i_end ; ++i)
{
@@ -428,7 +428,7 @@ UninstallList::collect_world() const
new ArbitrarilyOrderedPackageDatabaseEntryCollection::Concrete);
std::tr1::shared_ptr<const ArbitrarilyOrderedPackageDatabaseEntryCollection> everything(collect_all_installed());
- std::tr1::shared_ptr<DepAtom> world(_imp->env->package_set(SetName("world")));
+ std::tr1::shared_ptr<DepSpec> world(_imp->env->package_set(SetName("world")));
for (PackageDatabaseEntryCollection::Iterator i(everything->begin()),
i_end(everything->end()) ; i != i_end ; ++i)
if (match_package_in_heirarchy(*_imp->env, *world, *i))
diff --git a/paludis/dep_atom.cc b/paludis/dep_spec.cc
index ad9e5b6..3f45d26 100644
--- a/paludis/dep_atom.cc
+++ b/paludis/dep_spec.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/util/log.hh>
#include <paludis/util/collection_concrete.hh>
@@ -25,29 +25,29 @@
#include <map>
/** \file
- * Implementation for dep_atom.hh things.
+ * Implementation for dep_spec.hh things.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
using namespace paludis;
-DepAtom::DepAtom()
+DepSpec::DepSpec()
{
}
-DepAtom::~DepAtom()
+DepSpec::~DepSpec()
{
}
-const UseDepAtom *
-DepAtom::as_use_dep_atom() const
+const UseDepSpec *
+DepSpec::as_use_dep_spec() const
{
return 0;
}
-const PackageDepAtom *
-DepAtom::as_package_dep_atom() const
+const PackageDepSpec *
+DepSpec::as_package_dep_spec() const
{
return 0;
}
@@ -55,87 +55,87 @@ DepAtom::as_package_dep_atom() const
namespace paludis
{
/**
- * Implementation data for CompositeDepAtom.
+ * Implementation data for CompositeDepSpec.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
template<>
- struct Implementation<CompositeDepAtom>
+ struct Implementation<CompositeDepSpec>
{
- std::list<std::tr1::shared_ptr<const DepAtom> > children;
+ std::list<std::tr1::shared_ptr<const DepSpec> > children;
};
}
-CompositeDepAtom::CompositeDepAtom() :
- PrivateImplementationPattern<CompositeDepAtom>(new Implementation<CompositeDepAtom>)
+CompositeDepSpec::CompositeDepSpec() :
+ PrivateImplementationPattern<CompositeDepSpec>(new Implementation<CompositeDepSpec>)
{
}
-CompositeDepAtom::~CompositeDepAtom()
+CompositeDepSpec::~CompositeDepSpec()
{
}
void
-CompositeDepAtom::add_child(std::tr1::shared_ptr<const DepAtom> c)
+CompositeDepSpec::add_child(std::tr1::shared_ptr<const DepSpec> c)
{
_imp->children.push_back(c);
}
-CompositeDepAtom::Iterator
-CompositeDepAtom::begin() const
+CompositeDepSpec::Iterator
+CompositeDepSpec::begin() const
{
return Iterator(_imp->children.begin());
}
-CompositeDepAtom::Iterator
-CompositeDepAtom::end() const
+CompositeDepSpec::Iterator
+CompositeDepSpec::end() const
{
return Iterator(_imp->children.end());
}
-AnyDepAtom::AnyDepAtom()
+AnyDepSpec::AnyDepSpec()
{
}
-AllDepAtom::AllDepAtom()
+AllDepSpec::AllDepSpec()
{
}
-UseDepAtom::UseDepAtom(const UseFlagName & our_flag, bool is_inverse) :
+UseDepSpec::UseDepSpec(const UseFlagName & our_flag, bool is_inverse) :
_flag(our_flag),
_inverse(is_inverse)
{
}
-const UseDepAtom *
-UseDepAtom::as_use_dep_atom() const
+const UseDepSpec *
+UseDepSpec::as_use_dep_spec() const
{
return this;
}
-const PackageDepAtom *
-PackageDepAtom::as_package_dep_atom() const
+const PackageDepSpec *
+PackageDepSpec::as_package_dep_spec() const
{
return this;
}
-BlockDepAtom::BlockDepAtom(std::tr1::shared_ptr<const PackageDepAtom> a) :
- StringDepAtom("!" + a->text()),
- _atom(a)
+BlockDepSpec::BlockDepSpec(std::tr1::shared_ptr<const PackageDepSpec> a) :
+ StringDepSpec("!" + a->text()),
+ _spec(a)
{
}
-PackageDepAtom::PackageDepAtom(const QualifiedPackageName & our_package) :
- StringDepAtom(stringify(our_package)),
+PackageDepSpec::PackageDepSpec(const QualifiedPackageName & our_package) :
+ StringDepSpec(stringify(our_package)),
_package(our_package),
_version_requirements_mode(vr_and)
{
}
-PackageDepAtom::PackageDepAtom(const PackageDepAtom & other) :
- VisitableInterface<DepAtomVisitorTypes>(other),
- StringDepAtom(stringify(other)),
- Visitable<PackageDepAtom, DepAtomVisitorTypes>(other),
+PackageDepSpec::PackageDepSpec(const PackageDepSpec & other) :
+ VisitableInterface<DepSpecVisitorTypes>(other),
+ StringDepSpec(stringify(other)),
+ Visitable<PackageDepSpec, DepSpecVisitorTypes>(other),
_package(other._package),
_version_requirements_mode(other._version_requirements_mode),
_slot(other._slot),
@@ -151,43 +151,43 @@ PackageDepAtom::PackageDepAtom(const PackageDepAtom & other) :
}
}
-PackageDepAtom::PackageDepAtom(const std::string & ss) :
- StringDepAtom(ss),
+PackageDepSpec::PackageDepSpec(const std::string & ss) :
+ StringDepSpec(ss),
_package(CategoryNamePart("later"), PackageNamePart("later")),
_version_requirements_mode(vr_and)
{
- Context context("When parsing package dep atom '" + ss + "':");
+ Context context("When parsing package dep spec '" + ss + "':");
try
{
std::string s(ss);
if (s.empty())
- throw PackageDepAtomError("Got empty dep atom");
+ throw PackageDepSpecError("Got empty dep spec");
std::string::size_type use_group_p;
while (std::string::npos != ((use_group_p = s.rfind('['))))
{
if (s.at(s.length() - 1) != ']')
- throw PackageDepAtomError("Mismatched []");
+ throw PackageDepSpecError("Mismatched []");
std::string flag(s.substr(use_group_p + 1));
UseFlagState state(use_enabled);
if (flag.length() < 2)
- throw PackageDepAtomError("Invalid [] contents");
+ throw PackageDepSpecError("Invalid [] contents");
flag.erase(flag.length() - 1);
if ('-' == flag.at(0))
{
state = use_disabled;
flag.erase(0, 1);
if (flag.empty())
- throw PackageDepAtomError("Invalid [] contents");
+ throw PackageDepSpecError("Invalid [] contents");
}
UseFlagName name(flag);
if (0 == _use_requirements)
_use_requirements.reset(new UseRequirements);
if (! _use_requirements->insert(name, state))
- throw PackageDepAtomError("Conflicting [] contents");
+ throw PackageDepSpecError("Conflicting [] contents");
s.erase(use_group_p);
}
@@ -218,10 +218,10 @@ PackageDepAtom::PackageDepAtom(const std::string & ss) :
while (true)
{
if (p >= s.length())
- throw PackageDepAtomError("Couldn't parse dep atom '" + ss + "'");
+ throw PackageDepSpecError("Couldn't parse dep spec '" + ss + "'");
q = s.find('-', q + 1);
if ((std::string::npos == q) || (++q >= s.length()))
- throw PackageDepAtomError("Couldn't parse dep atom '" + ss + "'");
+ throw PackageDepSpecError("Couldn't parse dep spec '" + ss + "'");
if ((s.at(q) >= '0' && s.at(q) <= '9') || (0 == s.compare(q, 3, "scm")))
break;
}
@@ -246,7 +246,7 @@ PackageDepAtom::PackageDepAtom(const std::string & ss) :
{
if (op != vo_equal)
Log::get_instance()->message(ll_qa, lc_context,
- "Package dep atom '" + ss + "' uses * "
+ "Package dep spec '" + ss + "' uses * "
"with operator '" + stringify(op) +
"', pretending it uses the equals operator instead");
op = vo_equal_star;
@@ -269,19 +269,19 @@ PackageDepAtom::PackageDepAtom(const std::string & ss) :
}
}
-PackageDepAtom::~PackageDepAtom()
+PackageDepSpec::~PackageDepSpec()
{
}
std::ostream &
-paludis::operator<< (std::ostream & s, const PlainTextDepAtom & a)
+paludis::operator<< (std::ostream & s, const PlainTextDepSpec & a)
{
s << a.text();
return s;
}
std::ostream &
-paludis::operator<< (std::ostream & s, const PackageDepAtom & a)
+paludis::operator<< (std::ostream & s, const PackageDepSpec & a)
{
if (a.version_requirements_ptr())
{
@@ -357,23 +357,23 @@ paludis::operator<< (std::ostream & s, const PackageDepAtom & a)
return s;
}
-PackageDepAtomError::PackageDepAtomError(const std::string & msg) throw () :
+PackageDepSpecError::PackageDepSpecError(const std::string & msg) throw () :
Exception(msg)
{
}
-StringDepAtom::StringDepAtom(const std::string & s) :
+StringDepSpec::StringDepSpec(const std::string & s) :
_str(s)
{
}
-StringDepAtom::~StringDepAtom()
+StringDepSpec::~StringDepSpec()
{
}
-PlainTextDepAtom::PlainTextDepAtom(const std::string & s) :
- StringDepAtom(s)
+PlainTextDepSpec::PlainTextDepSpec(const std::string & s) :
+ StringDepSpec(s)
{
}
@@ -382,7 +382,7 @@ namespace paludis
/**
* Implementation data for UseRequirements.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
template<>
struct Implementation<UseRequirements>
@@ -433,12 +433,12 @@ UseRequirements::state(const UseFlagName & u) const
return i->second;
}
-std::tr1::shared_ptr<PackageDepAtom>
-PackageDepAtom::without_use_requirements() const
+std::tr1::shared_ptr<PackageDepSpec>
+PackageDepSpec::without_use_requirements() const
{
std::string s(text());
if (std::string::npos != s.find('['))
s.erase(s.find('['));
- return std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(s));
+ return std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(s));
}
diff --git a/paludis/dep_atom.hh b/paludis/dep_spec.hh
index d58a364..bd4b19c 100644
--- a/paludis/dep_atom.hh
+++ b/paludis/dep_spec.hh
@@ -34,48 +34,48 @@
#include <tr1/memory>
/** \file
- * Declarations for the DepAtom classes.
+ * Declarations for the DepSpec classes.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
namespace paludis
{
- class DepAtom;
- class CompositeDepAtom;
- class PackageDepAtom;
- class PlainTextDepAtom;
- class AllDepAtom;
- class AnyDepAtom;
- class UseDepAtom;
- class BlockDepAtom;
+ class DepSpec;
+ class CompositeDepSpec;
+ class PackageDepSpec;
+ class PlainTextDepSpec;
+ class AllDepSpec;
+ class AnyDepSpec;
+ class UseDepSpec;
+ class BlockDepSpec;
/**
- * Visitor types for a visitor that can visit a DepAtom heirarchy.
+ * Visitor types for a visitor that can visit a DepSpec heirarchy.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
- typedef VisitorTypes<PackageDepAtom *, PlainTextDepAtom *, AllDepAtom *, AnyDepAtom *,
- UseDepAtom *, BlockDepAtom *> DepAtomVisitorTypes;
+ typedef VisitorTypes<PackageDepSpec *, PlainTextDepSpec *, AllDepSpec *, AnyDepSpec *,
+ UseDepSpec *, BlockDepSpec *> DepSpecVisitorTypes;
/**
- * Base class for a dependency atom.
+ * Base class for a dependency spec.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class DepAtom :
- public virtual VisitableInterface<DepAtomVisitorTypes>,
- private InstantiationPolicy<DepAtom, instantiation_method::NonCopyableTag>
+ class DepSpec :
+ public virtual VisitableInterface<DepSpecVisitorTypes>,
+ private InstantiationPolicy<DepSpec, instantiation_method::NonCopyableTag>
{
protected:
- DepAtom();
+ DepSpec();
public:
///\name Basic operations
///\{
- virtual ~DepAtom();
+ virtual ~DepSpec();
///\}
@@ -83,36 +83,36 @@ namespace paludis
///\{
/**
- * Return us as a UseDepAtom, or 0 if we are not a
- * UseDepAtom.
+ * Return us as a UseDepSpec, or 0 if we are not a
+ * UseDepSpec.
*/
- virtual const UseDepAtom * as_use_dep_atom() const;
+ virtual const UseDepSpec * as_use_dep_spec() const;
/**
- * Return us as a PackageDepAtom, or 0 if we are not a
- * UseDepAtom.
+ * Return us as a PackageDepSpec, or 0 if we are not a
+ * UseDepSpec.
*/
- virtual const PackageDepAtom * as_package_dep_atom() const;
+ virtual const PackageDepSpec * as_package_dep_spec() const;
///\}
};
/**
- * Class for dependency atoms that have a number of child dependency
- * atoms.
+ * Class for dependency specs that have a number of child dependency
+ * specs.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class CompositeDepAtom :
- public DepAtom,
- private PrivateImplementationPattern<CompositeDepAtom>
+ class CompositeDepSpec :
+ public DepSpec,
+ private PrivateImplementationPattern<CompositeDepSpec>
{
protected:
///\name Basic operations
///\{
- CompositeDepAtom();
+ CompositeDepSpec();
///\}
@@ -120,7 +120,7 @@ namespace paludis
///\name Basic operations
///\{
- ~CompositeDepAtom();
+ ~CompositeDepSpec();
///\}
@@ -130,14 +130,14 @@ namespace paludis
/**
* Append a child to our collection.
*/
- virtual void add_child(std::tr1::shared_ptr<const DepAtom>);
+ virtual void add_child(std::tr1::shared_ptr<const DepSpec>);
///\}
///\name Iterate over our children
///\{
- typedef libwrapiter::ForwardIterator<CompositeDepAtom, const std::tr1::shared_ptr<const DepAtom> > Iterator;
+ typedef libwrapiter::ForwardIterator<CompositeDepSpec, const std::tr1::shared_ptr<const DepSpec> > Iterator;
Iterator begin() const;
@@ -149,51 +149,51 @@ namespace paludis
/**
* Represents a "|| ( )" dependency block.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class AnyDepAtom :
- public CompositeDepAtom,
- public Visitable<AnyDepAtom, DepAtomVisitorTypes>
+ class AnyDepSpec :
+ public CompositeDepSpec,
+ public Visitable<AnyDepSpec, DepSpecVisitorTypes>
{
public:
///\name Basic operations
///\{
- AnyDepAtom();
+ AnyDepSpec();
///\}
};
/**
* Represents a ( first second third ) or top level group of dependency
- * atoms.
+ * specs.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class AllDepAtom :
- public CompositeDepAtom,
- public Visitable<AllDepAtom, DepAtomVisitorTypes>
+ class AllDepSpec :
+ public CompositeDepSpec,
+ public Visitable<AllDepSpec, DepSpecVisitorTypes>
{
public:
///\name Basic operations
///\{
- AllDepAtom();
+ AllDepSpec();
///\}
};
/**
- * Represents a use? ( ) dependency atom.
+ * Represents a use? ( ) dependency spec.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class UseDepAtom :
- public CompositeDepAtom,
- public Visitable<UseDepAtom, DepAtomVisitorTypes>
+ class UseDepSpec :
+ public CompositeDepSpec,
+ public Visitable<UseDepSpec, DepSpecVisitorTypes>
{
private:
const UseFlagName _flag;
@@ -203,7 +203,7 @@ namespace paludis
///\name Basic operations
///\{
- UseDepAtom(const UseFlagName &, bool);
+ UseDepSpec(const UseFlagName &, bool);
///\}
@@ -223,18 +223,18 @@ namespace paludis
return _inverse;
}
- virtual const UseDepAtom * as_use_dep_atom() const;
+ virtual const UseDepSpec * as_use_dep_spec() const;
};
/**
- * A StringDepAtom represents a non-composite dep atom with an associated
+ * A StringDepSpec represents a non-composite dep spec with an associated
* piece of text.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class StringDepAtom :
- public DepAtom
+ class StringDepSpec :
+ public DepSpec
{
private:
const std::string _str;
@@ -243,9 +243,9 @@ namespace paludis
///\name Basic operations
///\{
- StringDepAtom(const std::string &);
+ StringDepSpec(const std::string &);
- ~StringDepAtom();
+ ~StringDepSpec();
///\}
@@ -262,7 +262,7 @@ namespace paludis
/**
* A selection of USE flag requirements.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
class UseRequirements :
@@ -299,16 +299,16 @@ namespace paludis
};
/**
- * A PackageDepAtom represents a package name (for example,
+ * A PackageDepSpec represents a package name (for example,
* 'app-editors/vim'), possibly with associated version and SLOT
* restrictions.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class PackageDepAtom :
- public StringDepAtom,
- public Visitable<PackageDepAtom, DepAtomVisitorTypes>
+ class PackageDepSpec :
+ public StringDepSpec,
+ public Visitable<PackageDepSpec, DepSpecVisitorTypes>
{
private:
QualifiedPackageName _package;
@@ -319,7 +319,7 @@ namespace paludis
std::tr1::shared_ptr<UseRequirements> _use_requirements;
std::tr1::shared_ptr<const DepTag> _tag;
- const PackageDepAtom & operator= (const PackageDepAtom &);
+ const PackageDepSpec & operator= (const PackageDepSpec &);
public:
///\name Basic operations
@@ -328,19 +328,19 @@ namespace paludis
/**
* Constructor, no version or SLOT restrictions.
*/
- PackageDepAtom(const QualifiedPackageName & package);
+ PackageDepSpec(const QualifiedPackageName & package);
/**
* Constructor, parse restrictions ourself.
*/
- PackageDepAtom(const std::string &);
+ PackageDepSpec(const std::string &);
/**
* Copy constructor.
*/
- PackageDepAtom(const PackageDepAtom &);
+ PackageDepSpec(const PackageDepSpec &);
- ~PackageDepAtom();
+ ~PackageDepSpec();
///\}
@@ -427,96 +427,96 @@ namespace paludis
/**
* Fetch a copy of ourself without the USE requirements.
*/
- std::tr1::shared_ptr<PackageDepAtom> without_use_requirements() const;
+ std::tr1::shared_ptr<PackageDepSpec> without_use_requirements() const;
- virtual const PackageDepAtom * as_package_dep_atom() const;
+ virtual const PackageDepSpec * as_package_dep_spec() const;
};
/**
- * A PlainTextDepAtom represents a plain text entry (for example,
+ * A PlainTextDepSpec represents a plain text entry (for example,
* a URI in SRC_URI).
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class PlainTextDepAtom :
- public StringDepAtom,
- public Visitable<PlainTextDepAtom, DepAtomVisitorTypes>
+ class PlainTextDepSpec :
+ public StringDepSpec,
+ public Visitable<PlainTextDepSpec, DepSpecVisitorTypes>
{
public:
///\name Basic operations
///\{
- PlainTextDepAtom(const std::string &);
+ PlainTextDepSpec(const std::string &);
///\}
};
/**
- * A PlainTextDepAtom can be written to an ostream.
+ * A PlainTextDepSpec can be written to an ostream.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
- std::ostream & operator<< (std::ostream &, const PlainTextDepAtom &);
+ std::ostream & operator<< (std::ostream &, const PlainTextDepSpec &);
/**
- * Thrown if an invalid package dep atom specification is encountered.
+ * Thrown if an invalid package dep spec specification is encountered.
*
* \ingroup grpexceptions
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class PackageDepAtomError :
+ class PackageDepSpecError :
public Exception
{
public:
///\name Basic operations
///\{
- PackageDepAtomError(const std::string & msg) throw ();
+ PackageDepSpecError(const std::string & msg) throw ();
///\}
};
/**
- * A PackageDepAtom can be written to an ostream.
+ * A PackageDepSpec can be written to an ostream.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
*/
- std::ostream & operator<< (std::ostream &, const PackageDepAtom &);
+ std::ostream & operator<< (std::ostream &, const PackageDepSpec &);
/**
- * A BlockDepAtom represents a block on a package name (for example,
+ * A BlockDepSpec represents a block on a package name (for example,
* 'app-editors/vim'), possibly with associated version and SLOT
* restrictions.
*
- * \ingroup grpdepatoms
+ * \ingroup grpdepspecs
* \nosubgrouping
*/
- class BlockDepAtom :
- public StringDepAtom,
- public Visitable<BlockDepAtom, DepAtomVisitorTypes>
+ class BlockDepSpec :
+ public StringDepSpec,
+ public Visitable<BlockDepSpec, DepSpecVisitorTypes>
{
private:
- std::tr1::shared_ptr<const PackageDepAtom> _atom;
+ std::tr1::shared_ptr<const PackageDepSpec> _spec;
public:
///\name Basic operations
///\{
/**
- * Constructor, with blocking atom.
+ * Constructor, with blocking spec.
*/
- BlockDepAtom(std::tr1::shared_ptr<const PackageDepAtom> atom);
+ BlockDepSpec(std::tr1::shared_ptr<const PackageDepSpec> spec);
///\}
/**
- * Fetch the atom we're blocking.
+ * Fetch the spec we're blocking.
*/
- std::tr1::shared_ptr<const PackageDepAtom> blocked_atom() const
+ std::tr1::shared_ptr<const PackageDepSpec> blocked_spec() const
{
- return _atom;
+ return _spec;
}
};
diff --git a/paludis/dep_atom_TEST.cc b/paludis/dep_spec_TEST.cc
index 72d43f2..40e3a74 100644
--- a/paludis/dep_atom_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -17,12 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
/** \file
- * Test cases for dep_atom.hh classes.
+ * Test cases for dep_spec.hh classes.
*
*/
@@ -32,63 +32,63 @@ using namespace test;
namespace test_cases
{
/**
- * \test Test DepAtom as_ functions.
+ * \test Test DepSpec as_ functions.
*
*/
- struct DepAtomAsTest : TestCase
+ struct DepSpecAsTest : TestCase
{
- DepAtomAsTest() : TestCase("dep atom as") { }
+ DepSpecAsTest() : TestCase("dep spec as") { }
void run()
{
- std::tr1::shared_ptr<PackageDepAtom> x(new PackageDepAtom("foo/bar"));
- TEST_CHECK(0 == x->as_use_dep_atom());
+ std::tr1::shared_ptr<PackageDepSpec> x(new PackageDepSpec("foo/bar"));
+ TEST_CHECK(0 == x->as_use_dep_spec());
- std::tr1::shared_ptr<UseDepAtom> y(new UseDepAtom(UseFlagName("foo"), x));
- TEST_CHECK(0 != y->as_use_dep_atom());
- TEST_CHECK(y.get() == y->as_use_dep_atom());
+ std::tr1::shared_ptr<UseDepSpec> y(new UseDepSpec(UseFlagName("foo"), x));
+ TEST_CHECK(0 != y->as_use_dep_spec());
+ TEST_CHECK(y.get() == y->as_use_dep_spec());
}
- } test_dep_atom_as;
+ } test_dep_spec_as;
/**
- * \test Test DepAtom composite functions.
+ * \test Test DepSpec composite functions.
*
*/
- struct DepAtomCompositeTest : TestCase
+ struct DepSpecCompositeTest : TestCase
{
- DepAtomCompositeTest() : TestCase("dep atom composite") { }
+ DepSpecCompositeTest() : TestCase("dep spec composite") { }
void run()
{
- std::tr1::shared_ptr<AllDepAtom> x(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> x(new AllDepSpec);
TEST_CHECK(x->begin() == x->end());
- x->add_child(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom("x/y")));
+ x->add_child(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec("x/y")));
TEST_CHECK(x->begin() != x->end());
TEST_CHECK_EQUAL(1, std::distance(x->begin(), x->end()));
- x->add_child(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom("x/y")));
+ x->add_child(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec("x/y")));
TEST_CHECK(x->begin() != x->end());
TEST_CHECK_EQUAL(2, std::distance(x->begin(), x->end()));
}
- } test_dep_atom_composite;
+ } test_dep_spec_composite;
/**
- * \test Test PackageDepAtom.
+ * \test Test PackageDepSpec.
*
*/
- struct PackageDepAtomTest : TestCase
+ struct PackageDepSpecTest : TestCase
{
- PackageDepAtomTest() : TestCase("package dep atom") { }
+ PackageDepSpecTest() : TestCase("package dep spec") { }
void run()
{
- PackageDepAtom a("foo/bar");
+ PackageDepSpec a("foo/bar");
TEST_CHECK_STRINGIFY_EQUAL(a.package(), "foo/bar");
TEST_CHECK(! a.slot_ptr());
TEST_CHECK(! a.version_requirements_ptr());
- PackageDepAtom b(">=foo/bar-1.2.3");
+ PackageDepSpec b(">=foo/bar-1.2.3");
TEST_CHECK_STRINGIFY_EQUAL(b.package(), "foo/bar");
TEST_CHECK(! b.slot_ptr());
TEST_CHECK(b.version_requirements_ptr());
@@ -97,13 +97,13 @@ namespace test_cases
TEST_CHECK_STRINGIFY_EQUAL(b.version_requirements_ptr()->begin()->version_spec, "1.2.3");
TEST_CHECK_EQUAL(b.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
- PackageDepAtom c("foo/bar:baz");
+ PackageDepSpec c("foo/bar:baz");
TEST_CHECK_STRINGIFY_EQUAL(c.package(), "foo/bar");
TEST_CHECK(c.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*c.slot_ptr(), "baz");
TEST_CHECK(! c.version_requirements_ptr());
- PackageDepAtom d("=foo/bar-1.2*:1.2.1");
+ PackageDepSpec d("=foo/bar-1.2*:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(d.package(), "foo/bar");
TEST_CHECK(d.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*d.slot_ptr(), "1.2.1");
@@ -111,30 +111,30 @@ namespace test_cases
TEST_CHECK_STRINGIFY_EQUAL(d.version_requirements_ptr()->begin()->version_spec, "1.2");
TEST_CHECK_EQUAL(d.version_requirements_ptr()->begin()->version_operator, vo_equal_star);
- PackageDepAtom e("foo/bar:1.2.1");
+ PackageDepSpec e("foo/bar:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(e.package(), "foo/bar");
TEST_CHECK(e.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*e.slot_ptr(), "1.2.1");
TEST_CHECK(! e.version_requirements_ptr());
- PackageDepAtom f("foo/bar:0");
+ PackageDepSpec f("foo/bar:0");
TEST_CHECK_STRINGIFY_EQUAL(f.package(), "foo/bar");
TEST_CHECK(f.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*f.slot_ptr(), "0");
TEST_CHECK(! f.version_requirements_ptr());
- PackageDepAtom g("foo/bar-100dpi");
+ PackageDepSpec g("foo/bar-100dpi");
TEST_CHECK_STRINGIFY_EQUAL(g.package(), "foo/bar-100dpi");
- PackageDepAtom h(">=foo/bar-100dpi-1.23");
+ PackageDepSpec h(">=foo/bar-100dpi-1.23");
TEST_CHECK_STRINGIFY_EQUAL(h.package(), "foo/bar-100dpi");
TEST_CHECK(h.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(h.version_requirements_ptr()->begin()->version_spec, "1.23");
TEST_CHECK_EQUAL(h.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
- TEST_CHECK_THROWS(PackageDepAtom(""), PackageDepAtomError);
+ TEST_CHECK_THROWS(PackageDepSpec(""), PackageDepSpecError);
- PackageDepAtom i("foo/bar[one][-two]");
+ PackageDepSpec i("foo/bar[one][-two]");
TEST_CHECK_STRINGIFY_EQUAL(i.package(), "foo/bar");
TEST_CHECK(! i.version_requirements_ptr());
TEST_CHECK(! i.repository_ptr());
@@ -150,18 +150,18 @@ namespace test_cases
TEST_CHECK(i.use_requirements_ptr()->state(UseFlagName("two")) == use_disabled);
TEST_CHECK(i.use_requirements_ptr()->state(UseFlagName("moo")) == use_unspecified);
- PackageDepAtom j("=foo/bar-scm-r3");
+ PackageDepSpec j("=foo/bar-scm-r3");
TEST_CHECK_STRINGIFY_EQUAL(j.package(), "foo/bar");
TEST_CHECK(j.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(j.version_requirements_ptr()->begin()->version_spec, "scm-r3");
TEST_CHECK_EQUAL(j.version_requirements_ptr()->begin()->version_operator, vo_equal);
- PackageDepAtom k("=foo/bar-scm");
+ PackageDepSpec k("=foo/bar-scm");
TEST_CHECK_STRINGIFY_EQUAL(k.package(), "foo/bar");
TEST_CHECK(k.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(k.version_requirements_ptr()->begin()->version_spec, "scm");
TEST_CHECK_EQUAL(k.version_requirements_ptr()->begin()->version_operator, vo_equal);
}
- } test_package_dep_atom;
+ } test_package_dep_spec;
}
diff --git a/paludis/dep_atom_flattener.cc b/paludis/dep_spec_flattener.cc
index 6cd0218..b6e9ce8 100644
--- a/paludis/dep_atom_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -17,14 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <list>
/** \file
- * Implementation of dep_atom_flattener.hh.
+ * Implementation of dep_spec_flattener.hh.
*
- * \ingroup grpdepatomflattener
+ * \ingroup grpdepspecflattener
*/
using namespace paludis;
@@ -32,26 +32,26 @@ using namespace paludis;
namespace paludis
{
/**
- * Implementation data for DepAtomFlattener.
+ * Implementation data for DepSpecFlattener.
*
- * \ingroup grpdepatomflattener
+ * \ingroup grpdepspecflattener
*/
template<>
- struct Implementation<DepAtomFlattener>
+ struct Implementation<DepSpecFlattener>
{
const Environment * const env;
const PackageDatabaseEntry * const pkg;
- std::tr1::shared_ptr<const DepAtom> a;
+ std::tr1::shared_ptr<const DepSpec> a;
- mutable std::list<const StringDepAtom *> atoms;
+ mutable std::list<const StringDepSpec *> specs;
mutable bool done;
Implementation(const Environment * const e,
const PackageDatabaseEntry * const p,
- std::tr1::shared_ptr<const DepAtom> aa) :
+ std::tr1::shared_ptr<const DepSpec> aa) :
env(e),
pkg(p),
a(aa),
@@ -61,67 +61,67 @@ namespace paludis
};
}
-DepAtomFlattener::DepAtomFlattener(
+DepSpecFlattener::DepSpecFlattener(
const Environment * const env,
const PackageDatabaseEntry * const pkg,
- std::tr1::shared_ptr<const DepAtom> a) :
- PrivateImplementationPattern<DepAtomFlattener>(new Implementation<DepAtomFlattener>(
+ std::tr1::shared_ptr<const DepSpec> a) :
+ PrivateImplementationPattern<DepSpecFlattener>(new Implementation<DepSpecFlattener>(
env, pkg, a))
{
}
-DepAtomFlattener::~DepAtomFlattener()
+DepSpecFlattener::~DepSpecFlattener()
{
}
-DepAtomFlattener::Iterator
-DepAtomFlattener::begin()
+DepSpecFlattener::Iterator
+DepSpecFlattener::begin()
{
if (! _imp->done)
{
- _imp->a->accept(static_cast<DepAtomVisitorTypes::ConstVisitor *>(this));
+ _imp->a->accept(static_cast<DepSpecVisitorTypes::ConstVisitor *>(this));
_imp->done = true;
}
- return Iterator(_imp->atoms.begin());
+ return Iterator(_imp->specs.begin());
}
-DepAtomFlattener::Iterator
-DepAtomFlattener::end() const
+DepSpecFlattener::Iterator
+DepSpecFlattener::end() const
{
- return Iterator(_imp->atoms.end());
+ return Iterator(_imp->specs.end());
}
-void DepAtomFlattener::visit(const AllDepAtom * a)
+void DepSpecFlattener::visit(const AllDepSpec * a)
{
std::for_each(a->begin(), a->end(), accept_visitor(
- static_cast<DepAtomVisitorTypes::ConstVisitor *>(this)));
+ static_cast<DepSpecVisitorTypes::ConstVisitor *>(this)));
}
-void DepAtomFlattener::visit(const AnyDepAtom *)
+void DepSpecFlattener::visit(const AnyDepSpec *)
{
- throw InternalError(PALUDIS_HERE, "Found unexpected AnyDepAtom");
+ throw InternalError(PALUDIS_HERE, "Found unexpected AnyDepSpec");
}
-void DepAtomFlattener::visit(const UseDepAtom * u)
+void DepSpecFlattener::visit(const UseDepSpec * u)
{
if (_imp->env->query_use(u->flag(), _imp->pkg) ^ u->inverse())
std::for_each(u->begin(), u->end(), accept_visitor(
- static_cast<DepAtomVisitorTypes::ConstVisitor *>(this)));
+ static_cast<DepSpecVisitorTypes::ConstVisitor *>(this)));
}
-void DepAtomFlattener::visit(const PlainTextDepAtom * p)
+void DepSpecFlattener::visit(const PlainTextDepSpec * p)
{
- _imp->atoms.push_back(p);
+ _imp->specs.push_back(p);
}
-void DepAtomFlattener::visit(const PackageDepAtom * p)
+void DepSpecFlattener::visit(const PackageDepSpec * p)
{
- _imp->atoms.push_back(p);
+ _imp->specs.push_back(p);
}
-void DepAtomFlattener::visit(const BlockDepAtom * p)
+void DepSpecFlattener::visit(const BlockDepSpec * p)
{
- _imp->atoms.push_back(p);
+ _imp->specs.push_back(p);
}
diff --git a/paludis/dep_atom_flattener.hh b/paludis/dep_spec_flattener.hh
index 32d0769..169b26d 100644
--- a/paludis/dep_atom_flattener.hh
+++ b/paludis/dep_spec_flattener.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEP_ATOM_FLATTENER_HH
#define PALUDIS_GUARD_PALUDIS_DEP_ATOM_FLATTENER_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/util/attributes.hh>
@@ -29,9 +29,9 @@
#include <libwrapiter/libwrapiter_forward_iterator.hh>
/** \file
- * Declarations for DepAtomFlattener.
+ * Declarations for DepSpecFlattener.
*
- * \ingroup grpdepatomflattener
+ * \ingroup grpdepspecflattener
*/
namespace paludis
@@ -43,41 +43,41 @@ namespace paludis
* This is useful for picking out SRC_URI, PROVIDE etc components. It is
* <b>not</b> suitable for heirarchies that can contain || ( ) blocks.
*
- * \ingroup grpdepatomflattener
+ * \ingroup grpdepspecflattener
* \nosubgrouping
*/
- class DepAtomFlattener :
- private InstantiationPolicy<DepAtomFlattener, instantiation_method::NonCopyableTag>,
- protected DepAtomVisitorTypes::ConstVisitor,
- private PrivateImplementationPattern<DepAtomFlattener>
+ class DepSpecFlattener :
+ private InstantiationPolicy<DepSpecFlattener, instantiation_method::NonCopyableTag>,
+ protected DepSpecVisitorTypes::ConstVisitor,
+ private PrivateImplementationPattern<DepSpecFlattener>
{
protected:
///\name Visit methods
///{
- void visit(const AllDepAtom *);
- void visit(const AnyDepAtom *) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const UseDepAtom *);
- void visit(const PlainTextDepAtom *);
- void visit(const PackageDepAtom *);
- void visit(const BlockDepAtom *);
+ void visit(const AllDepSpec *);
+ void visit(const AnyDepSpec *) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const UseDepSpec *);
+ void visit(const PlainTextDepSpec *);
+ void visit(const PackageDepSpec *);
+ void visit(const BlockDepSpec *);
///}
public:
///\name Basic operations
///\{
- DepAtomFlattener(const Environment * const,
+ DepSpecFlattener(const Environment * const,
const PackageDatabaseEntry * const,
- const std::tr1::shared_ptr<const DepAtom>);
+ const std::tr1::shared_ptr<const DepSpec>);
- ~DepAtomFlattener();
+ ~DepSpecFlattener();
///\}
- ///\name Iterate over our dep atoms
+ ///\name Iterate over our dep specs
///{
- typedef libwrapiter::ForwardIterator<DepAtomFlattener, const StringDepAtom *> Iterator;
+ typedef libwrapiter::ForwardIterator<DepSpecFlattener, const StringDepSpec *> Iterator;
Iterator begin();
diff --git a/paludis/dep_atom_pretty_printer.cc b/paludis/dep_spec_pretty_printer.cc
index bda808f..d312759 100644
--- a/paludis/dep_atom_pretty_printer.cc
+++ b/paludis/dep_spec_pretty_printer.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -18,27 +18,27 @@
*/
#include <algorithm>
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_pretty_printer.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/util/save.hh>
/** \file
- * Implementation of dep_atom_pretty_printer.hh.
+ * Implementation of dep_spec_pretty_printer.hh.
*
- * \ingroup grpdepatomprettyprinter
+ * \ingroup grpdepspecprettyprinter
*/
using namespace paludis;
std::ostream &
-paludis::operator<< (std::ostream & s, const DepAtomPrettyPrinter & p)
+paludis::operator<< (std::ostream & s, const DepSpecPrettyPrinter & p)
{
s << p._s.str();
return s;
}
void
-DepAtomPrettyPrinter::visit(const AllDepAtom * const a)
+DepSpecPrettyPrinter::visit(const AllDepSpec * const a)
{
_s << indent() << "(" << newline();
{
@@ -49,7 +49,7 @@ DepAtomPrettyPrinter::visit(const AllDepAtom * const a)
}
void
-DepAtomPrettyPrinter::visit(const AnyDepAtom * const a)
+DepSpecPrettyPrinter::visit(const AnyDepSpec * const a)
{
_s << indent() << "|| (" << newline();
{
@@ -60,7 +60,7 @@ DepAtomPrettyPrinter::visit(const AnyDepAtom * const a)
}
void
-DepAtomPrettyPrinter::visit(const UseDepAtom * const a)
+DepSpecPrettyPrinter::visit(const UseDepSpec * const a)
{
_s << indent() << (a->inverse() ? "!" : "") <<
a->flag() << "? (" << newline();
@@ -72,31 +72,31 @@ DepAtomPrettyPrinter::visit(const UseDepAtom * const a)
}
void
-DepAtomPrettyPrinter::visit(const PackageDepAtom * const p)
+DepSpecPrettyPrinter::visit(const PackageDepSpec * const p)
{
_s << indent() << *p << newline();
}
void
-DepAtomPrettyPrinter::visit(const PlainTextDepAtom * const p)
+DepSpecPrettyPrinter::visit(const PlainTextDepSpec * const p)
{
_s << indent() << p->text() << newline();
}
void
-DepAtomPrettyPrinter::visit(const BlockDepAtom * const b)
+DepSpecPrettyPrinter::visit(const BlockDepSpec * const b)
{
- _s << indent() << "!" << *b->blocked_atom() << newline();
+ _s << indent() << "!" << *b->blocked_spec() << newline();
}
std::string
-DepAtomPrettyPrinter::newline() const
+DepSpecPrettyPrinter::newline() const
{
return _use_newlines ? "\n" : " ";
}
std::string
-DepAtomPrettyPrinter::indent() const
+DepSpecPrettyPrinter::indent() const
{
return _use_newlines ? std::string(_indent, ' ') : "";
}
diff --git a/paludis/dep_atom_pretty_printer.hh b/paludis/dep_spec_pretty_printer.hh
index f612e07..f844966 100644
--- a/paludis/dep_atom_pretty_printer.hh
+++ b/paludis/dep_spec_pretty_printer.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,25 +21,25 @@
#define PALUDIS_GUARD_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH 1
#include <iosfwd>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
/** \file
- * Declarations for the DepAtomPrettyPrinter class.
+ * Declarations for the DepSpecPrettyPrinter class.
*
- * \ingroup grpdepatomprettyprinter
+ * \ingroup grpdepspecprettyprinter
*/
namespace paludis
{
/**
- * Pretty print dependency atoms.
+ * Pretty print dependency specs.
*
- * \ingroup grpdepatomprettyprinter
+ * \ingroup grpdepspecprettyprinter
*/
- class DepAtomPrettyPrinter :
- public DepAtomVisitorTypes::ConstVisitor
+ class DepSpecPrettyPrinter :
+ public DepSpecVisitorTypes::ConstVisitor
{
- friend std::ostream & operator<< (std::ostream &, const DepAtomPrettyPrinter &);
+ friend std::ostream & operator<< (std::ostream &, const DepSpecPrettyPrinter &);
private:
std::stringstream _s;
@@ -53,7 +53,7 @@ namespace paludis
/**
* Constructor.
*/
- DepAtomPrettyPrinter(unsigned initial_indent,
+ DepSpecPrettyPrinter(unsigned initial_indent,
bool use_newlines = true) :
_indent(initial_indent),
_use_newlines(use_newlines)
@@ -62,26 +62,26 @@ namespace paludis
/// \name Visit functions
///{
- void visit(const AllDepAtom * const);
+ void visit(const AllDepSpec * const);
- void visit(const AnyDepAtom * const);
+ void visit(const AnyDepSpec * const);
- void visit(const UseDepAtom * const);
+ void visit(const UseDepSpec * const);
- void visit(const PackageDepAtom * const);
+ void visit(const PackageDepSpec * const);
- void visit(const PlainTextDepAtom * const);
+ void visit(const PlainTextDepSpec * const);
- void visit(const BlockDepAtom * const);
+ void visit(const BlockDepSpec * const);
///}
};
/**
- * Output a DepAtomPrettyPrinter to an ostream.
+ * Output a DepSpecPrettyPrinter to an ostream.
*
- * \ingroup grpdepatomprettyprinter
+ * \ingroup grpdepspecprettyprinter
*/
- std::ostream & operator<< (std::ostream & s, const DepAtomPrettyPrinter & p);
+ std::ostream & operator<< (std::ostream & s, const DepSpecPrettyPrinter & p);
}
#endif
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 6c7b3a4..19abb52 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -165,7 +165,7 @@ namespace paludis
typedef VisitorTypes<GLSADepTag *, GeneralSetDepTag *, DependencyDepTag *> DepTagVisitorTypes;
/**
- * A DepTag can be associated with a PackageDepAtom, and is transferred
+ * A DepTag can be associated with a PackageDepSpec, and is transferred
* onto any associated DepListEntry instances.
*
* It is used for tagging dep list entries visually, for example to
diff --git a/paludis/environment.cc b/paludis/environment.cc
index f5bf69f..efbac50 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/package_database.hh>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
@@ -53,10 +53,10 @@ namespace
* Check whether licences for a package are accepted.
*/
struct LicenceChecker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<LicenceChecker, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<LicenceChecker, AllDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<LicenceChecker, AllDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<LicenceChecker, AllDepSpec>::visit;
/// Are all necessary licences ok?
bool ok;
@@ -78,15 +78,15 @@ namespace
///\name Visit methods
///{
- void visit(const AnyDepAtom * atom)
+ void visit(const AnyDepSpec * spec)
{
bool local_ok(false);
- if (atom->begin() == atom->end())
+ if (spec->begin() == spec->end())
local_ok = true;
else
{
- for (CompositeDepAtom::Iterator i(atom->begin()), i_end(atom->end()) ;
+ for (CompositeDepSpec::Iterator i(spec->begin()), i_end(spec->end()) ;
i != i_end ; ++i)
{
Save<bool> save_ok(&ok, true);
@@ -98,26 +98,26 @@ namespace
ok &= local_ok;
}
- void visit(const UseDepAtom * atom)
+ void visit(const UseDepSpec * spec)
{
- if (env->query_use(atom->flag(), db_entry))
- std::for_each(atom->begin(), atom->end(), accept_visitor(this));
+ if (env->query_use(spec->flag(), db_entry))
+ std::for_each(spec->begin(), spec->end(), accept_visitor(this));
}
- void visit(const PlainTextDepAtom * atom)
+ void visit(const PlainTextDepSpec * spec)
{
- if (! env->accept_license(atom->text(), db_entry))
+ if (! env->accept_license(spec->text(), db_entry))
ok = false;
}
- void visit(const PackageDepAtom *) PALUDIS_ATTRIBUTE((noreturn))
+ void visit(const PackageDepSpec *) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "Encountered PackageDepAtom in licence?");
+ throw InternalError(PALUDIS_HERE, "Encountered PackageDepSpec in licence?");
}
- void visit(const BlockDepAtom *) PALUDIS_ATTRIBUTE((noreturn))
+ void visit(const BlockDepSpec *) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "Encountered BlockDepAtom in licence?");
+ throw InternalError(PALUDIS_HERE, "Encountered BlockDepSpec in licence?");
}
///}
};
@@ -209,17 +209,17 @@ Environment::mask_reasons(const PackageDatabaseEntry & e, const bool override_ti
return result;
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
Environment::package_set(const SetName & s) const
{
/* favour local sets first */
- std::tr1::shared_ptr<CompositeDepAtom> result(local_package_set(s));
+ std::tr1::shared_ptr<CompositeDepSpec> result(local_package_set(s));
if (0 != result)
return result;
/* these sets always exist, even if empty */
if (s.data() == "everything" || s.data() == "system" || s.data() == "world" || s.data() == "security")
- result.reset(new AllDepAtom);
+ result.reset(new AllDepSpec);
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
@@ -228,11 +228,11 @@ Environment::package_set(const SetName & s) const
if (! (*r)->sets_interface)
continue;
- std::tr1::shared_ptr<DepAtom> add((*r)->sets_interface->package_set(s));
+ std::tr1::shared_ptr<DepSpec> add((*r)->sets_interface->package_set(s));
if (0 != add)
{
if (! result)
- result.reset(new AllDepAtom);
+ result.reset(new AllDepSpec);
result->add_child(add);
}
@@ -254,13 +254,13 @@ namespace
* from the world file.
*/
struct WorldTargetFinder :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<WorldTargetFinder, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<WorldTargetFinder, AllDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<WorldTargetFinder, AllDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<WorldTargetFinder, AllDepSpec>::visit;
/// Matches
- std::list<const PackageDepAtom *> items;
+ std::list<const PackageDepSpec *> items;
/// Callback object pointer, may be 0.
Environment::WorldCallbacks * const w;
@@ -281,23 +281,23 @@ namespace
///\name Visit methods
///{
- void visit(const AnyDepAtom * a)
+ void visit(const AnyDepSpec * a)
{
Save<bool> save_inside_any(&inside_any, true);
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const UseDepAtom * a)
+ void visit(const UseDepSpec * a)
{
Save<bool> save_inside_use(&inside_use, true);
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const PlainTextDepAtom *)
+ void visit(const PlainTextDepSpec *)
{
}
- void visit(const PackageDepAtom * a)
+ void visit(const PackageDepSpec * a)
{
if (inside_any)
{
@@ -327,7 +327,7 @@ namespace
}
}
- void visit(const BlockDepAtom *)
+ void visit(const BlockDepSpec *)
{
}
///}
@@ -336,12 +336,12 @@ namespace
}
void
-Environment::add_appropriate_to_world(std::tr1::shared_ptr<const DepAtom> a,
+Environment::add_appropriate_to_world(std::tr1::shared_ptr<const DepSpec> a,
Environment::WorldCallbacks * const ww) const
{
WorldTargetFinder w(ww);
a->accept(&w);
- for (std::list<const PackageDepAtom *>::const_iterator i(w.items.begin()),
+ for (std::list<const PackageDepSpec *>::const_iterator i(w.items.begin()),
i_end(w.items.end()) ; i != i_end ; ++i)
{
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
@@ -374,12 +374,12 @@ Environment::add_set_to_world(const SetName & s, Environment::WorldCallbacks * w
}
void
-Environment::remove_appropriate_from_world(std::tr1::shared_ptr<const DepAtom> a,
+Environment::remove_appropriate_from_world(std::tr1::shared_ptr<const DepSpec> a,
Environment::WorldCallbacks * const ww) const
{
WorldTargetFinder w(ww);
a->accept(&w);
- for (std::list<const PackageDepAtom *>::const_iterator i(w.items.begin()),
+ for (std::list<const PackageDepSpec *>::const_iterator i(w.items.begin()),
i_end(w.items.end()) ; i != i_end ; ++i)
{
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
@@ -583,17 +583,17 @@ Environment::WorldCallbacks::~WorldCallbacks()
}
void
-Environment::WorldCallbacks::add_callback(const PackageDepAtom &)
+Environment::WorldCallbacks::add_callback(const PackageDepSpec &)
{
}
void
-Environment::WorldCallbacks::skip_callback(const PackageDepAtom &, const std::string &)
+Environment::WorldCallbacks::skip_callback(const PackageDepSpec &, const std::string &)
{
}
void
-Environment::WorldCallbacks::remove_callback(const PackageDepAtom &)
+Environment::WorldCallbacks::remove_callback(const PackageDepSpec &)
{
}
diff --git a/paludis/environment.hh b/paludis/environment.hh
index ab019ec..0d1d237 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -111,9 +111,9 @@ namespace paludis
/**
* Local package set, or zero.
*/
- virtual std::tr1::shared_ptr<CompositeDepAtom> local_package_set(const SetName &) const
+ virtual std::tr1::shared_ptr<CompositeDepSpec> local_package_set(const SetName &) const
{
- return std::tr1::shared_ptr<AllDepAtom>();
+ return std::tr1::shared_ptr<AllDepSpec>();
}
/**
@@ -264,7 +264,7 @@ namespace paludis
/**
* Fetch a named package set.
*/
- std::tr1::shared_ptr<DepAtom> package_set(const SetName &) const;
+ std::tr1::shared_ptr<DepSpec> package_set(const SetName &) const;
/**
* Fetch all named sets. Does not include sets from repositories.
@@ -301,17 +301,17 @@ namespace paludis
/**
* Called when adding an entry to world.
*/
- virtual void add_callback(const PackageDepAtom &);
+ virtual void add_callback(const PackageDepSpec &);
/**
* Called when skipping adding an entry to world.
*/
- virtual void skip_callback(const PackageDepAtom &, const std::string &);
+ virtual void skip_callback(const PackageDepSpec &, const std::string &);
/**
* Called when removing an entry to world.
*/
- virtual void remove_callback(const PackageDepAtom &);
+ virtual void remove_callback(const PackageDepSpec &);
/**
* Called when adding an entry to world.
@@ -331,14 +331,14 @@ namespace paludis
/**
* Add packages to world, if they are not there already, and if they are
- * not a restricted atom.
+ * not a restricted spec.
*/
- void add_appropriate_to_world(std::tr1::shared_ptr<const DepAtom> a, WorldCallbacks *) const;
+ void add_appropriate_to_world(std::tr1::shared_ptr<const DepSpec> a, WorldCallbacks *) const;
/**
* Remove packages from world, if they are there.
*/
- void remove_appropriate_from_world(std::tr1::shared_ptr<const DepAtom>, WorldCallbacks *) const;
+ void remove_appropriate_from_world(std::tr1::shared_ptr<const DepSpec>, WorldCallbacks *) const;
/**
* Add a set to world, if it's not inappropriate.
diff --git a/paludis/environment/default/default_config.cc b/paludis/environment/default/default_config.cc
index cee250f..b955a5b 100644
--- a/paludis/environment/default/default_config.cc
+++ b/paludis/environment/default/default_config.cc
@@ -74,28 +74,28 @@ namespace paludis
std::list<RepositoryConfigEntry> repos;
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, KeywordName> > > keywords;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > > keywords;
- const std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, KeywordName> > empty_keywords;
+ const std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > empty_keywords;
std::vector<KeywordName> default_keywords;
mutable std::vector<SetKeywordConfigEntry> set_keywords;
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > > licenses;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > > licenses;
- const std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > empty_licenses;
+ const std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > empty_licenses;
std::vector<std::string> default_licenses;
mutable std::vector<SetLicenseConfigEntry> set_licenses;
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > > user_masks;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > > user_masks;
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > > user_unmasks;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > > user_unmasks;
- std::vector<std::tr1::shared_ptr<const PackageDepAtom> > empty_masks;
+ std::vector<std::tr1::shared_ptr<const PackageDepSpec> > empty_masks;
mutable std::vector<SetMaskConfigEntry> set_masks;
mutable std::vector<SetMaskConfigEntry> set_unmasks;
@@ -106,9 +106,9 @@ namespace paludis
mutable std::vector<SetUseConfigMinusStarEntry> set_use_prefixes_that_have_minus_star;
- std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > empty_use_prefixes;
+ std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > empty_use_prefixes;
- std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > >
+ std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >
use_prefixes_that_have_minus_star;
std::vector<UseConfigEntry> empty_use;
@@ -144,27 +144,27 @@ namespace paludis
for (std::vector<SetUseConfigEntry>::iterator s(set_use.begin()), s_end(set_use.end()) ;
s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
for (std::vector<SetUseConfigMinusStarEntry>::iterator s(set_use_prefixes_that_have_minus_star.begin()),
s_end(set_use_prefixes_that_have_minus_star.end()) ; s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
}
@@ -174,14 +174,14 @@ namespace paludis
for (std::vector<SetKeywordConfigEntry>::iterator s(set_keywords.begin()), s_end(set_keywords.end()) ;
s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
}
@@ -191,14 +191,14 @@ namespace paludis
for (std::vector<SetLicenseConfigEntry>::iterator s(set_licenses.begin()), s_end(set_licenses.end()) ;
s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
}
@@ -208,14 +208,14 @@ namespace paludis
for (std::vector<SetMaskConfigEntry>::iterator s(set_unmasks.begin()), s_end(set_unmasks.end()) ;
s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
}
@@ -225,14 +225,14 @@ namespace paludis
for (std::vector<SetMaskConfigEntry>::iterator s(set_masks.begin()), s_end(set_masks.end()) ;
s != s_end ; ++s)
- if (! s->dep_atom)
+ if (! s->dep_spec)
{
- s->dep_atom = DefaultEnvironment::get_instance()->package_set(s->set_name);
- if (! s->dep_atom)
+ s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
stringify(s->set_name) + "' doesn't exist");
- s->dep_atom.reset(new AllDepAtom);
+ s->dep_spec.reset(new AllDepSpec);
}
}
}
@@ -413,11 +413,11 @@ DefaultConfig::DefaultConfig() :
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
_imp->set_keywords.push_back(SetKeywordConfigEntry(
- SetName(tokens.at(0)), std::tr1::shared_ptr<DepAtom>(), KeywordName(*t)));
+ SetName(tokens.at(0)), std::tr1::shared_ptr<DepSpec>(), KeywordName(*t)));
}
else
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(tokens.at(0)));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(tokens.at(0)));
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
_imp->keywords[a->package()].push_back(std::make_pair(a, *t));
@@ -458,7 +458,7 @@ DefaultConfig::DefaultConfig() :
std::copy(next(tokens.begin()), tokens.end(), std::back_inserter(_imp->default_licenses));
else
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(tokens.at(0)));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(tokens.at(0)));
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
_imp->licenses[a->package()].push_back(std::make_pair(a, *t));
@@ -497,10 +497,10 @@ DefaultConfig::DefaultConfig() :
if (std::string::npos == line->find('/'))
_imp->set_masks.push_back(SetMaskConfigEntry(SetName(*line),
- std::tr1::shared_ptr<const DepAtom>()));
+ std::tr1::shared_ptr<const DepSpec>()));
else
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(*line));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
_imp->user_masks[a->package()].push_back(a);
}
}
@@ -532,10 +532,10 @@ DefaultConfig::DefaultConfig() :
if (std::string::npos == line->find('/'))
_imp->set_unmasks.push_back(SetMaskConfigEntry(SetName(*line),
- std::tr1::shared_ptr<const DepAtom>()));
+ std::tr1::shared_ptr<const DepSpec>()));
else
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(*line));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
_imp->user_unmasks[a->package()].push_back(a);
}
}
@@ -607,10 +607,10 @@ DefaultConfig::DefaultConfig() :
{
if ("-*" == *t)
_imp->set_use_prefixes_that_have_minus_star.push_back(SetUseConfigMinusStarEntry(
- SetName(tokens.at(0)), std::tr1::shared_ptr<const DepAtom>(), prefix));
+ SetName(tokens.at(0)), std::tr1::shared_ptr<const DepSpec>(), prefix));
else
_imp->set_use.push_back(SetUseConfigEntry(SetName(tokens.at(0)),
- std::tr1::shared_ptr<const DepAtom>(), UseFlagName(prefix + t->substr(1)), use_disabled));
+ std::tr1::shared_ptr<const DepSpec>(), UseFlagName(prefix + t->substr(1)), use_disabled));
}
else if (':' == t->at(t->length() - 1))
{
@@ -621,12 +621,12 @@ DefaultConfig::DefaultConfig() :
}
else
_imp->set_use.push_back(SetUseConfigEntry(SetName(tokens.at(0)),
- std::tr1::shared_ptr<const DepAtom>(), UseFlagName(prefix + *t), use_enabled));
+ std::tr1::shared_ptr<const DepSpec>(), UseFlagName(prefix + *t), use_enabled));
}
}
else
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(tokens.at(0)));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(tokens.at(0)));
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
{
@@ -774,7 +774,7 @@ DefaultConfig::PackageKeywordsIterator
DefaultConfig::begin_package_keywords(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, KeywordName> > >::const_iterator r;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > >::const_iterator r;
if (_imp->keywords.end() != ((r = _imp->keywords.find(d))))
return PackageKeywordsIterator(r->second.begin());
else
@@ -785,7 +785,7 @@ DefaultConfig::PackageKeywordsIterator
DefaultConfig::end_package_keywords(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, KeywordName> > >::const_iterator r;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > >::const_iterator r;
if (_imp->keywords.end() != ((r = _imp->keywords.find(d))))
return PackageKeywordsIterator(r->second.end());
else
@@ -808,7 +808,7 @@ DefaultConfig::PackageLicensesIterator
DefaultConfig::begin_package_licenses(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > >::const_iterator r;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->licenses.end() != ((r = _imp->licenses.find(d))))
return PackageLicensesIterator(r->second.begin());
else
@@ -819,7 +819,7 @@ DefaultConfig::PackageLicensesIterator
DefaultConfig::end_package_licenses(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
- std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > >::const_iterator r;
+ std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->licenses.end() != ((r = _imp->licenses.find(d))))
return PackageLicensesIterator(r->second.end());
else
@@ -841,41 +841,41 @@ DefaultConfig::end_default_licenses() const
DefaultConfig::UserMasksIterator
DefaultConfig::begin_user_masks(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_masks.end() != ((r = _imp->user_masks.find(d))))
- return UserMasksIterator(indirect_iterator<const PackageDepAtom>(r->second.begin()));
+ return UserMasksIterator(indirect_iterator<const PackageDepSpec>(r->second.begin()));
else
- return UserMasksIterator(indirect_iterator<const PackageDepAtom>(_imp->empty_masks.begin()));
+ return UserMasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.begin()));
}
DefaultConfig::UserMasksIterator
DefaultConfig::end_user_masks(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_masks.end() != ((r = _imp->user_masks.find(d))))
- return UserMasksIterator(indirect_iterator<const PackageDepAtom>(r->second.end()));
+ return UserMasksIterator(indirect_iterator<const PackageDepSpec>(r->second.end()));
else
- return UserMasksIterator(indirect_iterator<const PackageDepAtom>(_imp->empty_masks.end()));
+ return UserMasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.end()));
}
DefaultConfig::UserUnmasksIterator
DefaultConfig::begin_user_unmasks(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_unmasks.end() != ((r = _imp->user_unmasks.find(d))))
- return UserUnmasksIterator(indirect_iterator<const PackageDepAtom>(r->second.begin()));
+ return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(r->second.begin()));
else
- return UserUnmasksIterator(indirect_iterator<const PackageDepAtom>(_imp->empty_masks.begin()));
+ return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.begin()));
}
DefaultConfig::UserUnmasksIterator
DefaultConfig::end_user_unmasks(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_unmasks.end() != ((r = _imp->user_unmasks.find(d))))
- return UserUnmasksIterator(indirect_iterator<const PackageDepAtom>(r->second.end()));
+ return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(r->second.end()));
else
- return UserUnmasksIterator(indirect_iterator<const PackageDepAtom>(_imp->empty_masks.end()));
+ return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.end()));
}
DefaultConfig::UseConfigIterator
@@ -961,7 +961,7 @@ DefaultConfig::end_use_prefixes_with_minus_star() const
DefaultConfig::PackageUseMinusStarIterator
DefaultConfig::begin_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->use_prefixes_that_have_minus_star.end() != ((r = _imp->use_prefixes_that_have_minus_star.find(d))))
return PackageUseMinusStarIterator(r->second.begin());
else
@@ -971,7 +971,7 @@ DefaultConfig::begin_package_use_prefixes_with_minus_star(const QualifiedPackage
DefaultConfig::PackageUseMinusStarIterator
DefaultConfig::end_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
{
- std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > >::const_iterator r;
+ std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->use_prefixes_that_have_minus_star.end() != ((r = _imp->use_prefixes_that_have_minus_star.find(d))))
return PackageUseMinusStarIterator(r->second.end());
else
diff --git a/paludis/environment/default/default_config.hh b/paludis/environment/default/default_config.hh
index fb8327b..eb3fe08 100644
--- a/paludis/environment/default/default_config.hh
+++ b/paludis/environment/default/default_config.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEFAULT_CONFIG_HH
#define PALUDIS_GUARD_PALUDIS_DEFAULT_CONFIG_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
#include <paludis/util/collection.hh>
#include <paludis/util/exception.hh>
@@ -112,7 +112,7 @@ namespace paludis
///\{
typedef libwrapiter::ForwardIterator<DefaultConfig,
- const std::pair<std::tr1::shared_ptr<const PackageDepAtom>, KeywordName> > PackageKeywordsIterator;
+ const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > PackageKeywordsIterator;
PackageKeywordsIterator begin_package_keywords(const QualifiedPackageName & d) const;
@@ -135,7 +135,7 @@ namespace paludis
///\{
typedef libwrapiter::ForwardIterator<DefaultConfig,
- const std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > PackageLicensesIterator;
+ const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > PackageLicensesIterator;
PackageLicensesIterator begin_package_licenses(const QualifiedPackageName & d) const;
@@ -157,13 +157,13 @@ namespace paludis
///\name Iterate over our masks and unmasks
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepAtom> UserMasksIterator;
+ typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepSpec> UserMasksIterator;
UserMasksIterator begin_user_masks(const QualifiedPackageName & d) const;
UserMasksIterator end_user_masks(const QualifiedPackageName & d) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepAtom> UserUnmasksIterator;
+ typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepSpec> UserUnmasksIterator;
UserUnmasksIterator begin_user_unmasks(const QualifiedPackageName & d) const;
@@ -200,7 +200,7 @@ namespace paludis
UseMinusStarIterator end_use_prefixes_with_minus_star() const;
typedef libwrapiter::ForwardIterator<DefaultConfig,
- const std::pair<std::tr1::shared_ptr<const PackageDepAtom>, std::string> > PackageUseMinusStarIterator;
+ const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > PackageUseMinusStarIterator;
PackageUseMinusStarIterator begin_package_use_prefixes_with_minus_star(const QualifiedPackageName &) const;
PackageUseMinusStarIterator end_package_use_prefixes_with_minus_star(const QualifiedPackageName &) const;
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index f86ffe9..66275c9 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -89,7 +89,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
if (u->flag_name != f)
continue;
- if (! match_package(*this, *u->dep_atom, *e))
+ if (! match_package(*this, *u->dep_spec, *e))
continue;
Log::get_instance()->message(ll_debug, lc_no_context, "Forced use flag: "
@@ -112,7 +112,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
if (f != u->flag_name)
continue;
- if (! match_package(*this, *u->dep_atom, *e))
+ if (! match_package(*this, *u->dep_spec, *e))
continue;
switch (u->flag_state)
@@ -175,7 +175,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
if (f != u->flag_name)
continue;
- if (! match_package_in_heirarchy(*this, *u->dep_atom, *e))
+ if (! match_package_in_heirarchy(*this, *u->dep_spec, *e))
continue;
switch (u->flag_state)
@@ -217,7 +217,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
i_end(DefaultConfig::get_instance()->end_set_use_prefixes_with_minus_star()) ;
i != i_end ; ++i)
{
- if (! match_package_in_heirarchy(*this, *i->dep_atom, *e))
+ if (! match_package_in_heirarchy(*this, *i->dep_spec, *e))
continue;
if (0 == i->prefix.compare(0, i->prefix.length(), stringify(f), 0, i->prefix.length()))
@@ -334,7 +334,7 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
k_end(DefaultConfig::get_instance()->end_set_keywords()) ;
k != k_end ; ++k)
{
- if (! match_package_in_heirarchy(*this, *k->dep_atom, *d))
+ if (! match_package_in_heirarchy(*this, *k->dep_spec, *d))
continue;
if (k->keyword == minus_star_keyword)
@@ -401,7 +401,7 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
k_end(DefaultConfig::get_instance()->end_set_licenses()) ;
k != k_end ; ++k)
{
- if (! match_package_in_heirarchy(*this, *k->dep_atom, *d))
+ if (! match_package_in_heirarchy(*this, *k->dep_spec, *d))
continue;
if (k->license == "-*")
@@ -453,7 +453,7 @@ DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
k_end(DefaultConfig::get_instance()->end_user_masks_sets()) ;
k != k_end ; ++k)
{
- if (! match_package_in_heirarchy(*this, *k->dep_atom, d))
+ if (! match_package_in_heirarchy(*this, *k->dep_spec, d))
continue;
return true;
@@ -481,7 +481,7 @@ DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
k_end(DefaultConfig::get_instance()->end_user_unmasks_sets()) ;
k != k_end ; ++k)
{
- if (! match_package_in_heirarchy(*this, *k->dep_atom, d))
+ if (! match_package_in_heirarchy(*this, *k->dep_spec, d))
continue;
return true;
@@ -647,7 +647,7 @@ DefaultEnvironment::syncers_dirs() const
return dirs;
}
-std::tr1::shared_ptr<CompositeDepAtom>
+std::tr1::shared_ptr<CompositeDepSpec>
DefaultEnvironment::local_package_set(const SetName & s) const
{
Context context("When looking for package set '" + stringify(s) + "' in default environment:");
@@ -656,7 +656,7 @@ DefaultEnvironment::local_package_set(const SetName & s) const
if (ff.exists())
{
LineConfigFile f(ff);
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
std::tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(s, stringify(s) + ".conf"));
for (LineConfigFile::Iterator line(f.begin()), line_end(f.end()) ;
@@ -671,19 +671,19 @@ DefaultEnvironment::local_package_set(const SetName & s) const
{
Log::get_instance()->message(ll_warning, lc_context, "Line '" + *line + "' in set file '"
+ stringify(ff) + "' does not specify '*' or '?', assuming '*'");
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(tokens.at(0)));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(0)));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
else if ("*" == tokens.at(0))
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(tokens.at(1)));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(1)));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
else if ("?" == tokens.at(0))
{
- std::tr1::shared_ptr<PackageDepAtom> p(new PackageDepAtom(tokens.at(1)));
+ std::tr1::shared_ptr<PackageDepSpec> p(new PackageDepSpec(tokens.at(1)));
p->set_tag(tag);
if (! package_database()->query(
query::Package(p->package()) & query::InstalledAtRoot(root()),
@@ -702,7 +702,7 @@ DefaultEnvironment::local_package_set(const SetName & s) const
return result;
}
- return std::tr1::shared_ptr<AllDepAtom>();
+ return std::tr1::shared_ptr<AllDepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
@@ -753,10 +753,10 @@ DefaultEnvironment::known_use_expand_names(const UseFlagName & prefix, const Pac
for (DefaultConfig::UseConfigIterator i(DefaultConfig::get_instance()->begin_forced_use_config()),
i_end(DefaultConfig::get_instance()->end_forced_use_config()) ; i != i_end ; ++i)
{
- if (! i->dep_atom)
+ if (! i->dep_spec)
continue;
- if (! match_package(*this, *i->dep_atom, *pde))
+ if (! match_package(*this, *i->dep_spec, *pde))
continue;
if (i->flag_name.data().length() > prefix_lower.length() &&
diff --git a/paludis/environment/default/default_environment.hh b/paludis/environment/default/default_environment.hh
index 296e199..6e33911 100644
--- a/paludis/environment/default/default_environment.hh
+++ b/paludis/environment/default/default_environment.hh
@@ -50,7 +50,7 @@ namespace paludis
~DefaultEnvironment();
protected:
- std::tr1::shared_ptr<CompositeDepAtom> local_package_set(const SetName &) const;
+ std::tr1::shared_ptr<CompositeDepSpec> local_package_set(const SetName &) const;
public:
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
diff --git a/paludis/environment/default/use_config_entry.sr b/paludis/environment/default/use_config_entry.sr
index c364eb3..d2f3262 100644
--- a/paludis/environment/default/use_config_entry.sr
+++ b/paludis/environment/default/use_config_entry.sr
@@ -3,7 +3,7 @@
make_class_UseConfigEntry()
{
- key dep_atom "std::tr1::shared_ptr<const PackageDepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const PackageDepSpec>"
key flag_name UseFlagName
key flag_state UseFlagState
@@ -21,7 +21,7 @@ END
make_class_SetUseConfigEntry()
{
key set_name SetName
- key dep_atom "std::tr1::shared_ptr<const DepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key flag_name UseFlagName
key flag_state UseFlagState
@@ -39,7 +39,7 @@ END
make_class_SetUseConfigMinusStarEntry()
{
key set_name SetName
- key dep_atom "std::tr1::shared_ptr<const DepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key prefix std::string
doxygen_comment << "END"
@@ -56,7 +56,7 @@ END
make_class_SetKeywordConfigEntry()
{
key set_name SetName
- key dep_atom "std::tr1::shared_ptr<const DepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key keyword KeywordName
doxygen_comment << "END"
@@ -73,7 +73,7 @@ END
make_class_SetLicenseConfigEntry()
{
key set_name SetName
- key dep_atom "std::tr1::shared_ptr<const DepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key license std::string
doxygen_comment << "END"
@@ -90,7 +90,7 @@ END
make_class_SetMaskConfigEntry()
{
key set_name SetName
- key dep_atom "std::tr1::shared_ptr<const DepAtom>"
+ key dep_spec "std::tr1::shared_ptr<const DepSpec>"
doxygen_comment << "END"
/**
diff --git a/paludis/files.m4 b/paludis/files.m4
index 3500a4e..8ed37b1 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -11,9 +11,9 @@ dnl on this file at present...
add(`about', `hh', `test')
add(`config_file', `hh', `cc', `test', `testscript')
add(`contents', `hh', `cc')
-add(`dep_atom', `hh', `cc', `test')
-add(`dep_atom_flattener', `hh', `cc')
-add(`dep_atom_pretty_printer', `hh', `cc')
+add(`dep_spec', `hh', `cc', `test')
+add(`dep_spec_flattener', `hh', `cc')
+add(`dep_spec_pretty_printer', `hh', `cc')
add(`dep_tag', `hh', `cc', `sr')
add(`environment', `hh', `cc')
add(`hashed_containers', `hhx', `cc', `test')
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 67094df..020406c 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -30,18 +30,18 @@ using namespace paludis;
bool
paludis::match_package(
const Environment & env,
- const PackageDepAtom & atom,
+ const PackageDepSpec & spec,
const PackageDatabaseEntry & entry)
{
- if (atom.package() != entry.name)
+ if (spec.package() != entry.name)
return false;
- if (atom.version_requirements_ptr())
- switch (atom.version_requirements_mode())
+ if (spec.version_requirements_ptr())
+ switch (spec.version_requirements_mode())
{
case vr_and:
- for (VersionRequirements::Iterator r(atom.version_requirements_ptr()->begin()),
- r_end(atom.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ for (VersionRequirements::Iterator r(spec.version_requirements_ptr()->begin()),
+ r_end(spec.version_requirements_ptr()->end()) ; r != r_end ; ++r)
if (! (((entry.version).*(r->version_operator.as_version_spec_operator()))(r->version_spec)))
return false;
break;
@@ -49,8 +49,8 @@ paludis::match_package(
case vr_or:
{
bool matched(false);
- for (VersionRequirements::Iterator r(atom.version_requirements_ptr()->begin()),
- r_end(atom.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ for (VersionRequirements::Iterator r(spec.version_requirements_ptr()->begin()),
+ r_end(spec.version_requirements_ptr()->end()) ; r != r_end ; ++r)
if ((((entry.version).*(r->version_operator.as_version_spec_operator()))(r->version_spec)))
{
matched = true;
@@ -66,24 +66,24 @@ paludis::match_package(
;
}
- if (atom.repository_ptr())
- if (*atom.repository_ptr() != entry.repository)
+ if (spec.repository_ptr())
+ if (*spec.repository_ptr() != entry.repository)
return false;
- if (atom.slot_ptr() || atom.use_requirements_ptr())
+ if (spec.slot_ptr() || spec.use_requirements_ptr())
{
std::tr1::shared_ptr<const VersionMetadata> metadata(env.package_database()->fetch_repository(
entry.repository)->version_metadata(
entry.name, entry.version));
- if (atom.slot_ptr())
- if (*atom.slot_ptr() != SlotName(metadata->slot))
+ if (spec.slot_ptr())
+ if (*spec.slot_ptr() != SlotName(metadata->slot))
return false;
- if (atom.use_requirements_ptr())
+ if (spec.use_requirements_ptr())
{
- for (UseRequirements::Iterator u(atom.use_requirements_ptr()->begin()),
- u_end(atom.use_requirements_ptr()->end()) ; u != u_end ; ++u)
+ for (UseRequirements::Iterator u(spec.use_requirements_ptr()->begin()),
+ u_end(spec.use_requirements_ptr()->end()) ; u != u_end ; ++u)
{
switch (u->second)
{
@@ -111,15 +111,15 @@ paludis::match_package(
namespace
{
struct IsInHeirarchy :
- DepAtomVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor,
std::unary_function<PackageDatabaseEntry, bool>
{
const Environment & env;
- const DepAtom & target;
+ const DepSpec & target;
const PackageDatabaseEntry * dbe;
bool matched;
- IsInHeirarchy(const Environment & e, const DepAtom & t) :
+ IsInHeirarchy(const Environment & e, const DepSpec & t) :
env(e),
target(t),
matched(false)
@@ -134,7 +134,7 @@ namespace
return matched;
}
- void visit(const AllDepAtom * const a)
+ void visit(const AllDepSpec * const a)
{
if (matched)
return;
@@ -142,7 +142,7 @@ namespace
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const PackageDepAtom * const a)
+ void visit(const PackageDepSpec * const a)
{
if (matched)
return;
@@ -151,7 +151,7 @@ namespace
matched = true;
}
- void visit(const UseDepAtom * const u)
+ void visit(const UseDepSpec * const u)
{
if (matched)
return;
@@ -159,7 +159,7 @@ namespace
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const AnyDepAtom * const a)
+ void visit(const AnyDepSpec * const a)
{
if (matched)
return;
@@ -167,13 +167,13 @@ namespace
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn))
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "Got PlainTextDepAtom?");
+ throw InternalError(PALUDIS_HERE, "Got PlainTextDepSpec?");
}
};
}
@@ -181,10 +181,10 @@ namespace
bool
paludis::match_package_in_heirarchy(
const Environment & env,
- const DepAtom & atom,
+ const DepSpec & spec,
const PackageDatabaseEntry & entry)
{
- IsInHeirarchy h(env, atom);
+ IsInHeirarchy h(env, spec);
return h(entry);
}
diff --git a/paludis/match_package.hh b/paludis/match_package.hh
index cdc97a3..095f91a 100644
--- a/paludis/match_package.hh
+++ b/paludis/match_package.hh
@@ -6,37 +6,37 @@
/** \file
* Declare the match_package function.
*
- * Do not merge this file into dep_atom. It will cause all sorts of horrible
+ * Do not merge this file into dep_spec. It will cause all sorts of horrible
* circular dependency issues. Avoid including this file in headers if at all
* possible.
*
* \ingroup grpmatchpackage
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/util/attributes.hh>
namespace paludis
{
/**
- * Return whether the specified atom matches the specified target.
+ * Return whether the specified spec matches the specified target.
*
* \ingroup grpmatchpackage
*/
bool match_package(
const Environment & env,
- const PackageDepAtom & atom,
+ const PackageDepSpec & spec,
const PackageDatabaseEntry & target);
/**
- * Return whether the specified atom matches the specified target, for heirarchies.
+ * Return whether the specified spec matches the specified target, for heirarchies.
*
* \ingroup grpmatchpackage
*/
bool match_package_in_heirarchy(
const Environment & env,
- const DepAtom & atom,
+ const DepSpec & spec,
const PackageDatabaseEntry & target);
}
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index a55d2f0..26ff3f8 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/match_package.hh>
#include <paludis/package_database.hh>
#include <paludis/util/iterator.hh>
@@ -203,13 +203,13 @@ PackageDatabase::fetch_unique_qualified_package_name(
}
std::tr1::shared_ptr<PackageDatabaseEntryCollection>
-PackageDatabase::query(const PackageDepAtom & a, const InstallState installed_state) const
+PackageDatabase::query(const PackageDepSpec & a, const InstallState installed_state) const
{
return query(a, installed_state, qo_order_by_version);
}
std::tr1::shared_ptr<PackageDatabaseEntryCollection>
-PackageDatabase::query(const PackageDepAtom & a, const InstallState installed_state,
+PackageDatabase::query(const PackageDepSpec & a, const InstallState installed_state,
const QueryOrder query_order) const
{
switch (installed_state)
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 267f230..f0a8447 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_PACKAGE_DATABASE_HH
#define PALUDIS_GUARD_PALUDIS_PACKAGE_DATABASE_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
#include <paludis/repository.hh>
#include <paludis/util/exception.hh>
@@ -46,7 +46,7 @@
namespace paludis
{
- class PackageDepAtom;
+ class PackageDepSpec;
class Query;
class Environment;
@@ -289,14 +289,14 @@ namespace paludis
* \deprecated use the Query form
*/
std::tr1::shared_ptr<PackageDatabaseEntryCollection> query(
- const PackageDepAtom & a,
+ const PackageDepSpec & a,
const InstallState) const;
/**
* Query the repository.
*/
std::tr1::shared_ptr<PackageDatabaseEntryCollection> query(
- const PackageDepAtom & a,
+ const PackageDepSpec & a,
const InstallState,
const QueryOrder) const;
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 2a87daf..3a8668f 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -113,42 +113,42 @@ namespace test_cases
p.add_repository(r2);
TEST_CHECK(true);
- PackageDepAtom d1("r1c1/r1c1p1");
+ PackageDepSpec d1("r1c1/r1c1p1");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q1(p.query(
query::Matches(d1), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q1->begin(), q1->end()), 1);
- PackageDepAtom d2("r1c1/r1c1p2");
+ PackageDepSpec d2("r1c1/r1c1p2");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q2(p.query(
query::Matches(d2), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q2->begin(), q2->end()), 2);
- PackageDepAtom d3(">=r1c1/r1c1p2-1");
+ PackageDepSpec d3(">=r1c1/r1c1p2-1");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q3(p.query(
query::Matches(d3), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q3->begin(), q3->end()), 2);
- PackageDepAtom d4(">=r1c1/r1c1p2-2");
+ PackageDepSpec d4(">=r1c1/r1c1p2-2");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q4(p.query(
query::Matches(d4), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q4->begin(), q4->end()), 1);
- PackageDepAtom d5(">=r1c1/r1c1p2-3");
+ PackageDepSpec d5(">=r1c1/r1c1p2-3");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q5(p.query(
query::Matches(d5), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q5->begin(), q5->end()), 0);
- PackageDepAtom d6("<r1c1/r1c1p2-3");
+ PackageDepSpec d6("<r1c1/r1c1p2-3");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q6(p.query(
query::Matches(d6), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q6->begin(), q6->end()), 2);
- PackageDepAtom d7("rac1/rac1pa");
+ PackageDepSpec d7("rac1/rac1pa");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q7(p.query(
query::Matches(d7), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q7->begin(), q7->end()), 4);
- PackageDepAtom d8("foo/bar");
+ PackageDepSpec d8("foo/bar");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q8(p.query(
query::Matches(d8), qo_order_by_version));
TEST_CHECK_EQUAL(std::distance(q8->begin(), q8->end()), 0);
@@ -178,7 +178,7 @@ namespace test_cases
p.add_repository(r2);
TEST_CHECK(true);
- PackageDepAtom d("cat/pkg");
+ PackageDepSpec d("cat/pkg");
const std::tr1::shared_ptr<PackageDatabaseEntryCollection> q1(p.query(d, is_any, qo_order_by_version));
TEST_CHECK_EQUAL(join(q1->begin(), q1->end(), " "),
diff --git a/paludis/portage_dep_lexer.cc b/paludis/portage_dep_lexer.cc
index 60ba655..741c4d9 100644
--- a/paludis/portage_dep_lexer.cc
+++ b/paludis/portage_dep_lexer.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_lexer.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/tokeniser.hh>
diff --git a/paludis/portage_dep_lexer_TEST.cc b/paludis/portage_dep_lexer_TEST.cc
index 15e2b9c..62792ef 100644
--- a/paludis/portage_dep_lexer_TEST.cc
+++ b/paludis/portage_dep_lexer_TEST.cc
@@ -46,7 +46,7 @@ namespace test_cases
PortageDepLexer::Iterator i(l.begin());
TEST_CHECK(i == l.end());
}
- } test_dep_atom_parser_lexer_empty;
+ } test_dep_spec_parser_lexer_empty;
/**
* \test Test PortageDepLexer with a blank input.
@@ -65,7 +65,7 @@ namespace test_cases
TEST_CHECK_EQUAL(i->second, " \n \t");
TEST_CHECK(++i == l.end());
}
- } test_dep_atom_parser_lexer_blank;
+ } test_dep_spec_parser_lexer_blank;
/**
* \test Test PortageDepLexer with a package.
@@ -84,7 +84,7 @@ namespace test_cases
TEST_CHECK_EQUAL(i->second, "app-editors/vim");
TEST_CHECK(++i == l.end());
}
- } test_dep_atom_parser_lexer_package;
+ } test_dep_spec_parser_lexer_package;
/**
* \test Test DepParser with a sequence of packages.
@@ -121,7 +121,7 @@ namespace test_cases
TEST_CHECK(++i == l.end());
}
- } test_dep_atom_parser_lexer_packages;
+ } test_dep_spec_parser_lexer_packages;
/**
* \test Test PortageDepLexer with an any group.
@@ -174,7 +174,7 @@ namespace test_cases
TEST_CHECK(++i == l.end());
}
- } test_dep_atom_parser_lexer_any;
+ } test_dep_spec_parser_lexer_any;
/**
* \test Test PortageDepLexer with a use group.
@@ -219,7 +219,7 @@ namespace test_cases
TEST_CHECK(++i == l.end());
}
- } test_dep_atom_parser_lexer_use;
+ } test_dep_spec_parser_lexer_use;
/**
* \test Test PortageDepLexer with bad input.
@@ -235,7 +235,7 @@ namespace test_cases
TEST_CHECK_THROWS(PortageDepLexer("|foo"), DepStringError);
TEST_CHECK_THROWS(PortageDepLexer("( moo )bar"), DepStringError);
}
- } test_dep_atom_parser_lexer_bad;
+ } test_dep_spec_parser_lexer_bad;
}
diff --git a/paludis/portage_dep_parser.cc b/paludis/portage_dep_parser.cc
index ecd56fc..b4b9bc7 100644
--- a/paludis/portage_dep_parser.cc
+++ b/paludis/portage_dep_parser.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_lexer.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/util/exception.hh>
@@ -61,13 +61,13 @@ namespace
};
}
-std::tr1::shared_ptr<CompositeDepAtom>
+std::tr1::shared_ptr<CompositeDepSpec>
PortageDepParser::parse(const std::string & s, const PortageDepParserPolicyInterface * const policy)
{
Context context("When parsing dependency string '" + s + "':");
- std::stack<std::tr1::shared_ptr<CompositeDepAtom> > stack;
- stack.push(std::tr1::shared_ptr<CompositeDepAtom>(new AllDepAtom));
+ std::stack<std::tr1::shared_ptr<CompositeDepSpec> > stack;
+ stack.push(std::tr1::shared_ptr<CompositeDepSpec>(new AllDepSpec));
PortageDepParserState state(dps_initial);
PortageDepLexer lexer(s);
@@ -93,13 +93,13 @@ PortageDepParser::parse(const std::string & s, const PortageDepParserPolicyInter
{
if (i->second.empty())
throw DepStringParseError(i->second, "Empty text entry");
- stack.top()->add_child(policy->new_text_atom(i->second));
+ stack.top()->add_child(policy->new_text_spec(i->second));
}
continue;
case dpl_open_paren:
{
- std::tr1::shared_ptr<CompositeDepAtom> a(new AllDepAtom);
+ std::tr1::shared_ptr<CompositeDepSpec> a(new AllDepSpec);
stack.top()->add_child(a);
stack.push(a);
state = dps_had_paren;
@@ -118,7 +118,7 @@ PortageDepParser::parse(const std::string & s, const PortageDepParserPolicyInter
case dpl_double_bar:
if (policy->permit_any_deps())
{
- std::tr1::shared_ptr<CompositeDepAtom> a(new AnyDepAtom);
+ std::tr1::shared_ptr<CompositeDepSpec> a(new AnyDepSpec);
stack.top()->add_child(a);
stack.push(a);
state = dps_had_double_bar;
@@ -143,8 +143,8 @@ PortageDepParser::parse(const std::string & s, const PortageDepParserPolicyInter
"Use flag name '" + i->second + "' missing '?'");
f.erase(f.length() - 1);
- std::tr1::shared_ptr<CompositeDepAtom> a(
- new UseDepAtom(UseFlagName(f), inv));
+ std::tr1::shared_ptr<CompositeDepSpec> a(
+ new UseDepSpec(UseFlagName(f), inv));
stack.top()->add_child(a);
stack.push(a);
state = dps_had_use_flag;
@@ -272,21 +272,21 @@ PortageDepParser::parse(const std::string & s, const PortageDepParserPolicyInter
if (stack.empty())
throw DepStringNestingError(s);
- std::tr1::shared_ptr<CompositeDepAtom> result(stack.top());
+ std::tr1::shared_ptr<CompositeDepSpec> result(stack.top());
stack.pop();
if (! stack.empty())
throw DepStringNestingError(s);
return result;
}
-std::tr1::shared_ptr<const CompositeDepAtom>
+std::tr1::shared_ptr<const CompositeDepSpec>
PortageDepParser::parse_depend(const std::string & s)
{
return PortageDepParser::parse(s);
}
-std::tr1::shared_ptr<const CompositeDepAtom>
+std::tr1::shared_ptr<const CompositeDepSpec>
PortageDepParser::parse_license(const std::string & s)
{
- return PortageDepParser::parse(s, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance());
+ return PortageDepParser::parse(s, PortageDepParserPolicy<PlainTextDepSpec, true>::get_instance());
}
diff --git a/paludis/portage_dep_parser.hh b/paludis/portage_dep_parser.hh
index 30dade1..20e361f 100644
--- a/paludis/portage_dep_parser.hh
+++ b/paludis/portage_dep_parser.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_PORTAGE_DEP_PARSER_HH
#define PALUDIS_GUARD_PALUDIS_PORTAGE_DEP_PARSER_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_lexer.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/instantiation_policy.hh>
@@ -77,9 +77,9 @@ namespace paludis
struct PortageDepParserPolicyInterface
{
/**
- * Create a new text atom from the provided string.
+ * Create a new text spec from the provided string.
*/
- virtual std::tr1::shared_ptr<DepAtom> new_text_atom(const std::string &) const = 0;
+ virtual std::tr1::shared_ptr<DepSpec> new_text_spec(const std::string &) const = 0;
/**
* Are || ( ) deps permitted?
@@ -116,9 +116,9 @@ namespace paludis
}
public:
- virtual std::tr1::shared_ptr<DepAtom> new_text_atom(const std::string & s) const
+ virtual std::tr1::shared_ptr<DepSpec> new_text_spec(const std::string & s) const
{
- return std::tr1::shared_ptr<DepAtom>(new TextAtom_(s));
+ return std::tr1::shared_ptr<DepSpec>(new TextAtom_(s));
}
virtual bool permit_any_deps() const
@@ -129,19 +129,19 @@ namespace paludis
/**
* Policy class describing how PortageDepParser::parse should behave
- * (specialisation for PackageDepAtom).
+ * (specialisation for PackageDepSpec).
*
* \see PortageDepParser
*
* \ingroup grpdepparser
*/
template <bool permit_any_>
- class PortageDepParserPolicy<PackageDepAtom, permit_any_> :
+ class PortageDepParserPolicy<PackageDepSpec, permit_any_> :
public PortageDepParserPolicyInterface,
- public InstantiationPolicy<PortageDepParserPolicy<PackageDepAtom, permit_any_>,
+ public InstantiationPolicy<PortageDepParserPolicy<PackageDepSpec, permit_any_>,
instantiation_method::SingletonTag>
{
- friend class InstantiationPolicy<PortageDepParserPolicy<PackageDepAtom, permit_any_>,
+ friend class InstantiationPolicy<PortageDepParserPolicy<PackageDepSpec, permit_any_>,
instantiation_method::SingletonTag>;
private:
@@ -150,13 +150,13 @@ namespace paludis
}
public:
- virtual std::tr1::shared_ptr<DepAtom> new_text_atom(const std::string & s) const
+ virtual std::tr1::shared_ptr<DepSpec> new_text_spec(const std::string & s) const
{
if ((! s.empty()) && ('!' == s.at(0)))
- return std::tr1::shared_ptr<DepAtom>(new BlockDepAtom(
- std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(s.substr(1)))));
+ return std::tr1::shared_ptr<DepSpec>(new BlockDepSpec(
+ std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(s.substr(1)))));
else
- return std::tr1::shared_ptr<DepAtom>(new PackageDepAtom(s));
+ return std::tr1::shared_ptr<DepSpec>(new PackageDepSpec(s));
}
virtual bool permit_any_deps() const
@@ -167,7 +167,7 @@ namespace paludis
/**
* The PortageDepParser converts string representations of a dependency
- * specification into a DepAtom instance. The PortageDepLexer class is
+ * specification into a DepSpec instance. The PortageDepLexer class is
* used as the first stage.
*
* \ingroup grpdepparser
@@ -176,25 +176,25 @@ namespace paludis
private InstantiationPolicy<PortageDepParser, instantiation_method::NonInstantiableTag>
{
private:
- typedef PortageDepParserPolicy<PackageDepAtom, true> DefaultPolicy;
+ typedef PortageDepParserPolicy<PackageDepSpec, true> DefaultPolicy;
public:
/**
* Parse a given dependency string, and return an appropriate
- * DepAtom tree.
+ * DepSpec tree.
*/
- static std::tr1::shared_ptr<CompositeDepAtom> parse(const std::string & s,
+ static std::tr1::shared_ptr<CompositeDepSpec> parse(const std::string & s,
const PortageDepParserPolicyInterface * const policy = DefaultPolicy::get_instance());
/**
* Convenience wrapper for parse for depend strings, for VersionMetadata.
*/
- static std::tr1::shared_ptr<const CompositeDepAtom> parse_depend(const std::string & s);
+ static std::tr1::shared_ptr<const CompositeDepSpec> parse_depend(const std::string & s);
/**
* Convenience wrapper for parse for license strings, for VersionMetadata.
*/
- static std::tr1::shared_ptr<const CompositeDepAtom> parse_license(const std::string & s);
+ static std::tr1::shared_ptr<const CompositeDepSpec> parse_license(const std::string & s);
};
}
diff --git a/paludis/portage_dep_parser_TEST.cc b/paludis/portage_dep_parser_TEST.cc
index e5b05bb..7be43c3 100644
--- a/paludis/portage_dep_parser_TEST.cc
+++ b/paludis/portage_dep_parser_TEST.cc
@@ -42,11 +42,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( ) ");
}
- } test_dep_atom_parser_empty;
+ } test_dep_spec_parser_empty;
/**
* \test Test PortageDepParser with a blank input.
@@ -58,11 +58,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse(" \n \t")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( ) ");
}
- } test_dep_atom_parser_blank;
+ } test_dep_spec_parser_blank;
/**
* \test Test PortageDepParser with a package.
@@ -74,11 +74,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("app-editors/vim")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( app-editors/vim ) ");
}
- } test_dep_atom_parser_package;
+ } test_dep_spec_parser_package;
/**
* \test Test PortageDepParser with a decorated package.
@@ -90,19 +90,19 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d1(0, false);
+ DepSpecPrettyPrinter d1(0, false);
PortageDepParser::parse(">=app-editors/vim-6.4_alpha")->accept(&d1);
TEST_CHECK_EQUAL(stringify(d1), "( >=app-editors/vim-6.4_alpha ) ");
- DepAtomPrettyPrinter d2(0, false);
+ DepSpecPrettyPrinter d2(0, false);
PortageDepParser::parse("=app-editors/vim-6.4_alpha-r1")->accept(&d2);
TEST_CHECK_EQUAL(stringify(d2), "( =app-editors/vim-6.4_alpha-r1 ) ");
- DepAtomPrettyPrinter d3(0, false);
+ DepSpecPrettyPrinter d3(0, false);
PortageDepParser::parse(">=app-editors/vim-6.4_alpha:one")->accept(&d3);
TEST_CHECK_EQUAL(stringify(d3), "( >=app-editors/vim-6.4_alpha:one ) ");
}
- } test_dep_atom_parser_decorated_package;
+ } test_dep_spec_parser_decorated_package;
/**
* \test Test PortageDepParser with a sequence of packages.
@@ -114,11 +114,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("app-editors/vim app-misc/hilite \nsys-apps/findutils")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( app-editors/vim app-misc/hilite sys-apps/findutils ) ");
}
- } test_dep_atom_parser_packages;
+ } test_dep_spec_parser_packages;
/**
* \test Test PortageDepParser with an any group.
@@ -130,11 +130,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("|| ( one/one two/two )")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( || ( one/one two/two ) ) ");
}
- } test_dep_atom_parser_any;
+ } test_dep_spec_parser_any;
/**
* \test Test PortageDepParser with an all group.
@@ -146,11 +146,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse(" ( one/one two/two ) ")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( ( one/one two/two ) ) ");
}
- } test_dep_atom_parser_all;
+ } test_dep_spec_parser_all;
/**
* \test Test PortageDepParser with a use group.
@@ -162,11 +162,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("foo? ( one/one )")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( foo? ( one/one ) ) ");
}
- } test_dep_atom_parser_use;
+ } test_dep_spec_parser_use;
/**
* \test Test PortageDepParser with an inverse use group.
@@ -178,11 +178,11 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse("!foo? ( one/one )")->accept(&d);
TEST_CHECK_EQUAL(stringify(d), "( !foo? ( one/one ) ) ");
}
- } test_dep_atom_parser_inv_use;
+ } test_dep_spec_parser_inv_use;
/**
* \test Test PortageDepParser nesting errors.
@@ -194,14 +194,14 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
TEST_CHECK_THROWS(PortageDepParser::parse("!foo? ( one/one")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse("!foo? ( one/one ) )")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse("( ( ( ) )")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse("( ( ( ) ) ) )")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse(")")->accept(&d), DepStringError);
}
- } test_dep_atom_parser_bad_nesting;
+ } test_dep_spec_parser_bad_nesting;
/**
* \test Test PortageDepParser weird errors.
@@ -213,12 +213,12 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d(0, false);
+ DepSpecPrettyPrinter d(0, false);
TEST_CHECK_THROWS(PortageDepParser::parse("!foo? ||")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse("(((")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse(")")->accept(&d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse("(foo/bar)")->accept(&d), DepStringError);
}
- } test_dep_atom_parser_bad_values;
+ } test_dep_spec_parser_bad_values;
}
diff --git a/paludis/qa/dep_any_check.cc b/paludis/qa/dep_any_check.cc
index 2ebe005..660bbbc 100644
--- a/paludis/qa/dep_any_check.cc
+++ b/paludis/qa/dep_any_check.cc
@@ -20,7 +20,7 @@
#include <paludis/qa/dep_any_check.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/util/iterator.hh>
@@ -34,7 +34,7 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor
+ DepSpecVisitorTypes::ConstVisitor
{
CheckResult & result;
const std::string role;
@@ -47,18 +47,18 @@ namespace
{
}
- void visit(const PackageDepAtom * const)
+ void visit(const PackageDepSpec * const)
{
}
- void visit(const AllDepAtom * const a)
+ void visit(const AllDepSpec * const a)
{
/* yes, the following line is correct. */
Save<bool> in_any_save(&in_any, false);
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const AnyDepAtom * const a)
+ void visit(const AnyDepSpec * const a)
{
Save<bool> in_any_save(&in_any, true);
if (a->begin() == a->end())
@@ -72,7 +72,7 @@ namespace
}
}
- void visit(const UseDepAtom * const u)
+ void visit(const UseDepSpec * const u)
{
if (in_any)
result << Message(qal_maybe, "Conditional on '" + stringify(u->flag()) +
@@ -80,16 +80,16 @@ namespace
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const PlainTextDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PlainTextDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
};
- void Checker::visit(const PlainTextDepAtom * const t)
+ void Checker::visit(const PlainTextDepSpec * const t)
{
- throw InternalError(PALUDIS_HERE, "Found unexpected PlainTextDepAtom '"
+ throw InternalError(PALUDIS_HERE, "Found unexpected PlainTextDepSpec '"
+ t->text() + "'");
}
}
diff --git a/paludis/qa/dep_flags_check.cc b/paludis/qa/dep_flags_check.cc
index a784cec..9b66671 100644
--- a/paludis/qa/dep_flags_check.cc
+++ b/paludis/qa/dep_flags_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
@@ -33,12 +33,12 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>::visit;
CheckResult & result;
const std::string role;
@@ -54,11 +54,11 @@ namespace
{
}
- void visit(const PackageDepAtom * const)
+ void visit(const PackageDepSpec * const)
{
}
- void visit(const UseDepAtom * const u)
+ void visit(const UseDepSpec * const u)
{
std::tr1::shared_ptr<const Repository> r(env->package_database()->fetch_repository(env->package_database()->
favourite_repository()));
@@ -108,11 +108,11 @@ namespace
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
};
@@ -159,17 +159,17 @@ DepFlagsCheck::operator() (const EbuildCheckData & e) const
Checker provide_checker(result, "PROVIDE", e.environment, iuse);
std::string provide(metadata->ebuild_interface->provide_string);
- PortageDepParser::parse(provide, PortageDepParserPolicy<PackageDepAtom, false>::get_instance())->accept(&provide_checker);
+ PortageDepParser::parse(provide, PortageDepParserPolicy<PackageDepSpec, false>::get_instance())->accept(&provide_checker);
Checker license_checker(result, "LICENSE", e.environment, iuse);
std::string license(metadata->license_interface->license_string);
- PortageDepParser::parse(license, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&license_checker);
+ PortageDepParser::parse(license, PortageDepParserPolicy<PlainTextDepSpec, true>::get_instance())->accept(&license_checker);
Checker src_uri_checker(result, "SRC_URI", e.environment, iuse);
std::string src_uri(metadata->ebuild_interface->src_uri);
- PortageDepParser::parse(src_uri, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&src_uri_checker);
+ PortageDepParser::parse(src_uri, PortageDepParserPolicy<PlainTextDepSpec, true>::get_instance())->accept(&src_uri_checker);
}
}
catch (const InternalError &)
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index 521e5db..da5dfa8 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
@@ -35,14 +35,14 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>::visit;
CheckResult & result;
const std::string role;
@@ -55,18 +55,18 @@ namespace
{
}
- void visit(const PackageDepAtom * const p)
+ void visit(const PackageDepSpec * const p)
{
if (suspicious.end() != suspicious.find(p->package()))
result << Message(qal_maybe, "Suspicious " + role + " entry '"
+ stringify(p->package()) + "'");
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
};
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index 987dc30..d029de0 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
@@ -33,12 +33,12 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>::visit;
CheckResult & result;
const std::string role;
@@ -53,7 +53,7 @@ namespace
{
}
- void visit(const PackageDepAtom * const p)
+ void visit(const PackageDepSpec * const p)
{
if (env->package_database()->query(query::Package(p->package()), qo_whatever)->empty())
{
@@ -66,22 +66,22 @@ namespace
}
}
- void visit(const AnyDepAtom * const a)
+ void visit(const AnyDepSpec * const a)
{
/// \todo VV make this smarter
Save<bool> save_in_any(&in_any, true);
std::for_each(a->begin(), a->end(), accept_visitor(this));
}
- void visit(const BlockDepAtom * const b)
+ void visit(const BlockDepSpec * const b)
{
- if (env->package_database()->query(query::Package(b->blocked_atom()->package()),
+ if (env->package_database()->query(query::Package(b->blocked_spec()->package()),
qo_whatever)->empty())
result << Message(qal_maybe, "No match for " + role + " block '!"
- + stringify(b->blocked_atom()->package()) + "'");
+ + stringify(b->blocked_spec()->package()) + "'");
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
};
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index bdd60c5..5779ded 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -23,8 +23,8 @@
#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_pretty_printer.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/util/save.hh>
#include <paludis/query.hh>
@@ -35,21 +35,21 @@ using namespace paludis::qa;
namespace
{
- struct IsViableAnyDepAtomChild
+ struct IsViableAnyDepSpecChild
{
const QAEnvironment * const env;
const PackageDatabaseEntry pde;
- IsViableAnyDepAtomChild(const QAEnvironment * const e, const PackageDatabaseEntry & p) :
+ IsViableAnyDepSpecChild(const QAEnvironment * const e, const PackageDatabaseEntry & p) :
env(e),
pde(p)
{
}
template <typename T_>
- bool operator() (T_ atom) const
+ bool operator() (T_ spec) const
{
- const UseDepAtom * const u(atom->as_use_dep_atom());
+ const UseDepSpec * const u(spec->as_use_dep_spec());
if (0 != u)
{
RepositoryUseInterface * i(env->package_database()->fetch_repository(
@@ -77,10 +77,10 @@ namespace
};
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
CheckResult & result;
const std::string role;
@@ -98,7 +98,7 @@ namespace
{
}
- void visit(const PackageDepAtom * const p)
+ void visit(const PackageDepSpec * const p)
{
bool found(false);
std::string candidates;
@@ -131,17 +131,17 @@ namespace
+ candidates + ")");
}
- void visit(const AnyDepAtom * const a)
+ void visit(const AnyDepSpec * const a)
{
- std::list<std::tr1::shared_ptr<const DepAtom> > viable_children;
+ std::list<std::tr1::shared_ptr<const DepSpec> > viable_children;
std::copy(a->begin(), a->end(), filter_inserter(std::back_inserter(viable_children),
- IsViableAnyDepAtomChild(env, pde)));
+ IsViableAnyDepSpecChild(env, pde)));
if (viable_children.empty())
return;
bool found(false);
- for (std::list<std::tr1::shared_ptr<const DepAtom> >::const_iterator c(viable_children.begin()),
+ for (std::list<std::tr1::shared_ptr<const DepSpec> >::const_iterator c(viable_children.begin()),
c_end(viable_children.end()) ; c != c_end && ! found ; ++c)
{
Save<CheckResult> save_result(&result);
@@ -153,24 +153,24 @@ namespace
if (! found)
{
- DepAtomPrettyPrinter printer(0, false);
+ DepSpecPrettyPrinter printer(0, false);
a->accept(&printer);
result << Message(qal_major, "No visible provider for " + role + " entry '"
+ stringify(printer) + "'" + (unstable ? " (unstable)" : ""));
}
}
- void visit(const UseDepAtom * const u)
+ void visit(const UseDepSpec * const u)
{
- if (IsViableAnyDepAtomChild(env, pde)(u))
+ if (IsViableAnyDepSpecChild(env, pde)(u))
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
};
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index 6b360d1..67cc3ab 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
@@ -32,14 +32,14 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>::visit;
bool need_zip;
bool have_zip;
@@ -50,18 +50,18 @@ namespace
{
}
- void visit(const PlainTextDepAtom * const a)
+ void visit(const PlainTextDepSpec * const a)
{
if (a->text().length() >= 4)
if (a->text().substr(a->text().length() - 4) == ".zip")
need_zip = true;
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
- void visit(const PackageDepAtom * const p)
+ void visit(const PackageDepSpec * const p)
{
if (p->package() == QualifiedPackageName("app-arch/unzip"))
have_zip = true;
@@ -90,7 +90,7 @@ ExtractCheck::operator() (const EbuildCheckData & e) const
Checker checker;
PortageDepParser::parse(metadata->ebuild_interface->src_uri,
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance())->accept(&checker);
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance())->accept(&checker);
PortageDepParser::parse(metadata->deps_interface->build_depend_string)->accept(&checker);
if (checker.need_zip && ! checker.have_zip)
diff --git a/paludis/qa/license_check.cc b/paludis/qa/license_check.cc
index e761aa2..766d78d 100644
--- a/paludis/qa/license_check.cc
+++ b/paludis/qa/license_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
@@ -32,14 +32,14 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepSpec>::visit;
CheckResult & result;
const QAEnvironment * const env;
@@ -50,7 +50,7 @@ namespace
{
}
- void visit(const PlainTextDepAtom * const a)
+ void visit(const PlainTextDepSpec * const a)
{
RepositoryLicensesInterface *li(env->package_database()->fetch_repository(
env->portage_repository()->name())->licenses_interface);
@@ -59,20 +59,20 @@ namespace
result << Message(qal_major, "Item '" + a->text() + "' is not a licence");
}
- void visit(const BlockDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const PackageDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const BlockDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PackageDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
};
void
- Checker::visit(const BlockDepAtom * const)
+ Checker::visit(const BlockDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Unexpected BlockDepAtom");
+ throw InternalError(PALUDIS_HERE, "Unexpected BlockDepSpec");
}
void
- Checker::visit(const PackageDepAtom * const)
+ Checker::visit(const PackageDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Unexpected PackageDepAtom");
+ throw InternalError(PALUDIS_HERE, "Unexpected PackageDepSpec");
}
}
@@ -98,7 +98,7 @@ LicenseCheck::operator() (const EbuildCheckData & e) const
std::string license(metadata->license_interface->license_string);
- std::tr1::shared_ptr<const DepAtom> license_parts;
+ std::tr1::shared_ptr<const DepSpec> license_parts;
try
{
license_parts = metadata->license_interface->license();
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index e9169df..87af6c2 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
@@ -33,14 +33,14 @@ using namespace paludis::qa;
namespace
{
struct Collector :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, AnyDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, UseDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, AnyDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, UseDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, UseDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Collector, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, UseDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Collector, AnyDepSpec>::visit;
std::set<QualifiedPackageName> result;
@@ -48,16 +48,16 @@ namespace
{
}
- void visit(const PackageDepAtom * const p)
+ void visit(const PackageDepSpec * const p)
{
result.insert(p->package());
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
};
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index f1ad2a5..0d66f55 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
@@ -33,12 +33,12 @@ using namespace paludis::qa;
namespace
{
struct Checker :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, UseDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<Checker, AllDepSpec>::visit;
CheckResult & result;
bool fetch_restrict;
@@ -51,7 +51,7 @@ namespace
{
}
- void visit(const PlainTextDepAtom * const a)
+ void visit(const PlainTextDepSpec * const a)
{
if (a->text().empty())
return;
@@ -101,26 +101,26 @@ namespace
}
}
- void visit(const AnyDepAtom * const u)
+ void visit(const AnyDepSpec * const u)
{
result << Message(qal_major, "Unexpected || dep block");
std::for_each(u->begin(), u->end(), accept_visitor(this));
}
- void visit(const BlockDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
- void visit(const PackageDepAtom * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const BlockDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
+ void visit(const PackageDepSpec * const) PALUDIS_ATTRIBUTE((noreturn));
};
void
- Checker::visit(const BlockDepAtom * const)
+ Checker::visit(const BlockDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Unexpected BlockDepAtom");
+ throw InternalError(PALUDIS_HERE, "Unexpected BlockDepSpec");
}
void
- Checker::visit(const PackageDepAtom * const)
+ Checker::visit(const PackageDepSpec * const)
{
- throw InternalError(PALUDIS_HERE, "Unexpected PackageDepAtom");
+ throw InternalError(PALUDIS_HERE, "Unexpected PackageDepSpec");
}
}
@@ -145,11 +145,11 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
std::string src_uri(metadata->ebuild_interface->src_uri);
- std::tr1::shared_ptr<const DepAtom> src_uri_parts;
+ std::tr1::shared_ptr<const DepSpec> src_uri_parts;
try
{
src_uri_parts = PortageDepParser::parse(src_uri,
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance());
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance());
std::set<std::string> restricts;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
diff --git a/paludis/query.cc b/paludis/query.cc
index 1b44330..b8fb0e1 100644
--- a/paludis/query.cc
+++ b/paludis/query.cc
@@ -76,23 +76,23 @@ namespace
struct MatchesDelegate :
QueryDelegate
{
- const PackageDepAtom atom;
+ const PackageDepSpec spec;
- MatchesDelegate(const PackageDepAtom & a) :
- atom(a)
+ MatchesDelegate(const PackageDepSpec & a) :
+ spec(a)
{
}
std::tr1::shared_ptr<RepositoryNameCollection>
repositories(const Environment & e) const
{
- if (atom.repository_ptr())
+ if (spec.repository_ptr())
{
std::tr1::shared_ptr<RepositoryNameCollection> result(new RepositoryNameCollection::Concrete);
for (PackageDatabase::RepositoryIterator i(e.package_database()->begin_repositories()),
i_end(e.package_database()->end_repositories()) ; i != i_end ; ++i)
- if ((*i)->name() == *atom.repository_ptr())
+ if ((*i)->name() == *spec.repository_ptr())
{
result->push_back((*i)->name());
break;
@@ -109,7 +109,7 @@ namespace
std::tr1::shared_ptr<const RepositoryNameCollection>) const
{
std::tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
- result->insert(atom.package().category);
+ result->insert(spec.package().category);
return result;
}
@@ -119,7 +119,7 @@ namespace
std::tr1::shared_ptr<const CategoryNamePartCollection>) const
{
std::tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
- result->insert(atom.package());
+ result->insert(spec.package());
return result;
}
@@ -142,7 +142,7 @@ namespace
v != v_end ; ++v)
{
PackageDatabaseEntry dbe(*p, *v, *r);
- if (match_package(e, atom, dbe))
+ if (match_package(e, spec, dbe))
result->push_back(dbe);
}
}
@@ -153,13 +153,13 @@ namespace
};
}
-query::Matches::Matches(const PackageDepAtom & a) :
+query::Matches::Matches(const PackageDepSpec & a) :
Query(std::tr1::shared_ptr<QueryDelegate>(new MatchesDelegate(a)))
{
}
query::Package::Package(const QualifiedPackageName & a) :
- Query(std::tr1::shared_ptr<QueryDelegate>(new MatchesDelegate(PackageDepAtom(a))))
+ Query(std::tr1::shared_ptr<QueryDelegate>(new MatchesDelegate(PackageDepSpec(a))))
{
}
diff --git a/paludis/query.hh b/paludis/query.hh
index 1fe2544..f5c2aab 100644
--- a/paludis/query.hh
+++ b/paludis/query.hh
@@ -27,7 +27,7 @@
namespace paludis
{
class Environment;
- class PackageDepAtom;
+ class PackageDepSpec;
class FSEntry;
class QueryDelegate
@@ -97,7 +97,7 @@ namespace paludis
public Query
{
public:
- Matches(const PackageDepAtom &);
+ Matches(const PackageDepSpec &);
};
class Package :
diff --git a/paludis/repositories/cran/cran_dep_parser.cc b/paludis/repositories/cran/cran_dep_parser.cc
index 3de5f37..401e2bc 100644
--- a/paludis/repositories/cran/cran_dep_parser.cc
+++ b/paludis/repositories/cran/cran_dep_parser.cc
@@ -1,4 +1,4 @@
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/util/strip.hh>
@@ -9,17 +9,17 @@
using namespace paludis;
-std::tr1::shared_ptr<const CompositeDepAtom>
+std::tr1::shared_ptr<const CompositeDepSpec>
CRANDepParser::parse(const std::string & s)
{
Context context("When parsing CRAN 'Depends:' string: '" + s + "':");
- std::tr1::shared_ptr<CompositeDepAtom> result(new AllDepAtom);
- Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> atom_tokeniser(",");
+ std::tr1::shared_ptr<CompositeDepSpec> result(new AllDepSpec);
+ Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> spec_tokeniser(",");
- std::list<std::string> atoms;
- atom_tokeniser.tokenise(s, std::back_inserter(atoms));
- std::list<std::string>::const_iterator a(atoms.begin()), a_end(atoms.end());
+ std::list<std::string> specs;
+ spec_tokeniser.tokenise(s, std::back_inserter(specs));
+ std::list<std::string>::const_iterator a(specs.begin()), a_end(specs.end());
for ( ; a != a_end ; ++a)
{
Context local_context("When processing token '" + *a + "':");
@@ -48,13 +48,13 @@ CRANDepParser::parse(const std::string & s)
else
name = "cran/" + name;
- std::string atom_string;
+ std::string spec_string;
if (version.empty() || range.empty())
- atom_string = name;
+ spec_string = name;
else
- atom_string = range + name + "-" + version;
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(atom_string));
- result->add_child(atom);
+ spec_string = range + name + "-" + version;
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(spec_string));
+ result->add_child(spec);
}
return result;
diff --git a/paludis/repositories/cran/cran_dep_parser.hh b/paludis/repositories/cran/cran_dep_parser.hh
index c862db2..1853579 100644
--- a/paludis/repositories/cran/cran_dep_parser.hh
+++ b/paludis/repositories/cran/cran_dep_parser.hh
@@ -1,14 +1,14 @@
#ifndef PALUDIS_GUARD_PALUDIS_CRAN_DEP_PARSER_HH
#define PALUDIS_GUARD_PALUDIS_CRAN_DEP_PARSER_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <string>
namespace paludis
{
/**
* The CRANDepParser conversts a string representation of a CRAN Depends:
- * specification into a DepAtom instance.
+ * specification into a DepSpec instance.
*
* \ingroup grpdepparser
*/
@@ -17,7 +17,7 @@ namespace paludis
/**
* Parse function.
*/
- static std::tr1::shared_ptr<const CompositeDepAtom> parse(const std::string & s);
+ static std::tr1::shared_ptr<const CompositeDepSpec> parse(const std::string & s);
};
}
diff --git a/paludis/repositories/cran/cran_dep_parser_TEST.cc b/paludis/repositories/cran/cran_dep_parser_TEST.cc
index 4bea61b..ff08370 100644
--- a/paludis/repositories/cran/cran_dep_parser_TEST.cc
+++ b/paludis/repositories/cran/cran_dep_parser_TEST.cc
@@ -17,9 +17,9 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
-#include <paludis/dep_atom_pretty_printer.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/environment/test/test_environment.hh>
#include <paludis/util/system.hh>
@@ -46,7 +46,7 @@ namespace test_cases
void run()
{
- DepAtomPrettyPrinter d1(0, false), d2(0, false), d3(0, false);
+ DepSpecPrettyPrinter d1(0, false), d2(0, false), d3(0, false);
// test R dependency
std::string dep1("R (>= 2.0.0)");
CRANDepParser::parse(dep1)->accept(&d1);
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 4a359b4..e34c1e7 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -540,7 +540,7 @@ CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const Vers
throw PackageUninstallActionError("Couldn't unmerge '" + stringify(q) + "-" + stringify(v) + "'");
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
CRANInstalledRepository::do_package_set(const SetName & s) const
{
Context context("When fetching package set '" + stringify(s) + "' from '" +
@@ -548,22 +548,22 @@ CRANInstalledRepository::do_package_set(const SetName & s) const
if ("everything" == s.data())
{
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
if (! _imp->entries_valid)
_imp->load_entries();
for (std::vector<CRANDescription>::const_iterator p(_imp->entries.begin()),
p_end(_imp->entries.end()) ; p != p_end ; ++p)
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(p->name));
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(p->name));
+ result->add_child(spec);
}
return result;
}
else if ("world" == s.data())
{
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
if (_imp->world_file.exists())
{
@@ -576,9 +576,9 @@ CRANInstalledRepository::do_package_set(const SetName & s) const
{
if (std::string::npos == line->find('/'))
{
- std::tr1::shared_ptr<DepAtom> atom(_imp->env->package_set(SetName(*line)));
- if (atom)
- result->add_child(atom);
+ std::tr1::shared_ptr<DepSpec> spec(_imp->env->package_set(SetName(*line)));
+ if (spec)
+ result->add_child(spec);
else
Log::get_instance()->message(ll_warning, lc_no_context,
"Entry '" + stringify(*line) + "' in world file '" + stringify(_imp->world_file)
@@ -586,8 +586,8 @@ CRANInstalledRepository::do_package_set(const SetName & s) const
}
else
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(QualifiedPackageName(*line)));
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(QualifiedPackageName(*line)));
+ result->add_child(spec);
}
}
catch (const NameError & e)
@@ -605,7 +605,7 @@ CRANInstalledRepository::do_package_set(const SetName & s) const
return result;
}
else
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 76f8654..2959ef4 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -86,7 +86,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
const UninstallOptions &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName &) const;
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index fda39af..a83a462 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -19,8 +19,8 @@
#include "config.h"
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/config_file.hh>
#include <paludis/match_package.hh>
@@ -587,7 +587,7 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
return;
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
CRANRepository::do_package_set(const SetName & s) const
{
if ("base" == s.data())
@@ -596,10 +596,10 @@ CRANRepository::do_package_set(const SetName & s) const
* \todo Implement system as all package which are installed
* by dev-lang/R by default.
*/
- return std::tr1::shared_ptr<AllDepAtom>(new AllDepAtom);
+ return std::tr1::shared_ptr<AllDepSpec>(new AllDepSpec);
}
else
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index f718120..ac92c7f 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -83,7 +83,7 @@ namespace paludis
virtual void do_install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName &) const;
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
diff --git a/paludis/repositories/cran/cran_repository_TEST.cc b/paludis/repositories/cran/cran_repository_TEST.cc
index 40bdb6a..5af58f9 100644
--- a/paludis/repositories/cran/cran_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_repository_TEST.cc
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_repository.hh>
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 65a584d..28df007 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -21,7 +21,7 @@
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec_flattener.hh>
using namespace paludis;
@@ -75,12 +75,12 @@ FakeInstalledRepository::provided_packages() const
if (! m->ebuild_interface)
continue;
- std::tr1::shared_ptr<const DepAtom> provide(PortageDepParser::parse(m->ebuild_interface->provide_string,
- PortageDepParserPolicy<PackageDepAtom, false>::get_instance()));
+ std::tr1::shared_ptr<const DepSpec> provide(PortageDepParser::parse(m->ebuild_interface->provide_string,
+ PortageDepParserPolicy<PackageDepSpec, false>::get_instance()));
PackageDatabaseEntry dbe(*p, *v, name());
- DepAtomFlattener f(environment(), &dbe, provide);
+ DepSpecFlattener f(environment(), &dbe, provide);
- for (DepAtomFlattener::Iterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
+ for (DepSpecFlattener::Iterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
result->insert(RepositoryProvidesEntry::create()
.virtual_name(QualifiedPackageName((*q)->text()))
.version(*v)
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 472aa1f..f42df20 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -63,19 +63,19 @@ std::tr1::shared_ptr<const VersionMetadata>
FakeRepository::virtual_package_version_metadata(
const RepositoryVirtualsEntry & p, const VersionSpec & v) const
{
- std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_atom->package(), v));
+ std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_spec->package(), v));
std::tr1::shared_ptr<FakeVirtualVersionMetadata> result(new FakeVirtualVersionMetadata(
- m->slot, PackageDatabaseEntry(p.provided_by_atom->package(), v, name())));
+ m->slot, PackageDatabaseEntry(p.provided_by_spec->package(), v, name())));
result->eapi = m->eapi;
- result->deps_interface->build_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
- result->deps_interface->run_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
+ result->deps_interface->build_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
+ result->deps_interface->run_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
return result;
}
void
-FakeRepository::add_virtual_package(const QualifiedPackageName & q, std::tr1::shared_ptr<const PackageDepAtom> p)
+FakeRepository::add_virtual_package(const QualifiedPackageName & q, std::tr1::shared_ptr<const PackageDepSpec> p)
{
_virtual_packages->insert(RepositoryVirtualsEntry(q, p));
}
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 02fc271..4479a49 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -49,7 +49,7 @@ namespace paludis
public:
FakeRepository(const Environment * const, const RepositoryName &);
- void add_virtual_package(const QualifiedPackageName &, std::tr1::shared_ptr<const PackageDepAtom>);
+ void add_virtual_package(const QualifiedPackageName &, std::tr1::shared_ptr<const PackageDepSpec>);
};
}
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 7bdff8b..334f508 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -57,7 +57,7 @@ namespace paludis
std::map<std::string, std::tr1::shared_ptr<VersionMetadata> > metadata;
/// Our sets.
- std::map<SetName, std::tr1::shared_ptr<DepAtom> > sets;
+ std::map<SetName, std::tr1::shared_ptr<DepSpec> > sets;
/// (Empty) provides map.
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
@@ -265,17 +265,17 @@ FakeRepositoryBase::do_use_expand_value(const UseFlagName & u) const
}
void
-FakeRepositoryBase::add_package_set(const SetName & n, std::tr1::shared_ptr<DepAtom> s)
+FakeRepositoryBase::add_package_set(const SetName & n, std::tr1::shared_ptr<DepSpec> s)
{
_imp->sets.insert(std::make_pair(n, s));
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
FakeRepositoryBase::do_package_set(const SetName & id) const
{
- std::map<SetName, std::tr1::shared_ptr<DepAtom> >::const_iterator i(_imp->sets.find(id));
+ std::map<SetName, std::tr1::shared_ptr<DepSpec> >::const_iterator i(_imp->sets.find(id));
if (_imp->sets.end() == i)
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
else
return i->second;
}
@@ -285,7 +285,7 @@ FakeRepositoryBase::sets_list() const
{
std::tr1::shared_ptr<SetsCollection> result(new SetsCollection::Concrete);
std::copy(_imp->sets.begin(), _imp->sets.end(),
- transform_inserter(result->inserter(), SelectFirst<SetName, std::tr1::shared_ptr<DepAtom> >()));
+ transform_inserter(result->inserter(), SelectFirst<SetName, std::tr1::shared_ptr<DepSpec> >()));
return result;
}
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 4c415e5..5c27170 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -126,7 +126,7 @@ namespace paludis
virtual bool do_is_licence(const std::string &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName & id) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName & id) const;
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
protected:
@@ -174,7 +174,7 @@ namespace paludis
/**
* Add a package set.
*/
- void add_package_set(const SetName &, std::tr1::shared_ptr<DepAtom>);
+ void add_package_set(const SetName &, std::tr1::shared_ptr<DepSpec>);
virtual void invalidate();
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 2d188a2..657723b 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -180,10 +180,10 @@ GemsRepository::do_install(const QualifiedPackageName &, const VersionSpec &, co
{
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
GemsRepository::do_package_set(const SetName &) const
{
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index ebed433..7a36242 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -43,7 +43,7 @@ namespace paludis
virtual void do_install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName &) const;
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
diff --git a/paludis/repositories/gentoo/ebin_entries.cc b/paludis/repositories/gentoo/ebin_entries.cc
index e388cb8..94f9bdd 100644
--- a/paludis/repositories/gentoo/ebin_entries.cc
+++ b/paludis/repositories/gentoo/ebin_entries.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/config_file.hh>
#include <paludis/portage_dep_parser.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/util/strip.hh>
#include <set>
@@ -128,11 +128,11 @@ EbinEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
std::set<std::string> already_in_binaries;
/* make B and FLAT_BIN_URI */
- std::tr1::shared_ptr<const DepAtom> b_atom(PortageDepParser::parse(metadata->ebin_interface->bin_uri,
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
- DepAtomFlattener f(_imp->params.environment, &e, b_atom);
+ std::tr1::shared_ptr<const DepSpec> b_spec(PortageDepParser::parse(metadata->ebin_interface->bin_uri,
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance()));
+ DepSpecFlattener f(_imp->params.environment, &e, b_spec);
- for (DepAtomFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
+ for (DepSpecFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
{
std::string::size_type pos((*ff)->text().rfind('/'));
if (std::string::npos == pos)
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index d83e1c1..a3b338f 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/repositories/gentoo/ebuild.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/version_metadata.hh>
@@ -166,60 +166,60 @@ namespace
{
class AAFinder :
private InstantiationPolicy<AAFinder, instantiation_method::NonCopyableTag>,
- protected DepAtomVisitorTypes::ConstVisitor
+ protected DepSpecVisitorTypes::ConstVisitor
{
private:
- mutable std::list<const StringDepAtom *> _atoms;
+ mutable std::list<const StringDepSpec *> _specs;
protected:
- void visit(const AllDepAtom * a)
+ void visit(const AllDepSpec * a)
{
std::for_each(a->begin(), a->end(), accept_visitor(
- static_cast<DepAtomVisitorTypes::ConstVisitor *>(this)));
+ static_cast<DepSpecVisitorTypes::ConstVisitor *>(this)));
}
- void visit(const AnyDepAtom *) PALUDIS_ATTRIBUTE((noreturn))
+ void visit(const AnyDepSpec *) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "Found unexpected AnyDepAtom");
+ throw InternalError(PALUDIS_HERE, "Found unexpected AnyDepSpec");
}
- void visit(const UseDepAtom * a)
+ void visit(const UseDepSpec * a)
{
std::for_each(a->begin(), a->end(), accept_visitor(
- static_cast<DepAtomVisitorTypes::ConstVisitor *>(this)));
+ static_cast<DepSpecVisitorTypes::ConstVisitor *>(this)));
}
- void visit(const PlainTextDepAtom * a)
+ void visit(const PlainTextDepSpec * a)
{
- _atoms.push_back(a);
+ _specs.push_back(a);
}
- void visit(const PackageDepAtom * a)
+ void visit(const PackageDepSpec * a)
{
- _atoms.push_back(a);
+ _specs.push_back(a);
}
- void visit(const BlockDepAtom * a)
+ void visit(const BlockDepSpec * a)
{
- _atoms.push_back(a);
+ _specs.push_back(a);
}
public:
- AAFinder(const std::tr1::shared_ptr<const DepAtom> a)
+ AAFinder(const std::tr1::shared_ptr<const DepSpec> a)
{
- a->accept(static_cast<DepAtomVisitorTypes::ConstVisitor *>(this));
+ a->accept(static_cast<DepSpecVisitorTypes::ConstVisitor *>(this));
}
- typedef std::list<const StringDepAtom *>::const_iterator Iterator;
+ typedef std::list<const StringDepSpec *>::const_iterator Iterator;
Iterator begin()
{
- return _atoms.begin();
+ return _specs.begin();
}
Iterator end() const
{
- return _atoms.end();
+ return _specs.end();
}
};
@@ -270,11 +270,11 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
std::set<std::string> already_in_archives;
/* make A and FLAT_SRC_URI */
- std::tr1::shared_ptr<const DepAtom> f_atom(PortageDepParser::parse(metadata->ebuild_interface->src_uri,
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
- DepAtomFlattener f(_imp->params.environment, &e, f_atom);
+ std::tr1::shared_ptr<const DepSpec> f_spec(PortageDepParser::parse(metadata->ebuild_interface->src_uri,
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance()));
+ DepSpecFlattener f(_imp->params.environment, &e, f_spec);
- for (DepAtomFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
+ for (DepSpecFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
{
std::string::size_type pos((*ff)->text().rfind('/'));
if (std::string::npos == pos)
@@ -353,10 +353,10 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
}
/* make AA */
- std::tr1::shared_ptr<const DepAtom> g_atom(PortageDepParser::parse(
+ std::tr1::shared_ptr<const DepSpec> g_spec(PortageDepParser::parse(
metadata->ebuild_interface->src_uri,
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
- AAFinder g(g_atom);
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance()));
+ AAFinder g(g_spec);
std::set<std::string> already_in_all_archives;
for (AAFinder::Iterator gg(g.begin()), gg_end(g.end()) ; gg != gg_end ; ++gg)
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index edbe7d4..c682629 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -30,8 +30,8 @@
#include <paludis/repositories/gentoo/use_desc.hh>
#include <paludis/config_file.hh>
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/match_package.hh>
@@ -81,7 +81,7 @@ namespace paludis
typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<VersionSpecCollection> >::Type VersionsMap;
/// Map for repository masks.
- typedef MakeHashedMap<QualifiedPackageName, std::list<std::tr1::shared_ptr<const PackageDepAtom> > >::Type RepositoryMaskMap;
+ typedef MakeHashedMap<QualifiedPackageName, std::list<std::tr1::shared_ptr<const PackageDepSpec> > >::Type RepositoryMaskMap;
/// Map for categories.
typedef MakeHashedMap<CategoryNamePart, bool>::Type CategoryMap;
@@ -97,7 +97,7 @@ namespace paludis
std::tr1::shared_ptr<VersionMetadata> >::Type MetadataMap;
/// Map for virtuals.
- typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> >::Type VirtualsMap;
+ typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> >::Type VirtualsMap;
typedef std::list<PortageRepositoryProfilesDescLine> ProfilesDesc;
@@ -663,7 +663,7 @@ PortageRepository::do_query_repository_masks(const QualifiedPackageName & q, con
for (LineConfigFile::Iterator line(ff.begin()), line_end(ff.end()) ;
line != line_end ; ++line)
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(*line));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
_imp->repo_mask[a->package()].push_back(a);
}
}
@@ -676,7 +676,7 @@ PortageRepository::do_query_repository_masks(const QualifiedPackageName & q, con
if (_imp->repo_mask.end() == r)
return false;
else
- for (IndirectIterator<std::list<std::tr1::shared_ptr<const PackageDepAtom> >::const_iterator, const PackageDepAtom>
+ for (IndirectIterator<std::list<std::tr1::shared_ptr<const PackageDepSpec> >::const_iterator, const PackageDepSpec>
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
if (match_package(*_imp->params.environment, *k, PackageDatabaseEntry(q, v, name())))
return true;
@@ -816,7 +816,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
_imp->entries_ptr->install(q, v, o, _imp->profile_ptr);
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
PortageRepository::do_package_set(const SetName & s) const
{
if (s.data() == "system")
@@ -931,7 +931,7 @@ PortageRepository::info(bool verbose) const
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> q(
_imp->params.environment->package_database()->query(
- query::Matches(PackageDepAtom(*i)) & query::InstalledAtRoot(_imp->params.environment->root()),
+ query::Matches(PackageDepSpec(*i)) & query::InstalledAtRoot(_imp->params.environment->root()),
qo_order_by_version));
if (q->empty())
package_info->add_kv(*i, "(none)");
@@ -1020,7 +1020,7 @@ PortageRepository::virtual_packages() const
for (PortageRepositoryProfile::VirtualsIterator i(_imp->profile_ptr->begin_virtuals()),
i_end(_imp->profile_ptr->end_virtuals()) ; i != i_end ; ++i)
result->insert(RepositoryVirtualsEntry::create()
- .provided_by_atom(i->second)
+ .provided_by_spec(i->second)
.virtual_name(i->first));
Log::get_instance()->message(ll_debug, lc_context, "Loaded " + stringify(result->size()) +
@@ -1033,13 +1033,13 @@ std::tr1::shared_ptr<const VersionMetadata>
PortageRepository::virtual_package_version_metadata(const RepositoryVirtualsEntry & p,
const VersionSpec & v) const
{
- std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_atom->package(), v));
+ std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_spec->package(), v));
std::tr1::shared_ptr<PortageVirtualVersionMetadata> result(new PortageVirtualVersionMetadata(
- m->slot, PackageDatabaseEntry(p.provided_by_atom->package(), v, name())));
+ m->slot, PackageDatabaseEntry(p.provided_by_spec->package(), v, name())));
result->eapi = m->eapi;
- result->build_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
- result->run_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
+ result->build_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
+ result->run_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
return result;
diff --git a/paludis/repositories/gentoo/portage_repository.hh b/paludis/repositories/gentoo/portage_repository.hh
index 41da835..af98370 100644
--- a/paludis/repositories/gentoo/portage_repository.hh
+++ b/paludis/repositories/gentoo/portage_repository.hh
@@ -109,7 +109,7 @@ namespace paludis
virtual void do_install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName &) const;
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
@@ -176,7 +176,7 @@ namespace paludis
std::string profile_variable(const std::string &) const;
typedef libwrapiter::ForwardIterator<PortageRepository, std::pair<
- const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > > OurVirtualsIterator;
+ const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > OurVirtualsIterator;
const PortageRepositoryParams & params() const;
diff --git a/paludis/repositories/gentoo/portage_repository_profile.cc b/paludis/repositories/gentoo/portage_repository_profile.cc
index b53c646..8a58c71 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.cc
+++ b/paludis/repositories/gentoo/portage_repository_profile.cc
@@ -45,11 +45,11 @@ namespace
{
typedef MakeHashedSet<UseFlagName>::Type UseFlagSet;
typedef MakeHashedMap<std::string, std::string>::Type EnvironmentVariablesMap;
- typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> >::Type VirtualsMap;
- typedef MakeHashedMap<QualifiedPackageName, std::list<std::tr1::shared_ptr<const PackageDepAtom> > >::Type PackageMaskMap;
+ typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> >::Type VirtualsMap;
+ typedef MakeHashedMap<QualifiedPackageName, std::list<std::tr1::shared_ptr<const PackageDepSpec> > >::Type PackageMaskMap;
typedef MakeHashedMap<UseFlagName, bool>::Type FlagStatusMap;
- typedef std::list<std::pair<std::tr1::shared_ptr<const PackageDepAtom>, FlagStatusMap> > PackageFlagStatusMapList;
+ typedef std::list<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, FlagStatusMap> > PackageFlagStatusMapList;
struct StackedValues
{
@@ -88,7 +88,7 @@ namespace paludis
void load_profile_make_defaults(const FSEntry & dir);
void load_basic_use_file(const FSEntry & file, FlagStatusMap & m);
- void load_atom_use_file(const FSEntry & file, PackageFlagStatusMapList & m);
+ void load_spec_use_file(const FSEntry & file, PackageFlagStatusMapList & m);
void add_use_expand_to_use();
void make_vars_from_file_vars();
@@ -120,7 +120,7 @@ namespace paludis
///\name System package set
///\{
- std::tr1::shared_ptr<AllDepAtom> system_packages;
+ std::tr1::shared_ptr<AllDepSpec> system_packages;
std::tr1::shared_ptr<GeneralSetDepTag> system_tag;
///\}
@@ -155,7 +155,7 @@ namespace paludis
Implementation(const Environment * const e, const RepositoryName & name,
const FSEntryCollection & dirs) :
env(e),
- system_packages(new AllDepAtom),
+ system_packages(new AllDepSpec),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
load_environment();
@@ -205,9 +205,9 @@ Implementation<PortageRepositoryProfile>::load_profile_directory_recursively(con
load_basic_use_file(dir / "use.mask", stacked_values_list.back().use_mask);
load_basic_use_file(dir / "use.force", stacked_values_list.back().use_force);
- load_atom_use_file(dir / "package.use", stacked_values_list.back().package_use);
- load_atom_use_file(dir / "package.use.mask", stacked_values_list.back().package_use_mask);
- load_atom_use_file(dir / "package.use.force", stacked_values_list.back().package_use_force);
+ load_spec_use_file(dir / "package.use", stacked_values_list.back().package_use);
+ load_spec_use_file(dir / "package.use.mask", stacked_values_list.back().package_use_mask);
+ load_spec_use_file(dir / "package.use.force", stacked_values_list.back().package_use_force);
packages_file.add_file(dir / "packages");
virtuals_file.add_file(dir / "virtuals");
@@ -369,10 +369,10 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
if (0 != i->compare(0, 1, "*", 0, 1))
continue;
- Context context_atom("When parsing '" + *i + "':");
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(i->substr(1)));
- atom->set_tag(system_tag);
- system_packages->add_child(atom);
+ Context context_spec("When parsing '" + *i + "':");
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(i->substr(1)));
+ spec->set_tag(system_tag);
+ system_packages->add_child(spec);
}
}
catch (const NameError & e)
@@ -393,7 +393,7 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
QualifiedPackageName v(tokens[0]);
virtuals.erase(v);
- virtuals.insert(std::make_pair(v, std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(tokens[1]))));
+ virtuals.insert(std::make_pair(v, std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(tokens[1]))));
}
}
catch (const NameError & e)
@@ -410,12 +410,12 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
try
{
- std::tr1::shared_ptr<const PackageDepAtom> a(new PackageDepAtom(*line));
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
package_mask[a->package()].push_back(a);
}
catch (const NameError & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask atom '"
+ Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
+ stringify(*line) + "' failed due to exception '" + e.message() + "' ("
+ e.what() + ")");
}
@@ -458,12 +458,12 @@ Implementation<PortageRepositoryProfile>::load_basic_use_file(const FSEntry & fi
}
void
-Implementation<PortageRepositoryProfile>::load_atom_use_file(const FSEntry & file, PackageFlagStatusMapList & m)
+Implementation<PortageRepositoryProfile>::load_spec_use_file(const FSEntry & file, PackageFlagStatusMapList & m)
{
if (! file.exists())
return;
- Context context("When loading atomised use file '" + stringify(file) + ":");
+ Context context("When loading specised use file '" + stringify(file) + ":");
LineConfigFile f(file);
for (LineConfigFile::Iterator line(f.begin()), line_end(f.end()) ;
line != line_end ; ++line)
@@ -476,8 +476,8 @@ Implementation<PortageRepositoryProfile>::load_atom_use_file(const FSEntry & fil
try
{
- std::tr1::shared_ptr<const PackageDepAtom> atom(new PackageDepAtom(*tokens.begin()));
- PackageFlagStatusMapList::iterator n(m.insert(m.end(), std::make_pair(atom, FlagStatusMap())));
+ std::tr1::shared_ptr<const PackageDepSpec> spec(new PackageDepSpec(*tokens.begin()));
+ PackageFlagStatusMapList::iterator n(m.insert(m.end(), std::make_pair(spec, FlagStatusMap())));
for (std::list<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
@@ -498,7 +498,7 @@ Implementation<PortageRepositoryProfile>::load_atom_use_file(const FSEntry & fil
}
}
}
- catch (const PackageDepAtomError & e)
+ catch (const PackageDepSpecError & e)
{
Log::get_instance()->message(ll_warning, lc_context, "Ignoring line '"
+ *line + "' due to exception '" + e.message() + "' (" + e.what() + ")");
@@ -656,7 +656,7 @@ PortageRepositoryProfile::environment_variable(const std::string & s) const
return i->second;
}
-std::tr1::shared_ptr<AllDepAtom>
+std::tr1::shared_ptr<AllDepSpec>
PortageRepositoryProfile::system_packages() const
{
return _imp->system_packages;
@@ -708,7 +708,7 @@ PortageRepositoryProfile::profile_masked(const QualifiedPackageName & n,
else
{
PackageDatabaseEntry dbe(n, v, r);
- for (std::list<std::tr1::shared_ptr<const PackageDepAtom> >::const_iterator k(rr->second.begin()),
+ for (std::list<std::tr1::shared_ptr<const PackageDepSpec> >::const_iterator k(rr->second.begin()),
k_end(rr->second.end()) ; k != k_end ; ++k)
if (match_package(*_imp->env, **k, dbe))
return true;
diff --git a/paludis/repositories/gentoo/portage_repository_profile.hh b/paludis/repositories/gentoo/portage_repository_profile.hh
index e914b0a..9b17978 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.hh
+++ b/paludis/repositories/gentoo/portage_repository_profile.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_REPOSITORY_PROFILE_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_REPOSITORY_PROFILE_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern.hh>
@@ -106,7 +106,7 @@ namespace paludis
///\name System package set
///\{
- std::tr1::shared_ptr<AllDepAtom> system_packages() const;
+ std::tr1::shared_ptr<AllDepSpec> system_packages() const;
///\}
@@ -114,7 +114,7 @@ namespace paludis
///\{
typedef libwrapiter::ForwardIterator<PortageRepositoryProfile,
- const std::pair<const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > > VirtualsIterator;
+ const std::pair<const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > VirtualsIterator;
VirtualsIterator begin_virtuals() const;
VirtualsIterator end_virtuals() const;
diff --git a/paludis/repositories/gentoo/portage_repository_sets.cc b/paludis/repositories/gentoo/portage_repository_sets.cc
index 15abaf4..2b78461 100644
--- a/paludis/repositories/gentoo/portage_repository_sets.cc
+++ b/paludis/repositories/gentoo/portage_repository_sets.cc
@@ -76,7 +76,7 @@ PortageRepositorySets::~PortageRepositorySets()
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
PortageRepositorySets::package_set(const SetName & s) const
{
if ("system" == s.data())
@@ -92,7 +92,7 @@ PortageRepositorySets::package_set(const SetName & s) const
FSEntry ff(_imp->params.setsdir / (stringify(s) + ".conf"));
Context context("When loading package set '" + stringify(s) + "' from '" + stringify(ff) + "':");
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
LineConfigFile f(ff);
for (LineConfigFile::Iterator line(f.begin()), line_end(f.end()) ;
line != line_end ; ++line)
@@ -107,19 +107,19 @@ PortageRepositorySets::package_set(const SetName & s) const
Log::get_instance()->message(ll_warning, lc_context,
"Line '" + *line + "' in set file '"
+ stringify(ff) + "' does not specify '*' or '?', assuming '*'");
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(tokens.at(0)));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(0)));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
else if ("*" == tokens.at(0))
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(tokens.at(1)));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(1)));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
else if ("?" == tokens.at(0))
{
- std::tr1::shared_ptr<PackageDepAtom> p(new PackageDepAtom(tokens.at(1)));
+ std::tr1::shared_ptr<PackageDepSpec> p(new PackageDepSpec(tokens.at(1)));
p->set_tag(tag);
if (! _imp->environment->package_database()->query(
query::Package(p->package()) & query::InstalledAtRoot(
@@ -140,7 +140,7 @@ PortageRepositorySets::package_set(const SetName & s) const
return result;
}
else
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
@@ -268,11 +268,11 @@ namespace
}
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
PortageRepositorySets::security_set(bool insecurity) const
{
Context context("When building security or insecurity package set:");
- std::tr1::shared_ptr<AllDepAtom> security_packages(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> security_packages(new AllDepSpec);
if (!_imp->params.securitydir.is_directory())
return security_packages;
@@ -314,11 +314,11 @@ PortageRepositorySets::security_set(bool insecurity) const
if (insecurity)
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
"=" + stringify(c->name) + "-" + stringify(c->version) +
"::" + stringify(c->repository)));
- atom->set_tag(glsa_tags.find(glsa->id())->second);
- security_packages->add_child(atom);
+ spec->set_tag(glsa_tags.find(glsa->id())->second);
+ security_packages->add_child(spec);
}
else
{
@@ -330,7 +330,7 @@ PortageRepositorySets::security_set(bool insecurity) const
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> available(
_imp->environment->package_database()->query(
- query::Matches(PackageDepAtom(glsa_pkg->name())) & query::InstalledAtRoot(
+ query::Matches(PackageDepSpec(glsa_pkg->name())) & query::InstalledAtRoot(
_imp->environment->root()), qo_order_by_version));
for (PackageDatabaseEntryCollection::ReverseIterator r(available->rbegin()),
r_end(available->rend()) ; r != r_end ; ++r)
@@ -343,11 +343,11 @@ PortageRepositorySets::security_set(bool insecurity) const
if (is_vulnerable(*glsa_pkg, *r))
continue;
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
"=" + stringify(r->name) + "-" + stringify(r->version) +
"::" + stringify(r->repository)));
- atom->set_tag(glsa_tags.find(glsa->id())->second);
- security_packages->add_child(atom);
+ spec->set_tag(glsa_tags.find(glsa->id())->second);
+ security_packages->add_child(spec);
ok = true;
break;
}
diff --git a/paludis/repositories/gentoo/portage_repository_sets.hh b/paludis/repositories/gentoo/portage_repository_sets.hh
index 12cbabd..6bf7646 100644
--- a/paludis/repositories/gentoo/portage_repository_sets.hh
+++ b/paludis/repositories/gentoo/portage_repository_sets.hh
@@ -21,7 +21,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_REPOSITORY_SETS_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_REPOSITORY_SETS_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/repository.hh>
/** \file
@@ -62,12 +62,12 @@ namespace paludis
/**
* Fetch a package set other than system.
*/
- std::tr1::shared_ptr<DepAtom> package_set(const SetName & s) const;
+ std::tr1::shared_ptr<DepSpec> package_set(const SetName & s) const;
/**
* Fetch the security or insecurity set.
*/
- std::tr1::shared_ptr<DepAtom> security_set(bool insecure) const;
+ std::tr1::shared_ptr<DepSpec> security_set(bool insecure) const;
/**
* Give a list of all the sets in this repo.
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index 389b5e6..f57cc49 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -22,8 +22,8 @@
#include <paludis/repositories/gentoo/vdb_merger.hh>
#include <paludis/repositories/gentoo/vdb_unmerger.hh>
-#include <paludis/dep_atom.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/repositories/gentoo/ebuild.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/hashed_containers.hh>
@@ -429,9 +429,9 @@ namespace paludis
try
{
- PackageDepAtom atom("=" + stringify(cat) + "/" + pkg_i->basename());
- entries.push_back(VDBEntry(atom.package(),
- atom.version_requirements_ptr()->begin()->version_spec));
+ PackageDepSpec spec("=" + stringify(cat) + "/" + pkg_i->basename());
+ entries.push_back(VDBEntry(spec.package(),
+ spec.version_requirements_ptr()->begin()->version_spec));
}
catch (const Exception & e)
{
@@ -1043,7 +1043,7 @@ VDBRepository::do_config(const QualifiedPackageName & q, const VersionSpec & v)
config_cmd();
}
-std::tr1::shared_ptr<DepAtom>
+std::tr1::shared_ptr<DepSpec>
VDBRepository::do_package_set(const SetName & s) const
{
Context context("When fetching package set '" + stringify(s) + "' from '" +
@@ -1051,7 +1051,7 @@ VDBRepository::do_package_set(const SetName & s) const
if ("everything" == s.data())
{
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
std::tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("everything"), stringify(name())));
if (! _imp->entries_valid)
@@ -1060,16 +1060,16 @@ VDBRepository::do_package_set(const SetName & s) const
for (std::vector<VDBEntry>::const_iterator p(_imp->entries.begin()),
p_end(_imp->entries.end()) ; p != p_end ; ++p)
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(p->name));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(p->name));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
return result;
}
else if ("world" == s.data())
{
- std::tr1::shared_ptr<AllDepAtom> result(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> result(new AllDepSpec);
std::tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name())));
if (_imp->world_file.exists())
@@ -1083,9 +1083,9 @@ VDBRepository::do_package_set(const SetName & s) const
{
if (std::string::npos == line->find('/'))
{
- std::tr1::shared_ptr<DepAtom> atom(_imp->env->package_set(SetName(*line)));
- if (atom)
- result->add_child(atom);
+ std::tr1::shared_ptr<DepSpec> spec(_imp->env->package_set(SetName(*line)));
+ if (spec)
+ result->add_child(spec);
else
Log::get_instance()->message(ll_warning, lc_no_context, "World file '"
+ stringify(_imp->world_file) + "' entry '" + *line +
@@ -1093,9 +1093,9 @@ VDBRepository::do_package_set(const SetName & s) const
}
else
{
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(QualifiedPackageName(*line)));
- atom->set_tag(tag);
- result->add_child(atom);
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(QualifiedPackageName(*line)));
+ spec->set_tag(tag);
+ result->add_child(spec);
}
}
catch (const NameError & n)
@@ -1114,7 +1114,7 @@ VDBRepository::do_package_set(const SetName & s) const
return result;
}
else
- return std::tr1::shared_ptr<DepAtom>();
+ return std::tr1::shared_ptr<DepSpec>();
}
std::tr1::shared_ptr<const SetsCollection>
@@ -1421,11 +1421,11 @@ VDBRepository::load_provided_using_cache() const
continue;
PackageDatabaseEntry dbe(QualifiedPackageName(tokens.at(0)), VersionSpec(tokens.at(1)), name());
- DepAtomFlattener f(_imp->env, &dbe, PortageDepParser::parse(
+ DepSpecFlattener f(_imp->env, &dbe, PortageDepParser::parse(
join(next(next(tokens.begin())), tokens.end(), " "),
- PortageDepParserPolicy<PackageDepAtom, false>::get_instance()));
+ PortageDepParserPolicy<PackageDepSpec, false>::get_instance()));
- for (DepAtomFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
+ for (DepSpecFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
result->insert(RepositoryProvidesEntry::create()
.virtual_name((*p)->text())
.version(dbe.version)
@@ -1467,12 +1467,12 @@ VDBRepository::load_provided_the_slow_way() const
if (provide_str.empty())
continue;
- std::tr1::shared_ptr<const DepAtom> provide(PortageDepParser::parse(provide_str,
- PortageDepParserPolicy<PackageDepAtom, false>::get_instance()));
+ std::tr1::shared_ptr<const DepSpec> provide(PortageDepParser::parse(provide_str,
+ PortageDepParserPolicy<PackageDepSpec, false>::get_instance()));
PackageDatabaseEntry dbe(e->name, e->version, name());
- DepAtomFlattener f(_imp->env, &dbe, provide);
+ DepSpecFlattener f(_imp->env, &dbe, provide);
- for (DepAtomFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
+ for (DepSpecFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
{
QualifiedPackageName pp((*p)->text());
diff --git a/paludis/repositories/gentoo/vdb_repository.hh b/paludis/repositories/gentoo/vdb_repository.hh
index 38179ac..9271f30 100644
--- a/paludis/repositories/gentoo/vdb_repository.hh
+++ b/paludis/repositories/gentoo/vdb_repository.hh
@@ -97,7 +97,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
const UninstallOptions &) const;
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName &) const;
/* RepositoryUseInterface */
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 9115e91..46c5d27 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -36,7 +36,7 @@ namespace paludis
{
const Environment * const env;
- mutable std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > > names;
+ mutable std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > names;
mutable bool has_names;
mutable std::vector<VREntry> entries;
@@ -56,8 +56,8 @@ namespace
struct NamesCategoryComparator
{
bool
- operator() (const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > & a,
- const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > & b) const
+ operator() (const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > & a,
+ const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > & b) const
{
return a.first.category < b.first.category;
}
@@ -66,8 +66,8 @@ namespace
struct NamesNameComparator
{
bool
- operator() (const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > & a,
- const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > & b) const
+ operator() (const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > & a,
+ const std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > & b) const
{
return a.first < b.first;
}
@@ -127,13 +127,13 @@ VirtualsRepository::need_names() const
(*r)->provides_interface->provided_packages());
for (RepositoryProvidesInterface::ProvidesCollection::Iterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
- _imp->names.push_back(std::make_pair(p->virtual_name, std::tr1::shared_ptr<const PackageDepAtom>(
- new PackageDepAtom(stringify(p->provided_by_name)))));
+ _imp->names.push_back(std::make_pair(p->virtual_name, std::tr1::shared_ptr<const PackageDepSpec>(
+ new PackageDepSpec(stringify(p->provided_by_name)))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesNameComparator());
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > > new_names;
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > new_names;
for (PackageDatabase::RepositoryIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
@@ -147,14 +147,14 @@ VirtualsRepository::need_names() const
v_end(virtuals->end()) ; v != v_end ; ++v)
{
std::pair<
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator,
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator> p(
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair(v->virtual_name, std::tr1::shared_ptr<const PackageDepAtom>()),
+ std::make_pair(v->virtual_name, std::tr1::shared_ptr<const PackageDepSpec>()),
NamesNameComparator()));
if (p.first == p.second)
- new_names.push_back(std::make_pair(v->virtual_name, v->provided_by_atom));
+ new_names.push_back(std::make_pair(v->virtual_name, v->provided_by_spec));
}
}
@@ -176,7 +176,7 @@ VirtualsRepository::need_entries() const
Log::get_instance()->message(ll_debug, lc_context, "VirtualsRepository need_entries");
/* Populate our _imp->entries. */
- for (std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator
+ for (std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator
v(_imp->names.begin()), v_end(_imp->names.end()) ; v != v_end ; ++v)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> matches(_imp->env->package_database()->query(
@@ -254,7 +254,7 @@ VirtualsRepository::do_version_metadata(
return vif->virtual_package_version_metadata(
RepositoryVirtualsEntry::create()
.virtual_name(p.first->virtual_name)
- .provided_by_atom(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(p.first->provided_by_name))), v);
+ .provided_by_spec(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(p.first->provided_by_name))), v);
}
bool
@@ -302,15 +302,15 @@ VirtualsRepository::do_package_names(const CategoryNamePart & c) const
need_names();
std::pair<
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator,
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator> p(
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair(c + PackageNamePart("dummy"), std::tr1::shared_ptr<const PackageDepAtom>()),
+ std::make_pair(c + PackageNamePart("dummy"), std::tr1::shared_ptr<const PackageDepSpec>()),
NamesCategoryComparator()));
std::tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
std::copy(p.first, p.second, transform_inserter(result->inserter(),
- SelectFirst<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> >()));
+ SelectFirst<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> >()));
return result;
}
@@ -340,10 +340,10 @@ VirtualsRepository::do_has_package_named(const QualifiedPackageName & q) const
need_names();
std::pair<
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator,
- std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepAtom> > >::const_iterator> p(
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
+ std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair(q, std::tr1::shared_ptr<const PackageDepAtom>()),
+ std::make_pair(q, std::tr1::shared_ptr<const PackageDepSpec>()),
NamesNameComparator()));
return p.first != p.second;
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 5b3a8c3..a8ad406 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORY_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/exception.hh>
@@ -722,7 +722,7 @@ namespace paludis
/**
* Override in descendents: package list.
*/
- virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName & id) const = 0;
+ virtual std::tr1::shared_ptr<DepSpec> do_package_set(const SetName & id) const = 0;
///\}
@@ -733,7 +733,7 @@ namespace paludis
/**
* Fetch a package set.
*/
- std::tr1::shared_ptr<DepAtom> package_set(const SetName & s) const
+ std::tr1::shared_ptr<DepSpec> package_set(const SetName & s) const
{
return do_package_set(s);
}
diff --git a/paludis/repository.sr b/paludis/repository.sr
index 53b9989..e59dcac 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -79,7 +79,7 @@ make_class_RepositoryProvidesEntry()
make_class_RepositoryVirtualsEntry()
{
key virtual_name QualifiedPackageName
- key provided_by_atom "std::tr1::shared_ptr<const PackageDepAtom>"
+ key provided_by_spec "std::tr1::shared_ptr<const PackageDepSpec>"
allow_named_args
comparison_operators all virtual_name
diff --git a/paludis/tasks/find_unused_packages_task.cc b/paludis/tasks/find_unused_packages_task.cc
index d9cff3f..347a40a 100644
--- a/paludis/tasks/find_unused_packages_task.cc
+++ b/paludis/tasks/find_unused_packages_task.cc
@@ -39,7 +39,7 @@ FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
{
std::tr1::shared_ptr<PackageDatabaseEntryCollection> result(new PackageDatabaseEntryCollection::Concrete);
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> packages(_env->package_database()->query(
- query::Matches(PackageDepAtom(stringify(package) + "::" + stringify(_repo->name()))),
+ query::Matches(PackageDepSpec(stringify(package) + "::" + stringify(_repo->name()))),
qo_group_by_slot));
SlotName old_slot("I_am_a_slot");
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index dd0e768..3d2fbbe 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -18,7 +18,7 @@
*/
#include "install_task.hh"
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/exception.hh>
@@ -40,8 +40,8 @@ namespace paludis
UninstallOptions uninstall_options;
std::list<std::string> raw_targets;
- std::tr1::shared_ptr<AllDepAtom> targets;
- std::tr1::shared_ptr<std::string> add_to_world_atom;
+ std::tr1::shared_ptr<AllDepSpec> targets;
+ std::tr1::shared_ptr<std::string> add_to_world_spec;
std::tr1::shared_ptr<const DestinationsCollection> destinations;
bool pretend;
@@ -57,7 +57,7 @@ namespace paludis
current_dep_list_entry(dep_list.begin()),
install_options(false, false, ido_none, false, std::tr1::shared_ptr<const DestinationsCollection>()),
uninstall_options(false),
- targets(new AllDepAtom),
+ targets(new AllDepSpec),
destinations(d),
pretend(false),
preserve_world(false),
@@ -81,7 +81,7 @@ InstallTask::~InstallTask()
void
InstallTask::clear()
{
- _imp->targets.reset(new AllDepAtom);
+ _imp->targets.reset(new AllDepSpec);
_imp->had_set_targets = false;
_imp->had_package_targets = false;
_imp->dep_list.clear();
@@ -93,7 +93,7 @@ InstallTask::add_target(const std::string & target)
{
Context context("When adding install target '" + target + "':");
- std::tr1::shared_ptr<DepAtom> s;
+ std::tr1::shared_ptr<DepSpec> s;
std::string modified_target(target);
bool done(false);
@@ -132,7 +132,7 @@ InstallTask::add_target(const std::string & target)
QualifiedPackageName q(_imp->env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(target)));
modified_target = stringify(q);
- _imp->targets->add_child(std::tr1::shared_ptr<DepAtom>(new PackageDepAtom(q)));
+ _imp->targets->add_child(std::tr1::shared_ptr<DepSpec>(new PackageDepSpec(q)));
}
}
@@ -151,7 +151,7 @@ namespace
{
}
- virtual void add_callback(const PackageDepAtom & a)
+ virtual void add_callback(const PackageDepSpec & a)
{
t->on_update_world(a);
}
@@ -161,7 +161,7 @@ namespace
t->on_update_world(a);
}
- virtual void skip_callback(const PackageDepAtom & a,
+ virtual void skip_callback(const PackageDepSpec & a,
const std::string & s)
{
t->on_update_world_skip(a, s);
@@ -341,7 +341,7 @@ InstallTask::execute()
d_end(dep->destinations->end()) ; d != d_end ; ++d)
if (d->destination->uninstallable_interface)
collision_list = _imp->env->package_database()->query(
- query::Matches(PackageDepAtom(stringify(dep->package.name) + ":" + stringify(dep->metadata->slot)
+ query::Matches(PackageDepSpec(stringify(dep->package.name) + ":" + stringify(dep->metadata->slot)
+ "::" + stringify(d->destination->name()))) &
query::RepositoryHasInstalledInterface(), qo_order_by_version);
@@ -428,16 +428,16 @@ InstallTask::execute()
if (_imp->had_package_targets)
{
- if (_imp->add_to_world_atom)
+ if (_imp->add_to_world_spec)
_imp->env->add_appropriate_to_world(PortageDepParser::parse_depend(
- *_imp->add_to_world_atom), &w);
+ *_imp->add_to_world_spec), &w);
else
_imp->env->add_appropriate_to_world(_imp->targets, &w);
}
else if (_imp->had_set_targets)
{
- if (_imp->add_to_world_atom)
- _imp->env->add_set_to_world(SetName(*_imp->add_to_world_atom), &w);
+ if (_imp->add_to_world_spec)
+ _imp->env->add_set_to_world(SetName(*_imp->add_to_world_spec), &w);
else if (! _imp->raw_targets.empty())
_imp->env->add_set_to_world(SetName(*_imp->raw_targets.begin()), &w);
}
@@ -507,9 +507,9 @@ InstallTask::set_debug_mode(const InstallDebugOption value)
}
void
-InstallTask::set_add_to_world_atom(const std::string & value)
+InstallTask::set_add_to_world_spec(const std::string & value)
{
- _imp->add_to_world_atom.reset(new std::string(value));
+ _imp->add_to_world_spec.reset(new std::string(value));
}
InstallTask::TargetsIterator
diff --git a/paludis/tasks/install_task.hh b/paludis/tasks/install_task.hh
index b4ab0cd..0d27b05 100644
--- a/paludis/tasks/install_task.hh
+++ b/paludis/tasks/install_task.hh
@@ -64,7 +64,7 @@ namespace paludis
void set_pretend(const bool value);
void set_preserve_world(const bool value);
void set_debug_mode(const InstallDebugOption value);
- void set_add_to_world_atom(const std::string &);
+ void set_add_to_world_spec(const std::string &);
void set_safe_resume(const bool);
///\}
@@ -119,9 +119,9 @@ namespace paludis
const PackageDatabaseEntryCollection &) = 0;
virtual void on_update_world_pre() = 0;
- virtual void on_update_world(const PackageDepAtom &) = 0;
+ virtual void on_update_world(const PackageDepSpec &) = 0;
virtual void on_update_world(const SetName &) = 0;
- virtual void on_update_world_skip(const PackageDepAtom &, const std::string &) = 0;
+ virtual void on_update_world_skip(const PackageDepSpec &, const std::string &) = 0;
virtual void on_update_world_skip(const SetName &, const std::string &) = 0;
virtual void on_update_world_post() = 0;
virtual void on_preserve_world() = 0;
diff --git a/paludis/tasks/report_task.cc b/paludis/tasks/report_task.cc
index b2d8b13..9f457d2 100644
--- a/paludis/tasks/report_task.cc
+++ b/paludis/tasks/report_task.cc
@@ -29,10 +29,10 @@ using namespace paludis;
namespace
{
class VulnerableChecker :
- public DepAtomVisitorTypes::ConstVisitor,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AllDepAtom>,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AnyDepAtom>,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, UseDepAtom>
+ public DepSpecVisitorTypes::ConstVisitor,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AllDepSpec>,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AnyDepSpec>,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, UseDepSpec>
{
private:
std::multimap<PackageDatabaseEntry, std::tr1::shared_ptr<const DepTag>,
@@ -42,9 +42,9 @@ namespace
public:
typedef std::multimap<PackageDatabaseEntry, std::tr1::shared_ptr<const DepTag> >::const_iterator ConstIterator;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, UseDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AnyDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, UseDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<VulnerableChecker, AnyDepSpec>::visit;
/**
* Constructor.
@@ -57,13 +57,13 @@ namespace
/// \name Visit functions
///{
- void visit(const PackageDepAtom * const);
+ void visit(const PackageDepSpec * const);
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
///}
@@ -78,7 +78,7 @@ namespace
};
void
- VulnerableChecker::visit(const PackageDepAtom * const a)
+ VulnerableChecker::visit(const PackageDepSpec * const a)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> insecure(
_env.package_database()->query(query::Matches(*a), qo_order_by_version));
@@ -134,7 +134,7 @@ ReportTask::execute()
try
{
- std::tr1::shared_ptr<const DepAtom> insecure(rr->sets_interface->package_set(SetName("insecurity")));
+ std::tr1::shared_ptr<const DepSpec> insecure(rr->sets_interface->package_set(SetName("insecurity")));
if (! insecure)
continue;
insecure->accept(&vuln);
diff --git a/paludis/tasks/uninstall_task.cc b/paludis/tasks/uninstall_task.cc
index 387a23d..e9e2e18 100644
--- a/paludis/tasks/uninstall_task.cc
+++ b/paludis/tasks/uninstall_task.cc
@@ -20,7 +20,7 @@
#include "uninstall_task.hh"
#include <paludis/environment.hh>
#include <paludis/dep_list/uninstall_list.hh>
-#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/tasks/exceptions.hh>
#include <paludis/query.hh>
@@ -37,7 +37,7 @@ namespace paludis
UninstallOptions uninstall_options;
std::list<std::string> raw_targets;
- std::list<std::tr1::shared_ptr<PackageDepAtom> > targets;
+ std::list<std::tr1::shared_ptr<PackageDepSpec> > targets;
bool pretend;
bool preserve_world;
@@ -97,7 +97,7 @@ UninstallTask::add_target(const std::string & target)
{
Context context("When adding uninstall target '" + target + "':");
- /* we might have a dep atom, but we might just have a simple package name
+ /* we might have a dep spec, but we might just have a simple package name
* without a category. either should work. */
if (std::string::npos != target.find('/'))
{
@@ -105,13 +105,13 @@ UninstallTask::add_target(const std::string & target)
throw HadBothPackageAndSetTargets();
_imp->had_package_targets = true;
- _imp->targets.push_back(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(target)));
+ _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(target)));
}
else
try
{
- std::tr1::shared_ptr<DepAtom> atom(_imp->env->package_set(SetName(target)));
- if (atom)
+ std::tr1::shared_ptr<DepSpec> spec(_imp->env->package_set(SetName(target)));
+ if (spec)
{
if (_imp->had_package_targets)
throw HadBothPackageAndSetTargets();
@@ -120,9 +120,9 @@ UninstallTask::add_target(const std::string & target)
throw MultipleSetTargetsSpecified();
_imp->had_set_targets = true;
- DepAtomFlattener f(_imp->env, 0, atom);
- for (DepAtomFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
- _imp->targets.push_back(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(
+ DepSpecFlattener f(_imp->env, 0, spec);
+ for (DepSpecFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
+ _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(
stringify((*i)->text()))));
}
else
@@ -131,7 +131,7 @@ UninstallTask::add_target(const std::string & target)
throw HadBothPackageAndSetTargets();
_imp->had_package_targets = false;
- _imp->targets.push_back(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(
+ _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(
_imp->env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(target)))));
}
@@ -142,7 +142,7 @@ UninstallTask::add_target(const std::string & target)
throw HadBothPackageAndSetTargets();
_imp->had_package_targets = false;
- _imp->targets.push_back(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(
+ _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(
_imp->env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(target)))));
}
@@ -175,7 +175,7 @@ namespace
{
}
- virtual void remove_callback(const PackageDepAtom & a)
+ virtual void remove_callback(const PackageDepSpec & a)
{
t->on_update_world(a);
}
@@ -201,7 +201,7 @@ UninstallTask::execute()
if (_imp->unused)
list.add_unused();
else
- for (std::list<std::tr1::shared_ptr<PackageDepAtom> >::const_iterator t(_imp->targets.begin()),
+ for (std::list<std::tr1::shared_ptr<PackageDepSpec> >::const_iterator t(_imp->targets.begin()),
t_end(_imp->targets.end()) ; t != t_end ; ++t)
{
Context local_context("When looking for target '" + stringify(**t) + "':");
@@ -252,7 +252,7 @@ UninstallTask::execute()
{
on_update_world_pre();
- std::tr1::shared_ptr<AllDepAtom> all(new AllDepAtom);
+ std::tr1::shared_ptr<AllDepSpec> all(new AllDepSpec);
std::map<QualifiedPackageName, std::set<VersionSpec> > being_removed;
for (UninstallList::Iterator i(list.begin()), i_end(list.end()) ; i != i_end ; ++i)
@@ -264,7 +264,7 @@ UninstallTask::execute()
{
bool remove(true);
std::tr1::shared_ptr<PackageDatabaseEntryCollection> installed(
- _imp->env->package_database()->query(query::Matches(PackageDepAtom(i->first)) &
+ _imp->env->package_database()->query(query::Matches(PackageDepSpec(i->first)) &
query::RepositoryHasInstalledInterface(), qo_whatever));
for (PackageDatabaseEntryCollection::Iterator r(installed->begin()), r_end(installed->end()) ;
r != r_end && remove ; ++r)
@@ -272,7 +272,7 @@ UninstallTask::execute()
remove = false;
if (remove)
- all->add_child(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(i->first)));
+ all->add_child(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(i->first)));
}
WorldCallbacks w(this);
diff --git a/paludis/tasks/uninstall_task.hh b/paludis/tasks/uninstall_task.hh
index 594ebd5..88405cd 100644
--- a/paludis/tasks/uninstall_task.hh
+++ b/paludis/tasks/uninstall_task.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_TASKS_UNINSTALL_TASK_HH
#define PALUDIS_GUARD_PALUDIS_TASKS_UNINSTALL_TASK_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
@@ -146,7 +146,7 @@ namespace paludis
virtual void on_uninstall_all_post() = 0;
virtual void on_update_world_pre() = 0;
- virtual void on_update_world(const PackageDepAtom &) = 0;
+ virtual void on_update_world(const PackageDepSpec &) = 0;
virtual void on_update_world(const SetName &) = 0;
virtual void on_update_world_post() = 0;
virtual void on_preserve_world() = 0;
diff --git a/paludis/version_metadata.cc b/paludis/version_metadata.cc
index 4ea5caa..49c7f5e 100644
--- a/paludis/version_metadata.cc
+++ b/paludis/version_metadata.cc
@@ -33,25 +33,25 @@ using namespace paludis;
#include <paludis/version_metadata-sr.cc>
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataDepsInterface::build_depend() const
{
return parser(build_depend_string);
}
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataDepsInterface::run_depend() const
{
return parser(run_depend_string);
}
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataDepsInterface::post_depend() const
{
return parser(post_depend_string);
}
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataDepsInterface::suggested_depend() const
{
return parser(suggested_depend_string);
@@ -72,10 +72,10 @@ VersionMetadata::VersionMetadata(const VersionMetadataBase & base, const Version
{
}
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataEbuildInterface::provide() const
{
- return PortageDepParser::parse(provide_string, PortageDepParserPolicy<PackageDepAtom,
+ return PortageDepParser::parse(provide_string, PortageDepParserPolicy<PackageDepSpec,
false>::get_instance());
}
@@ -88,7 +88,7 @@ VersionMetadataLicenseInterface::VersionMetadataLicenseInterface(const ParserFun
{
}
-std::tr1::shared_ptr<const DepAtom>
+std::tr1::shared_ptr<const DepSpec>
VersionMetadataLicenseInterface::license() const
{
return parser(license_string);
diff --git a/paludis/version_metadata.hh b/paludis/version_metadata.hh
index af353a8..2d9b63e 100644
--- a/paludis/version_metadata.hh
+++ b/paludis/version_metadata.hh
@@ -24,7 +24,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/package_database_entry.hh>
#include <string>
@@ -49,7 +49,7 @@ namespace paludis
*
* \ingroup grpversions
*/
- typedef std::tr1::shared_ptr<const CompositeDepAtom> (* ParserFunction) (const std::string &);
+ typedef std::tr1::shared_ptr<const CompositeDepSpec> (* ParserFunction) (const std::string &);
#include <paludis/version_metadata-sr.hh>
diff --git a/paludis/version_metadata.sr b/paludis/version_metadata.sr
index 0eddbc8..0929dd8 100644
--- a/paludis/version_metadata.sr
+++ b/paludis/version_metadata.sr
@@ -41,22 +41,22 @@ END
/**
* Our build depends.
*/
- std::tr1::shared_ptr<const DepAtom> build_depend() const;
+ std::tr1::shared_ptr<const DepSpec> build_depend() const;
/**
* Our runtime depends.
*/
- std::tr1::shared_ptr<const DepAtom> run_depend() const;
+ std::tr1::shared_ptr<const DepSpec> run_depend() const;
/**
* Our post depends.
*/
- std::tr1::shared_ptr<const DepAtom> post_depend() const;
+ std::tr1::shared_ptr<const DepSpec> post_depend() const;
/**
* Our suggested depends.
*/
- std::tr1::shared_ptr<const DepAtom> suggested_depend() const;
+ std::tr1::shared_ptr<const DepSpec> suggested_depend() const;
END
doxygen_comment << "END"
@@ -83,7 +83,7 @@ END
/**
* Our licences.
*/
- std::tr1::shared_ptr<const DepAtom> license() const;
+ std::tr1::shared_ptr<const DepSpec> license() const;
END
doxygen_comment << "END"
@@ -152,7 +152,7 @@ END
/**
* PROVIDE, as a dep atom.
*/
- std::tr1::shared_ptr<const DepAtom> provide() const;
+ std::tr1::shared_ptr<const DepSpec> provide() const;
END
allow_named_args
diff --git a/paludis/version_requirements.hh b/paludis/version_requirements.hh
index 921f478..1db06bd 100644
--- a/paludis/version_requirements.hh
+++ b/paludis/version_requirements.hh
@@ -31,9 +31,9 @@ namespace paludis
/**
* A collection of VersionRequirement instances, usually for a
- * PackageDepAtom.
+ * PackageDepSpec.
*
- * \see PackageDepAtom
+ * \see PackageDepSpec
* \ingroup grpversions
*/
typedef SequentialCollection<VersionRequirement> VersionRequirements;
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 306ccdc..362cc21 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -22,7 +22,7 @@ IF_RUBY_TESTS = \
package_database_entry_TEST.rb \
version_spec_TEST.rb \
mask_reasons_TEST.rb \
- dep_atom_TEST.rb \
+ dep_spec_TEST.rb \
repository_TEST.rb \
version_metadata_TEST.rb \
portage_dep_parser_TEST.rb \
@@ -46,7 +46,7 @@ IF_RUBY_SOURCES = \
package_database_entry.cc \
version_spec.cc \
mask_reasons.cc \
- dep_atom.cc \
+ dep_spec.cc \
log.cc \
package_database.cc \
repository.cc \
diff --git a/ruby/dep_atom.cc b/ruby/dep_atom.cc
deleted file mode 100644
index 2936cc1..0000000
--- a/ruby/dep_atom.cc
+++ /dev/null
@@ -1,453 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- * Copyright (c) 2006, 2007 Richard Brown <mynamewasgone@gmail.com>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis_ruby.hh>
-#include <paludis/dep_atom.hh>
-#include <ruby.h>
-
-using namespace paludis;
-using namespace paludis::ruby;
-
-#define RUBY_FUNC_CAST(x) reinterpret_cast<VALUE (*)(...)>(x)
-
-namespace
-{
- static VALUE c_dep_atom;
- static VALUE c_composite_dep_atom;
- static VALUE c_package_dep_atom;
- static VALUE c_plain_text_dep_atom;
- static VALUE c_all_dep_atom;
- static VALUE c_any_dep_atom;
- static VALUE c_use_dep_atom;
- static VALUE c_block_dep_atom;
- static VALUE c_string_dep_atom;
- static VALUE c_version_requirements_mode;
-
- VALUE
- dep_atom_init_1(VALUE self, VALUE)
- {
- return self;
- }
-
- VALUE
- block_dep_atom_new(VALUE self, VALUE atom)
- {
- std::tr1::shared_ptr<const BlockDepAtom> * ptr(0);
- try
- {
- std::tr1::shared_ptr<const PackageDepAtom> pkg(value_to_package_dep_atom(atom));
- ptr = new std::tr1::shared_ptr<const BlockDepAtom>(new BlockDepAtom(pkg));
- VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<const BlockDepAtom> >::free, ptr));
- rb_obj_call_init(tdata, 1, &atom);
- return tdata;
- }
- catch (const std::exception & e)
- {
- delete ptr;
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * blocked_atom -> DepAtom
- *
- * Fetch the DepAtom we're blocking.
- */
- VALUE
- block_dep_atom_blocked_atom(VALUE self)
- {
- std::tr1::shared_ptr<const BlockDepAtom> * p;
- Data_Get_Struct(self, std::tr1::shared_ptr<const BlockDepAtom>, p);
- return dep_atom_to_value((*p)->blocked_atom());
- }
-
- template <typename A_>
- struct DepAtomThings
- {
- static VALUE
- dep_atom_new_1(VALUE self, VALUE s)
- {
- std::tr1::shared_ptr<const A_> * ptr(0);
- try
- {
- ptr = new std::tr1::shared_ptr<const A_>(new A_(StringValuePtr(s)));
- VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<const A_> >::free, ptr));
- rb_obj_call_init(tdata, 1, &s);
- return tdata;
- }
- catch (const std::exception & e)
- {
- delete ptr;
- exception_to_ruby_exception(e);
- }
- }
- };
-
- /*
- * call-seq:
- * flag -> String
- *
- * Fetch our use flag name.
- */
- VALUE
- use_dep_atom_flag(VALUE self)
- {
- std::tr1::shared_ptr<const UseDepAtom> * p;
- Data_Get_Struct(self, std::tr1::shared_ptr<const UseDepAtom>, p);
- return rb_str_new2(stringify((*p)->flag()).c_str());
- }
-
- /*
- * call-seq:
- * inverse? -> true or false
- *
- * Fetch whether we are a ! flag.
- */
- VALUE
- use_dep_atom_inverse(VALUE self)
- {
- std::tr1::shared_ptr<const UseDepAtom> * p;
- Data_Get_Struct(self, std::tr1::shared_ptr<const UseDepAtom>, p);
- return (*p)->inverse() ? Qtrue : Qfalse;
- }
-
- /*
- * call-seq: each {|atom| block }
- *
- * Iterate over each child DepAtom.
- */
- VALUE
- composite_dep_atom_each(VALUE self)
- {
- std::tr1::shared_ptr<CompositeDepAtom> * m_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<CompositeDepAtom>, m_ptr);
- for (CompositeDepAtom::Iterator i((*m_ptr)->begin()), i_end((*m_ptr)->end()) ; i != i_end ; ++i)
- rb_yield(dep_atom_to_value(*i));
- return self;
- }
-
- /*
- * call-seq:
- * package -> String
- *
- * Fetch the package name.
- */
- VALUE
- package_dep_atom_package(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- return rb_str_new2(stringify((*ptr)->package()).c_str());
- }
-
- /*
- * call-seq:
- * text -> String
- *
- * Fetch our text.
- */
- VALUE
- package_dep_atom_text(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- return rb_str_new2(stringify((*ptr)->text()).c_str());
- }
-
- /*
- * call-seq:
- * slot -> String or Nil
- *
- * Fetch the slot name.
- */
- VALUE
- package_dep_atom_slot_ptr(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- if (0 == (*ptr)->slot_ptr())
- return Qnil;
- return rb_str_new2(stringify((*(*ptr)->slot_ptr())).c_str());
- }
-
- /*
- * call-seq:
- * repository -> String or Nil
- *
- * Fetch the repository name.
- */
- VALUE
- package_dep_atom_repository_ptr(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- if (0 == (*ptr)->repository_ptr())
- return Qnil;
- return rb_str_new2(stringify((*(*ptr)->repository_ptr())).c_str());
- }
-
- /*
- * call-seq:
- * version_requirements -> Array
- *
- * Fetch the version requirements. E.g. [ {:operator => '=', :spec => VersionSpec.new('0.1') } ]
- */
- VALUE
- package_dep_atom_version_requirements_ptr(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- VALUE result(rb_ary_new());
- VALUE result_hash;
- if ((*ptr)->version_requirements_ptr())
- for (VersionRequirements::Iterator i((*ptr)->version_requirements_ptr()->begin()),
- i_end((*ptr)->version_requirements_ptr()->end()) ; i != i_end; ++i)
- {
- result_hash = rb_hash_new();
- rb_hash_aset(result_hash, ID2SYM(rb_intern("operator")),
- rb_str_new2(stringify(i->version_operator).c_str()));
- rb_hash_aset(result_hash, ID2SYM(rb_intern("spec")),
- version_spec_to_value(i->version_spec));
- rb_ary_push(result, result_hash);
- }
- return result;
- }
-
- VALUE
- package_dep_atom_version_requirements_mode(VALUE self)
- {
- std::tr1::shared_ptr<const PackageDepAtom> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepAtom>, ptr);
- return INT2FIX((*ptr)->version_requirements_mode());
- }
-
- void do_register_dep_atom()
- {
- /*
- * Document-class: Paludis::DepAtom
- *
- * Base class for a dependency atom.
- */
- c_dep_atom = rb_define_class_under(paludis_module(), "DepAtom", rb_cObject);
- rb_funcall(c_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- /*
- * Document-class: Paludis::CompositeDepAtom
- *
- * Class for dependency atoms that have a number of child dependency atoms.
- * Includes Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html]
- * but not Comparable.
- */
- c_composite_dep_atom = rb_define_class_under(paludis_module(), "CompositeDepAtom", c_dep_atom);
- rb_funcall(c_composite_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_composite_dep_atom, "each", RUBY_FUNC_CAST(&composite_dep_atom_each), 0);
- rb_include_module(c_composite_dep_atom, rb_mEnumerable);
-
- /*
- * Document-class: Paludis::AllDepAtom
- *
- * Represents a ( first second third ) or top level group of dependency atoms.
- */
- c_all_dep_atom = rb_define_class_under(paludis_module(), "AllDepAtom", c_composite_dep_atom);
- rb_funcall(c_all_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- /*
- * Document-class: Paludis::AnyDepAtom
- *
- * Represents a "|| ( )" dependency block.
- */
- c_any_dep_atom = rb_define_class_under(paludis_module(), "AnyDepAtom", c_composite_dep_atom);
- rb_funcall(c_any_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- /*
- * Document-class: Paludis::UseDepAtom
- *
- * Represents a use? ( ) dependency atom.
- */
- c_use_dep_atom = rb_define_class_under(paludis_module(), "UseDepAtom", c_composite_dep_atom);
- rb_funcall(c_use_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_use_dep_atom, "flag", RUBY_FUNC_CAST(&use_dep_atom_flag), 0);
- rb_define_method(c_use_dep_atom, "inverse?", RUBY_FUNC_CAST(&use_dep_atom_inverse), 0);
-
- /*
- * Document-class: Paludis::StringDepAtom
- *
- * A StringDepAtom represents a non-composite dep atom with an associated piece of text.
- */
- c_string_dep_atom = rb_define_class_under(paludis_module(), "StringDepAtom", c_dep_atom);
- rb_funcall(c_string_dep_atom, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- /*
- * Document-class: Paludis::PackageDepAtom
- *
- * A PackageDepAtom represents a package name (for example, 'app-editors/vim'),
- * possibly with associated version and SLOT restrictions.
- */
- c_package_dep_atom = rb_define_class_under(paludis_module(), "PackageDepAtom", c_string_dep_atom);
- rb_define_singleton_method(c_package_dep_atom, "new", RUBY_FUNC_CAST(&DepAtomThings<PackageDepAtom>::dep_atom_new_1), 1);
- rb_define_method(c_package_dep_atom, "initialize", RUBY_FUNC_CAST(&dep_atom_init_1), 1);
- rb_define_method(c_package_dep_atom, "to_s", RUBY_FUNC_CAST(&Common<std::tr1::shared_ptr<const PackageDepAtom> >::to_s_via_ptr), 0);
- rb_define_method(c_package_dep_atom, "package", RUBY_FUNC_CAST(&package_dep_atom_package), 0);
- rb_define_method(c_package_dep_atom, "text", RUBY_FUNC_CAST(&package_dep_atom_text), 0);
- rb_define_method(c_package_dep_atom, "slot", RUBY_FUNC_CAST(&package_dep_atom_slot_ptr), 0);
- rb_define_method(c_package_dep_atom, "repository", RUBY_FUNC_CAST(&package_dep_atom_repository_ptr), 0);
- rb_define_method(c_package_dep_atom, "version_requirements", RUBY_FUNC_CAST(&package_dep_atom_version_requirements_ptr), 0);
- rb_define_method(c_package_dep_atom, "version_requirements_mode", RUBY_FUNC_CAST(&package_dep_atom_version_requirements_mode), 0);
-
- /*
- * Document-class: Paludis::PlainTextDepAtom
- *
- * A PlainTextDepAtom represents a plain text entry (for example, a URI in SRC_URI).
- */
- c_plain_text_dep_atom = rb_define_class_under(paludis_module(), "PlainTextDepAtom", c_string_dep_atom);
- rb_define_singleton_method(c_plain_text_dep_atom, "new", RUBY_FUNC_CAST(&DepAtomThings<PlainTextDepAtom>::dep_atom_new_1), 1);
- rb_define_method(c_plain_text_dep_atom, "initialize", RUBY_FUNC_CAST(&dep_atom_init_1), 1);
- rb_define_method(c_plain_text_dep_atom, "to_s", RUBY_FUNC_CAST(&Common<std::tr1::shared_ptr<const PlainTextDepAtom> >::to_s_via_ptr), 0);
-
- /*
- * Document-class: Paludis::BlockDepAtom
- *
- * A BlockDepAtom represents a block on a package name (for example, 'app-editors/vim'), possibly with
- * associated version and SLOT restrictions.
- */
- c_block_dep_atom = rb_define_class_under(paludis_module(), "BlockDepAtom", c_string_dep_atom);
- rb_define_singleton_method(c_block_dep_atom, "new", RUBY_FUNC_CAST(&block_dep_atom_new), 1);
- rb_define_method(c_block_dep_atom, "initialize", RUBY_FUNC_CAST(&dep_atom_init_1), 1);
- rb_define_method(c_block_dep_atom, "blocked_atom", RUBY_FUNC_CAST(&block_dep_atom_blocked_atom), 0);
-
- /*
- * Document-module: Paludis::VersionRequirementsMode
- *
- * What sort of VersionRequirements to we have.
- *
- */
- c_version_requirements_mode = rb_define_module_under(paludis_module(), "VersionRequirementsMode");
- for (VersionRequirementsMode l(static_cast<VersionRequirementsMode>(0)), l_end(last_vr) ; l != l_end ;
- l = static_cast<VersionRequirementsMode>(static_cast<int>(l) + 1))
- rb_define_const(c_version_requirements_mode, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
-
- // cc_enum_special<paludis/version_requirements.hh, VersionRequirementsMode, c_version_requirements_mode>
- }
-}
-
-std::tr1::shared_ptr<const PackageDepAtom>
-paludis::ruby::value_to_package_dep_atom(VALUE v)
-{
- if (T_STRING == TYPE(v))
- return std::tr1::shared_ptr<const PackageDepAtom>(new PackageDepAtom(StringValuePtr(v)));
- else if (rb_obj_is_kind_of(v, c_package_dep_atom))
- {
- std::tr1::shared_ptr<const PackageDepAtom> * v_ptr;
- Data_Get_Struct(v, std::tr1::shared_ptr<const PackageDepAtom>, v_ptr);
- return *v_ptr;
- }
- else
- {
- rb_raise(rb_eTypeError, "Can't convert %s into PackageDepAtom", rb_obj_classname(v));
- }
-}
-
-std::tr1::shared_ptr<const DepAtom>
-paludis::ruby::value_to_dep_atom(VALUE v)
-{
- if (rb_obj_is_kind_of(v, c_dep_atom))
- {
- std::tr1::shared_ptr<const DepAtom> * v_ptr;
- Data_Get_Struct(v, std::tr1::shared_ptr<const DepAtom>, v_ptr);
- return *v_ptr;
- }
- else
- {
- rb_raise(rb_eTypeError, "Can't convert %s into PackageDepAtom", rb_obj_classname(v));
- }
-}
-
-VALUE
-paludis::ruby::dep_atom_to_value(std::tr1::shared_ptr<const DepAtom> m)
-{
- struct V :
- DepAtomVisitorTypes::ConstVisitor
- {
- VALUE value;
- std::tr1::shared_ptr<const DepAtom> mm;
-
- V(std::tr1::shared_ptr<const DepAtom> _m) :
- mm(_m)
- {
- }
-
- void visit(const AllDepAtom *)
- {
- value = Data_Wrap_Struct(c_all_dep_atom, 0, &Common<std::tr1::shared_ptr<const AllDepAtom> >::free,
- new std::tr1::shared_ptr<const AllDepAtom>(std::tr1::static_pointer_cast<const AllDepAtom>(mm)));
- }
-
- void visit(const AnyDepAtom *)
- {
- value = Data_Wrap_Struct(c_any_dep_atom, 0, &Common<std::tr1::shared_ptr<const AnyDepAtom> >::free,
- new std::tr1::shared_ptr<const AnyDepAtom>(std::tr1::static_pointer_cast<const AnyDepAtom>(mm)));
- }
-
- void visit(const UseDepAtom *)
- {
- value = Data_Wrap_Struct(c_use_dep_atom, 0, &Common<std::tr1::shared_ptr<const UseDepAtom> >::free,
- new std::tr1::shared_ptr<const UseDepAtom>(std::tr1::static_pointer_cast<const UseDepAtom>(mm)));
- }
-
- void visit(const PlainTextDepAtom *)
- {
- value = Data_Wrap_Struct(c_plain_text_dep_atom, 0, &Common<std::tr1::shared_ptr<const PlainTextDepAtom> >::free,
- new std::tr1::shared_ptr<const PlainTextDepAtom>(std::tr1::static_pointer_cast<const PlainTextDepAtom>(mm)));
- }
-
- void visit(const PackageDepAtom *)
- {
- value = Data_Wrap_Struct(c_package_dep_atom, 0, &Common<std::tr1::shared_ptr<const PackageDepAtom> >::free,
- new std::tr1::shared_ptr<const PackageDepAtom>(std::tr1::static_pointer_cast<const PackageDepAtom>(mm)));
- }
-
- void visit(const BlockDepAtom *)
- {
- value = Data_Wrap_Struct(c_block_dep_atom, 0, &Common<std::tr1::shared_ptr<const BlockDepAtom> >::free,
- new std::tr1::shared_ptr<const BlockDepAtom>(std::tr1::static_pointer_cast<const BlockDepAtom>(mm)));
- }
- };
-
- if (0 == m)
- return Qnil;
-
- std::tr1::shared_ptr<const DepAtom> * m_ptr(0);
- try
- {
- V v(m);
- m->accept(&v);
- return v.value;
- }
- catch (const std::exception & e)
- {
- delete m_ptr;
- exception_to_ruby_exception(e);
- }
-}
-
-RegisterRubyClass::Register paludis_ruby_register_dep_atom PALUDIS_ATTRIBUTE((used))
- (&do_register_dep_atom);
-
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 1359714..f29adb7 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -824,9 +824,9 @@ namespace
/*
* call-seq:
- * add(dep_atom, destinations)
+ * add(dep_spec, destinations)
*
- * Add the packages required to resolve an additional dependency atom.
+ * Add the packages required to resolve an additional dependency spec.
*/
VALUE
dep_list_add(VALUE self, VALUE da, VALUE d)
@@ -842,7 +842,7 @@ namespace
for (long i = 0 ; i < RARRAY(d)->len ; ++i)
destinations->insert(value_to_repository(rb_ary_entry(d, i)));
- p->add(value_to_dep_atom(da), destinations);
+ p->add(value_to_dep_spec(da), destinations);
return self;
}
catch (const std::exception & e)
@@ -882,9 +882,9 @@ namespace
/*
* call-seq:
- * already_installed?(dep_atom, destinations)
+ * already_installed?(dep_spec, destinations)
*
- * Is an atom structure already installed?
+ * Is an spec structure already installed?
*/
VALUE
dep_list_already_installed(VALUE self, VALUE da, VALUE d)
@@ -900,7 +900,7 @@ namespace
for (long i = 0 ; i < RARRAY(d)->len ; ++i)
destinations->insert(value_to_repository(rb_ary_entry(d, i)));
- return p->already_installed(*value_to_dep_atom(da), destinations) ? Qtrue : Qfalse;
+ return p->already_installed(*value_to_dep_spec(da), destinations) ? Qtrue : Qfalse;
}
catch (const std::exception & e)
{
diff --git a/ruby/dep_list_TEST.rb b/ruby/dep_list_TEST.rb
index 81fe297..469afb6 100644
--- a/ruby/dep_list_TEST.rb
+++ b/ruby/dep_list_TEST.rb
@@ -118,7 +118,7 @@ module Paludis
end
def pda
- PackageDepAtom.new('foo/bar')
+ PackageDepSpec.new('foo/bar')
end
def dd
@@ -193,11 +193,11 @@ module Paludis
end
def test_already_installed?
- dep_atom = pda
+ dep_spec = pda
dep_list = dl
- assert !dep_list.already_installed?(dep_atom, dd)
- dep_list.add(dep_atom, dd)
- assert dep_list.already_installed?(dep_atom, dd)
+ assert !dep_list.already_installed?(dep_spec, dd)
+ dep_list.add(dep_spec, dd)
+ assert dep_list.already_installed?(dep_spec, dd)
end
def test_each
@@ -206,11 +206,11 @@ module Paludis
def test_errors
assert_raise AllMaskedError do
- dl.add(PackageDepAtom.new('foo/ba'), dd)
+ dl.add(PackageDepSpec.new('foo/ba'), dd)
end
begin
- dl.add(PackageDepAtom.new('foo/ba'), dd)
+ dl.add(PackageDepSpec.new('foo/ba'), dd)
rescue AllMaskedError => error
assert_equal 'foo/ba', error.query
end
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
new file mode 100644
index 0000000..8543a0f
--- /dev/null
+++ b/ruby/dep_spec.cc
@@ -0,0 +1,453 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Richard Brown <mynamewasgone@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis_ruby.hh>
+#include <paludis/dep_spec.hh>
+#include <ruby.h>
+
+using namespace paludis;
+using namespace paludis::ruby;
+
+#define RUBY_FUNC_CAST(x) reinterpret_cast<VALUE (*)(...)>(x)
+
+namespace
+{
+ static VALUE c_dep_spec;
+ static VALUE c_composite_dep_spec;
+ static VALUE c_package_dep_spec;
+ static VALUE c_plain_text_dep_spec;
+ static VALUE c_all_dep_spec;
+ static VALUE c_any_dep_spec;
+ static VALUE c_use_dep_spec;
+ static VALUE c_block_dep_spec;
+ static VALUE c_string_dep_spec;
+ static VALUE c_version_requirements_mode;
+
+ VALUE
+ dep_spec_init_1(VALUE self, VALUE)
+ {
+ return self;
+ }
+
+ VALUE
+ block_dep_spec_new(VALUE self, VALUE spec)
+ {
+ std::tr1::shared_ptr<const BlockDepSpec> * ptr(0);
+ try
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> pkg(value_to_package_dep_spec(spec));
+ ptr = new std::tr1::shared_ptr<const BlockDepSpec>(new BlockDepSpec(pkg));
+ VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<const BlockDepSpec> >::free, ptr));
+ rb_obj_call_init(tdata, 1, &spec);
+ return tdata;
+ }
+ catch (const std::exception & e)
+ {
+ delete ptr;
+ exception_to_ruby_exception(e);
+ }
+ }
+
+ /*
+ * call-seq:
+ * blocked_spec -> DepSpec
+ *
+ * Fetch the DepSpec we're blocking.
+ */
+ VALUE
+ block_dep_spec_blocked_spec(VALUE self)
+ {
+ std::tr1::shared_ptr<const BlockDepSpec> * p;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const BlockDepSpec>, p);
+ return dep_spec_to_value((*p)->blocked_spec());
+ }
+
+ template <typename A_>
+ struct DepSpecThings
+ {
+ static VALUE
+ dep_spec_new_1(VALUE self, VALUE s)
+ {
+ std::tr1::shared_ptr<const A_> * ptr(0);
+ try
+ {
+ ptr = new std::tr1::shared_ptr<const A_>(new A_(StringValuePtr(s)));
+ VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<const A_> >::free, ptr));
+ rb_obj_call_init(tdata, 1, &s);
+ return tdata;
+ }
+ catch (const std::exception & e)
+ {
+ delete ptr;
+ exception_to_ruby_exception(e);
+ }
+ }
+ };
+
+ /*
+ * call-seq:
+ * flag -> String
+ *
+ * Fetch our use flag name.
+ */
+ VALUE
+ use_dep_spec_flag(VALUE self)
+ {
+ std::tr1::shared_ptr<const UseDepSpec> * p;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const UseDepSpec>, p);
+ return rb_str_new2(stringify((*p)->flag()).c_str());
+ }
+
+ /*
+ * call-seq:
+ * inverse? -> true or false
+ *
+ * Fetch whether we are a ! flag.
+ */
+ VALUE
+ use_dep_spec_inverse(VALUE self)
+ {
+ std::tr1::shared_ptr<const UseDepSpec> * p;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const UseDepSpec>, p);
+ return (*p)->inverse() ? Qtrue : Qfalse;
+ }
+
+ /*
+ * call-seq: each {|spec| block }
+ *
+ * Iterate over each child DepSpec.
+ */
+ VALUE
+ composite_dep_spec_each(VALUE self)
+ {
+ std::tr1::shared_ptr<CompositeDepSpec> * m_ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<CompositeDepSpec>, m_ptr);
+ for (CompositeDepSpec::Iterator i((*m_ptr)->begin()), i_end((*m_ptr)->end()) ; i != i_end ; ++i)
+ rb_yield(dep_spec_to_value(*i));
+ return self;
+ }
+
+ /*
+ * call-seq:
+ * package -> String
+ *
+ * Fetch the package name.
+ */
+ VALUE
+ package_dep_spec_package(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ return rb_str_new2(stringify((*ptr)->package()).c_str());
+ }
+
+ /*
+ * call-seq:
+ * text -> String
+ *
+ * Fetch our text.
+ */
+ VALUE
+ package_dep_spec_text(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ return rb_str_new2(stringify((*ptr)->text()).c_str());
+ }
+
+ /*
+ * call-seq:
+ * slot -> String or Nil
+ *
+ * Fetch the slot name.
+ */
+ VALUE
+ package_dep_spec_slot_ptr(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ if (0 == (*ptr)->slot_ptr())
+ return Qnil;
+ return rb_str_new2(stringify((*(*ptr)->slot_ptr())).c_str());
+ }
+
+ /*
+ * call-seq:
+ * repository -> String or Nil
+ *
+ * Fetch the repository name.
+ */
+ VALUE
+ package_dep_spec_repository_ptr(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ if (0 == (*ptr)->repository_ptr())
+ return Qnil;
+ return rb_str_new2(stringify((*(*ptr)->repository_ptr())).c_str());
+ }
+
+ /*
+ * call-seq:
+ * version_requirements -> Array
+ *
+ * Fetch the version requirements. E.g. [ {:operator => '=', :spec => VersionSpec.new('0.1') } ]
+ */
+ VALUE
+ package_dep_spec_version_requirements_ptr(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ VALUE result(rb_ary_new());
+ VALUE result_hash;
+ if ((*ptr)->version_requirements_ptr())
+ for (VersionRequirements::Iterator i((*ptr)->version_requirements_ptr()->begin()),
+ i_end((*ptr)->version_requirements_ptr()->end()) ; i != i_end; ++i)
+ {
+ result_hash = rb_hash_new();
+ rb_hash_aset(result_hash, ID2SYM(rb_intern("operator")),
+ rb_str_new2(stringify(i->version_operator).c_str()));
+ rb_hash_aset(result_hash, ID2SYM(rb_intern("spec")),
+ version_spec_to_value(i->version_spec));
+ rb_ary_push(result, result_hash);
+ }
+ return result;
+ }
+
+ VALUE
+ package_dep_spec_version_requirements_mode(VALUE self)
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
+ return INT2FIX((*ptr)->version_requirements_mode());
+ }
+
+ void do_register_dep_spec()
+ {
+ /*
+ * Document-class: Paludis::DepSpec
+ *
+ * Base class for a dependency spec.
+ */
+ c_dep_spec = rb_define_class_under(paludis_module(), "DepSpec", rb_cObject);
+ rb_funcall(c_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+
+ /*
+ * Document-class: Paludis::CompositeDepSpec
+ *
+ * Class for dependency specs that have a number of child dependency specs.
+ * Includes Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html]
+ * but not Comparable.
+ */
+ c_composite_dep_spec = rb_define_class_under(paludis_module(), "CompositeDepSpec", c_dep_spec);
+ rb_funcall(c_composite_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_composite_dep_spec, "each", RUBY_FUNC_CAST(&composite_dep_spec_each), 0);
+ rb_include_module(c_composite_dep_spec, rb_mEnumerable);
+
+ /*
+ * Document-class: Paludis::AllDepSpec
+ *
+ * Represents a ( first second third ) or top level group of dependency specs.
+ */
+ c_all_dep_spec = rb_define_class_under(paludis_module(), "AllDepSpec", c_composite_dep_spec);
+ rb_funcall(c_all_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+
+ /*
+ * Document-class: Paludis::AnyDepSpec
+ *
+ * Represents a "|| ( )" dependency block.
+ */
+ c_any_dep_spec = rb_define_class_under(paludis_module(), "AnyDepSpec", c_composite_dep_spec);
+ rb_funcall(c_any_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+
+ /*
+ * Document-class: Paludis::UseDepSpec
+ *
+ * Represents a use? ( ) dependency spec.
+ */
+ c_use_dep_spec = rb_define_class_under(paludis_module(), "UseDepSpec", c_composite_dep_spec);
+ rb_funcall(c_use_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_use_dep_spec, "flag", RUBY_FUNC_CAST(&use_dep_spec_flag), 0);
+ rb_define_method(c_use_dep_spec, "inverse?", RUBY_FUNC_CAST(&use_dep_spec_inverse), 0);
+
+ /*
+ * Document-class: Paludis::StringDepSpec
+ *
+ * A StringDepSpec represents a non-composite dep spec with an associated piece of text.
+ */
+ c_string_dep_spec = rb_define_class_under(paludis_module(), "StringDepSpec", c_dep_spec);
+ rb_funcall(c_string_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+
+ /*
+ * Document-class: Paludis::PackageDepSpec
+ *
+ * A PackageDepSpec represents a package name (for example, 'app-editors/vim'),
+ * possibly with associated version and SLOT restrictions.
+ */
+ c_package_dep_spec = rb_define_class_under(paludis_module(), "PackageDepSpec", c_string_dep_spec);
+ rb_define_singleton_method(c_package_dep_spec, "new", RUBY_FUNC_CAST(&DepSpecThings<PackageDepSpec>::dep_spec_new_1), 1);
+ rb_define_method(c_package_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_1), 1);
+ rb_define_method(c_package_dep_spec, "to_s", RUBY_FUNC_CAST(&Common<std::tr1::shared_ptr<const PackageDepSpec> >::to_s_via_ptr), 0);
+ rb_define_method(c_package_dep_spec, "package", RUBY_FUNC_CAST(&package_dep_spec_package), 0);
+ rb_define_method(c_package_dep_spec, "text", RUBY_FUNC_CAST(&package_dep_spec_text), 0);
+ rb_define_method(c_package_dep_spec, "slot", RUBY_FUNC_CAST(&package_dep_spec_slot_ptr), 0);
+ rb_define_method(c_package_dep_spec, "repository", RUBY_FUNC_CAST(&package_dep_spec_repository_ptr), 0);
+ rb_define_method(c_package_dep_spec, "version_requirements", RUBY_FUNC_CAST(&package_dep_spec_version_requirements_ptr), 0);
+ rb_define_method(c_package_dep_spec, "version_requirements_mode", RUBY_FUNC_CAST(&package_dep_spec_version_requirements_mode), 0);
+
+ /*
+ * Document-class: Paludis::PlainTextDepSpec
+ *
+ * A PlainTextDepSpec represents a plain text entry (for example, a URI in SRC_URI).
+ */
+ c_plain_text_dep_spec = rb_define_class_under(paludis_module(), "PlainTextDepSpec", c_string_dep_spec);
+ rb_define_singleton_method(c_plain_text_dep_spec, "new", RUBY_FUNC_CAST(&DepSpecThings<PlainTextDepSpec>::dep_spec_new_1), 1);
+ rb_define_method(c_plain_text_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_1), 1);
+ rb_define_method(c_plain_text_dep_spec, "to_s", RUBY_FUNC_CAST(&Common<std::tr1::shared_ptr<const PlainTextDepSpec> >::to_s_via_ptr), 0);
+
+ /*
+ * Document-class: Paludis::BlockDepSpec
+ *
+ * A BlockDepSpec represents a block on a package name (for example, 'app-editors/vim'), possibly with
+ * associated version and SLOT restrictions.
+ */
+ c_block_dep_spec = rb_define_class_under(paludis_module(), "BlockDepSpec", c_string_dep_spec);
+ rb_define_singleton_method(c_block_dep_spec, "new", RUBY_FUNC_CAST(&block_dep_spec_new), 1);
+ rb_define_method(c_block_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_1), 1);
+ rb_define_method(c_block_dep_spec, "blocked_spec", RUBY_FUNC_CAST(&block_dep_spec_blocked_spec), 0);
+
+ /*
+ * Document-module: Paludis::VersionRequirementsMode
+ *
+ * What sort of VersionRequirements to we have.
+ *
+ */
+ c_version_requirements_mode = rb_define_module_under(paludis_module(), "VersionRequirementsMode");
+ for (VersionRequirementsMode l(static_cast<VersionRequirementsMode>(0)), l_end(last_vr) ; l != l_end ;
+ l = static_cast<VersionRequirementsMode>(static_cast<int>(l) + 1))
+ rb_define_const(c_version_requirements_mode, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
+
+ // cc_enum_special<paludis/version_requirements.hh, VersionRequirementsMode, c_version_requirements_mode>
+ }
+}
+
+std::tr1::shared_ptr<const PackageDepSpec>
+paludis::ruby::value_to_package_dep_spec(VALUE v)
+{
+ if (T_STRING == TYPE(v))
+ return std::tr1::shared_ptr<const PackageDepSpec>(new PackageDepSpec(StringValuePtr(v)));
+ else if (rb_obj_is_kind_of(v, c_package_dep_spec))
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> * v_ptr;
+ Data_Get_Struct(v, std::tr1::shared_ptr<const PackageDepSpec>, v_ptr);
+ return *v_ptr;
+ }
+ else
+ {
+ rb_raise(rb_eTypeError, "Can't convert %s into PackageDepSpec", rb_obj_classname(v));
+ }
+}
+
+std::tr1::shared_ptr<const DepSpec>
+paludis::ruby::value_to_dep_spec(VALUE v)
+{
+ if (rb_obj_is_kind_of(v, c_dep_spec))
+ {
+ std::tr1::shared_ptr<const DepSpec> * v_ptr;
+ Data_Get_Struct(v, std::tr1::shared_ptr<const DepSpec>, v_ptr);
+ return *v_ptr;
+ }
+ else
+ {
+ rb_raise(rb_eTypeError, "Can't convert %s into PackageDepSpec", rb_obj_classname(v));
+ }
+}
+
+VALUE
+paludis::ruby::dep_spec_to_value(std::tr1::shared_ptr<const DepSpec> m)
+{
+ struct V :
+ DepSpecVisitorTypes::ConstVisitor
+ {
+ VALUE value;
+ std::tr1::shared_ptr<const DepSpec> mm;
+
+ V(std::tr1::shared_ptr<const DepSpec> _m) :
+ mm(_m)
+ {
+ }
+
+ void visit(const AllDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_all_dep_spec, 0, &Common<std::tr1::shared_ptr<const AllDepSpec> >::free,
+ new std::tr1::shared_ptr<const AllDepSpec>(std::tr1::static_pointer_cast<const AllDepSpec>(mm)));
+ }
+
+ void visit(const AnyDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_any_dep_spec, 0, &Common<std::tr1::shared_ptr<const AnyDepSpec> >::free,
+ new std::tr1::shared_ptr<const AnyDepSpec>(std::tr1::static_pointer_cast<const AnyDepSpec>(mm)));
+ }
+
+ void visit(const UseDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_use_dep_spec, 0, &Common<std::tr1::shared_ptr<const UseDepSpec> >::free,
+ new std::tr1::shared_ptr<const UseDepSpec>(std::tr1::static_pointer_cast<const UseDepSpec>(mm)));
+ }
+
+ void visit(const PlainTextDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_plain_text_dep_spec, 0, &Common<std::tr1::shared_ptr<const PlainTextDepSpec> >::free,
+ new std::tr1::shared_ptr<const PlainTextDepSpec>(std::tr1::static_pointer_cast<const PlainTextDepSpec>(mm)));
+ }
+
+ void visit(const PackageDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_package_dep_spec, 0, &Common<std::tr1::shared_ptr<const PackageDepSpec> >::free,
+ new std::tr1::shared_ptr<const PackageDepSpec>(std::tr1::static_pointer_cast<const PackageDepSpec>(mm)));
+ }
+
+ void visit(const BlockDepSpec *)
+ {
+ value = Data_Wrap_Struct(c_block_dep_spec, 0, &Common<std::tr1::shared_ptr<const BlockDepSpec> >::free,
+ new std::tr1::shared_ptr<const BlockDepSpec>(std::tr1::static_pointer_cast<const BlockDepSpec>(mm)));
+ }
+ };
+
+ if (0 == m)
+ return Qnil;
+
+ std::tr1::shared_ptr<const DepSpec> * m_ptr(0);
+ try
+ {
+ V v(m);
+ m->accept(&v);
+ return v.value;
+ }
+ catch (const std::exception & e)
+ {
+ delete m_ptr;
+ exception_to_ruby_exception(e);
+ }
+}
+
+RegisterRubyClass::Register paludis_ruby_register_dep_spec PALUDIS_ATTRIBUTE((used))
+ (&do_register_dep_spec);
+
diff --git a/ruby/dep_atom_TEST.rb b/ruby/dep_spec_TEST.rb
index c328e34..ce33e41 100644
--- a/ruby/dep_atom_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
# Copyright (c) 2007 Richard Brown <mynamewasgone@gmail.com>
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -22,26 +22,26 @@ require 'test/unit'
require 'Paludis'
module Paludis
- class TestCase_DepAtom < Test::Unit::TestCase
+ class TestCase_DepSpec < Test::Unit::TestCase
def test_create_error
assert_raise NoMethodError do
- v = DepAtom.new
+ v = DepSpec.new
end
assert_raise NoMethodError do
- v = StringDepAtom.new
+ v = StringDepSpec.new
end
assert_raise NoMethodError do
- v = AnyDepAtom.new
+ v = AnyDepSpec.new
end
assert_raise NoMethodError do
- v = AllDepAtom.new
+ v = AllDepSpec.new
end
end
end
- class TestCase_PackageDepAtom < Test::Unit::TestCase
+ class TestCase_PackageDepSpec < Test::Unit::TestCase
def pda
- PackageDepAtom.new('>=foo/bar-1:100::testrepo')
+ PackageDepSpec.new('>=foo/bar-1:100::testrepo')
end
def test_create
@@ -50,10 +50,10 @@ module Paludis
def test_create_error
assert_raise TypeError do
- v = PackageDepAtom.new(0)
+ v = PackageDepSpec.new(0)
end
- assert_raise PackageDepAtomError do
- v = PackageDepAtom.new("=sys-apps/foo")
+ assert_raise PackageDepSpecError do
+ v = PackageDepSpec.new("=sys-apps/foo")
end
end
@@ -90,67 +90,67 @@ module Paludis
end
end
- class TestCase_PlainTextDepAtom < Test::Unit::TestCase
+ class TestCase_PlainTextDepSpec < Test::Unit::TestCase
def test_create
- v = PlainTextDepAtom.new("monkey")
+ v = PlainTextDepSpec.new("monkey")
end
def test_create_error
assert_raise TypeError do
- v = PlainTextDepAtom.new(0)
+ v = PlainTextDepSpec.new(0)
end
end
def test_to_s
- assert_equal "monkey", PlainTextDepAtom.new("monkey").to_s
+ assert_equal "monkey", PlainTextDepSpec.new("monkey").to_s
end
end
- class TestCase_BlockDepAtom < Test::Unit::TestCase
+ class TestCase_BlockDepSpec < Test::Unit::TestCase
def test_create
- v = BlockDepAtom.new(PackageDepAtom.new(">=foo/bar-1"))
- w = BlockDepAtom.new("<=foo/bar-2")
+ v = BlockDepSpec.new(PackageDepSpec.new(">=foo/bar-1"))
+ w = BlockDepSpec.new("<=foo/bar-2")
end
def test_create_error
assert_raise TypeError do
- v = BlockDepAtom.new(0)
+ v = BlockDepSpec.new(0)
end
- assert_raise PackageDepAtomError do
- v = BlockDepAtom.new("=foo/bar")
+ assert_raise PackageDepSpecError do
+ v = BlockDepSpec.new("=foo/bar")
end
assert_raise TypeError do
- v = BlockDepAtom.new(PlainTextDepAtom.new('foo-bar/baz'))
+ v = BlockDepSpec.new(PlainTextDepSpec.new('foo-bar/baz'))
end
end
- def test_blocked_atom
- assert_equal "foo/bar", BlockDepAtom.new("foo/bar").blocked_atom.to_s
- assert_equal "foo/baz", BlockDepAtom.new(PackageDepAtom.new("foo/baz")).blocked_atom.to_s
+ def test_blocked_spec
+ assert_equal "foo/bar", BlockDepSpec.new("foo/bar").blocked_spec.to_s
+ assert_equal "foo/baz", BlockDepSpec.new(PackageDepSpec.new("foo/baz")).blocked_spec.to_s
end
end
class TestCase_Composites < Test::Unit::TestCase
def test_composites
- atom = PortageDepParser::parse("|| ( foo/bar foo/baz ) foo/monkey")
- assert_kind_of CompositeDepAtom, atom
- assert_kind_of AllDepAtom, atom
+ spec = PortageDepParser::parse("|| ( foo/bar foo/baz ) foo/monkey")
+ assert_kind_of CompositeDepSpec, spec
+ assert_kind_of AllDepSpec, spec
- assert_equal 2, atom.to_a.length
+ assert_equal 2, spec.to_a.length
- atom.each_with_index do | a, i |
+ spec.each_with_index do | a, i |
case i
when 0
- assert_kind_of AnyDepAtom, a
+ assert_kind_of AnyDepSpec, a
assert_equal 2, a.to_a.length
a.each_with_index do | b, j |
case j
when 0
- assert_kind_of PackageDepAtom, b
+ assert_kind_of PackageDepSpec, b
assert_equal "foo/bar", b.to_s
when 1
- assert_kind_of PackageDepAtom, b
+ assert_kind_of PackageDepSpec, b
assert_equal "foo/baz", b.to_s
else
@@ -159,7 +159,7 @@ module Paludis
end
when 1
- assert_kind_of PackageDepAtom, a
+ assert_kind_of PackageDepSpec, a
assert_equal "foo/monkey", a.to_s
else
diff --git a/ruby/dep_tag.cc b/ruby/dep_tag.cc
index d3490e2..116bb2a 100644
--- a/ruby/dep_tag.cc
+++ b/ruby/dep_tag.cc
@@ -155,7 +155,7 @@ namespace
/*
* Document-class: Paludis::DepTag
*
- * A DepTag can be associated with a PackageDepAtom, and is transferred onto any associated DepListEntry instances.
+ * A DepTag can be associated with a PackageDepSpec, and is transferred onto any associated DepListEntry instances.
*
* It is used for tagging dep list entries visually, for example to indicate an associated GLSA.
*/
diff --git a/ruby/environment.cc b/ruby/environment.cc
index 5dfe221..cae0730 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -212,7 +212,7 @@ namespace
* call-seq:
* package_set(set_name)
*
- * Fetch a named package set as a DepAtom.
+ * Fetch a named package set as a DepSpec.
*/
VALUE
environment_package_set(VALUE self, VALUE set_name)
@@ -222,7 +222,7 @@ namespace
try
{
- return dep_atom_to_value(env_data->env_ptr->package_set(SetName(StringValuePtr(set_name))));
+ return dep_spec_to_value(env_data->env_ptr->package_set(SetName(StringValuePtr(set_name))));
}
catch (const std::exception & e)
{
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index 19f9d5f..c70b0a2 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -321,7 +321,7 @@ module Paludis
class TestCase_DefaultEnvironmentPackageSet < Test::Unit::TestCase
def test_package_set
- assert_kind_of DepAtom, DefaultEnvironment.instance.package_set('everything')
+ assert_kind_of DepSpec, DefaultEnvironment.instance.package_set('everything')
end
def test_package_set_error
@@ -337,7 +337,7 @@ module Paludis
end
def test_package_set
- assert_kind_of DepAtom, DefaultEnvironment.instance.package_set('everything')
+ assert_kind_of DepSpec, DefaultEnvironment.instance.package_set('everything')
end
def test_package_set_error
diff --git a/ruby/package_database.cc b/ruby/package_database.cc
index d090c2c..a6c9b2e 100644
--- a/ruby/package_database.cc
+++ b/ruby/package_database.cc
@@ -79,9 +79,9 @@ namespace
/*
* call-seq:
* query(query, query_order) -> Array
- * query(atom, install_state, query_order) -> Array
+ * query(spec, install_state, query_order) -> Array
*
- * Query the repository, the first argument is either a PackageDepAtom or a Query.
+ * Query the repository, the first argument is either a PackageDepSpec or a Query.
* Returns an array of PackageDatabaseEntry.
*/
VALUE
@@ -103,12 +103,12 @@ namespace
else if (2 == argc || 3 == argc)
{
QueryOrder qo;
- std::tr1::shared_ptr<const PackageDepAtom> pda(value_to_package_dep_atom(argv[0]));
+ std::tr1::shared_ptr<const PackageDepSpec> pda(value_to_package_dep_spec(argv[0]));
InstallState is = static_cast<InstallState>(NUM2INT(argv[1]));
if (2 ==argc)
{
qo = qo_order_by_version;
- rb_warn("Calling query with (PackageDepAtom, InstallState) has been deprecated");
+ rb_warn("Calling query with (PackageDepSpec, InstallState) has been deprecated");
}
else
qo = static_cast<QueryOrder>(NUM2INT(argv[2]));
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index 35f97a0..6422d90 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
@@ -71,15 +71,15 @@ module Paludis
#outputs a deprecation warning
assert_nothing_raised do
- db.query(PackageDepAtom.new("=foo/bar-1.0"), InstallState::Any)
+ db.query(PackageDepSpec.new("=foo/bar-1.0"), InstallState::Any)
end
assert_nothing_raised do
- db.query(PackageDepAtom.new("=foo/bar-1.0"), InstallState::Any, QueryOrder::Whatever)
+ db.query(PackageDepSpec.new("=foo/bar-1.0"), InstallState::Any, QueryOrder::Whatever)
end
assert_nothing_raised do
- db.query(Query::Matches.new(PackageDepAtom.new('=foo/bar-1.0')), QueryOrder::Whatever)
+ db.query(Query::Matches.new(PackageDepSpec.new('=foo/bar-1.0')), QueryOrder::Whatever)
end
assert_raise ArgumentError do
@@ -95,7 +95,7 @@ module Paludis
QueryOrder::Whatever)
assert_equal a, [ PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo") ]
- a = db.query(PackageDepAtom.new("=foo/bar-1.0"), InstallState::Any, QueryOrder::Whatever)
+ a = db.query(PackageDepSpec.new("=foo/bar-1.0"), InstallState::Any, QueryOrder::Whatever)
assert_equal a, [ PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo") ]
a = db.query("foo/bar", InstallState::InstallableOnly, QueryOrder::OrderByVersion)
@@ -122,7 +122,7 @@ module Paludis
db.query(123, InstallState::Any)
end
assert_raise TypeError do
- db.query(PackageDepAtom.new("foo/bar"), "Either")
+ db.query(PackageDepSpec.new("foo/bar"), "Either")
end
end
end
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 0729e81..147f286 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -52,7 +52,7 @@ namespace
static VALUE c_category_name_part_error;
static VALUE c_package_name_part_error;
static VALUE c_bad_version_spec_error;
- static VALUE c_package_dep_atom_error;
+ static VALUE c_package_dep_spec_error;
static VALUE c_package_database_error;
static VALUE c_package_database_lookup_error;
static VALUE c_ambiguous_package_name_error;
@@ -85,9 +85,9 @@ namespace
/* Document-method: match_package
*
* call-seq:
- * match_package (env, atom, target)
+ * match_package (env, spec, target)
*
- * Return whether the specified atom matches the specified target.
+ * Return whether the specified spec matches the specified target.
*
*/
VALUE paludis_match_package(VALUE, VALUE en, VALUE a, VALUE t)
@@ -95,9 +95,9 @@ namespace
try
{
Environment * env = value_to_environment_data(en)->env_ptr;
- std::tr1::shared_ptr<const PackageDepAtom> atom = value_to_package_dep_atom(a);
+ std::tr1::shared_ptr<const PackageDepSpec> spec = value_to_package_dep_spec(a);
PackageDatabaseEntry target = value_to_package_database_entry(t);
- return match_package(*env, *atom, target) ? Qtrue : Qfalse;
+ return match_package(*env, *spec, target) ? Qtrue : Qfalse;
}
catch (const std::exception & e)
{
@@ -144,8 +144,8 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
rb_raise(c_category_name_part_error, dynamic_cast<const paludis::CategoryNamePartError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::NameError *>(&ee))
rb_raise(c_name_error, dynamic_cast<const paludis::NameError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::PackageDepAtomError *>(&ee))
- rb_raise(c_package_dep_atom_error, dynamic_cast<const paludis::PackageDepAtomError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::PackageDepSpecError *>(&ee))
+ rb_raise(c_package_dep_spec_error, dynamic_cast<const paludis::PackageDepSpecError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::NoSuchRepositoryError *>(&ee))
rb_raise(c_no_such_repository_error, dynamic_cast<const paludis::NoSuchRepositoryError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::AmbiguousPackageNameError *>(&ee))
@@ -291,7 +291,7 @@ void paludis::ruby::init()
c_category_name_part_error = rb_define_class_under(c_paludis_module, "CategoryNamePartError", c_name_error);
c_package_name_part_error = rb_define_class_under(c_paludis_module, "PackageNamePartError", c_name_error);
c_bad_version_spec_error = rb_define_class_under(c_paludis_module, "BadVersionSpecError", c_name_error);
- c_package_dep_atom_error = rb_define_class_under(c_paludis_module, "PackageDepAtomError", rb_eRuntimeError);
+ c_package_dep_spec_error = rb_define_class_under(c_paludis_module, "PackageDepSpecError", rb_eRuntimeError);
c_package_database_error = rb_define_class_under(c_paludis_module, "PackageDatabaseError", rb_eRuntimeError);
c_package_database_lookup_error = rb_define_class_under(c_paludis_module, "PackageDatabaseLookupError", c_package_database_error);
c_ambiguous_package_name_error = rb_define_class_under(c_paludis_module, "AmbiguousPackageNameError", c_package_database_lookup_error);
@@ -307,7 +307,7 @@ void paludis::ruby::init()
/*
* Document-class: Paludis::AllMaskedError
*
- * Thrown if all versions of a particular atom are masked.
+ * Thrown if all versions of a particular spec are masked.
*/
c_all_masked_error = rb_define_class_under(c_paludis_module, "AllMaskedError", c_dep_list_error);
rb_define_method(c_all_masked_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
@@ -330,7 +330,7 @@ void paludis::ruby::init()
/*
* Document-class: Paludis::UseRequirementsNotMetError
*
- * Thrown if all versions of a particular atom are masked, but would not be if use requirements were not in effect.
+ * Thrown if all versions of a particular spec are masked, but would not be if use requirements were not in effect.
*/
c_use_requirements_not_met_error = rb_define_class_under(c_paludis_module, "UseRequirementsNotMetError", c_dep_list_error);
rb_define_method(c_use_requirements_not_met_error, "initialize", RUBY_FUNC_CAST(&has_query_property_error_init), -1);
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 8bfa0a2..f691c69 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -87,7 +87,7 @@ namespace paludis
VALUE repository_to_value(std::tr1::shared_ptr<Repository>);
VALUE version_spec_to_value(const VersionSpec &);
VALUE version_metadata_to_value(std::tr1::shared_ptr<const VersionMetadata>);
- VALUE dep_atom_to_value(std::tr1::shared_ptr<const DepAtom>);
+ VALUE dep_spec_to_value(std::tr1::shared_ptr<const DepSpec>);
VALUE qualified_package_name_to_value(const QualifiedPackageName &);
VALUE contents_to_value(std::tr1::shared_ptr<const Contents>);
VALUE contents_entry_to_value(std::tr1::shared_ptr<const ContentsEntry>);
@@ -96,8 +96,8 @@ namespace paludis
VersionSpec value_to_version_spec(VALUE v);
std::tr1::shared_ptr<const VersionMetadata> value_to_version_metadata(VALUE);
- std::tr1::shared_ptr<const PackageDepAtom> value_to_package_dep_atom(VALUE v);
- std::tr1::shared_ptr<const DepAtom> value_to_dep_atom(VALUE v);
+ std::tr1::shared_ptr<const PackageDepSpec> value_to_package_dep_spec(VALUE v);
+ std::tr1::shared_ptr<const DepSpec> value_to_dep_spec(VALUE v);
QualifiedPackageName value_to_qualified_package_name(VALUE v);
PackageDatabaseEntry value_to_package_database_entry(VALUE v);
EnvironmentData* value_to_environment_data(VALUE v);
diff --git a/ruby/paludis_ruby_TEST.rb b/ruby/paludis_ruby_TEST.rb
index 9268a03..d03d879 100644
--- a/ruby/paludis_ruby_TEST.rb
+++ b/ruby/paludis_ruby_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
@@ -38,26 +38,26 @@ module Paludis
def test_match
env = DefaultEnvironment.instance
- atom_good = PackageDepAtom.new('>=foo/bar-1')
- atom_bad = PackageDepAtom.new('>=foo/bar-2')
+ spec_good = PackageDepSpec.new('>=foo/bar-1')
+ spec_bad = PackageDepSpec.new('>=foo/bar-2')
pde = PackageDatabaseEntry.new('foo/bar','1','test')
- assert Paludis::match_package(env, atom_good, pde)
- assert !Paludis::match_package(env, atom_bad, pde)
+ assert Paludis::match_package(env, spec_good, pde)
+ assert !Paludis::match_package(env, spec_bad, pde)
end
def test_type_errors
env = DefaultEnvironment.instance
- atom = PackageDepAtom.new('>=foo/bar-1')
+ spec = PackageDepSpec.new('>=foo/bar-1')
pde = PackageDatabaseEntry.new('foo/bar','1','test')
assert_raise TypeError do
- Paludis::match_package(atom,atom,pde)
+ Paludis::match_package(spec,spec,pde)
end
assert_raise TypeError do
- Paludis::match_package(env,atom,atom)
+ Paludis::match_package(env,spec,spec)
end
end
end
diff --git a/ruby/portage_dep_parser.cc b/ruby/portage_dep_parser.cc
index bb1454f..7dddc2b 100644
--- a/ruby/portage_dep_parser.cc
+++ b/ruby/portage_dep_parser.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -32,10 +32,10 @@ namespace
/*
* call-seq:
- * PortageDepParser.parse(dep_string) -> CompositeDepAtom
- * PortageDepParser.parse(dep_string, atom_type, permit_any_deps) -> CompositeDepAtom
+ * PortageDepParser.parse(dep_string) -> CompositeDepSpec
+ * PortageDepParser.parse(dep_string, spec_type, permit_any_deps) -> CompositeDepSpec
*
- * Parse a given dependency string, and return an appropriate DepAtom tree.
+ * Parse a given dependency string, and return an appropriate DepSpec tree.
*/
VALUE
portage_dep_parser_parse(int argc, VALUE * args, VALUE)
@@ -43,7 +43,7 @@ namespace
try
{
if (1 == argc)
- return dep_atom_to_value(PortageDepParser::parse(StringValuePtr(args[0])));
+ return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(args[0])));
else if (3 == argc)
{
bool b(! (args[2] == Qnil || args[2] == Qfalse));
@@ -52,18 +52,18 @@ namespace
{
case 17:
if (b)
- return dep_atom_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
- PortageDepParserPolicy<PackageDepAtom, true>::get_instance()));
+ return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
+ PortageDepParserPolicy<PackageDepSpec, true>::get_instance()));
else
- return dep_atom_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
- PortageDepParserPolicy<PackageDepAtom, false>::get_instance()));
+ return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
+ PortageDepParserPolicy<PackageDepSpec, false>::get_instance()));
case 23:
if (b)
- return dep_atom_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
- PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance()));
+ return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
+ PortageDepParserPolicy<PlainTextDepSpec, true>::get_instance()));
else
- return dep_atom_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
- PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
+ return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(args[0]),
+ PortageDepParserPolicy<PlainTextDepSpec, false>::get_instance()));
}
rb_raise(rb_eArgError, "Bad value '%d' for PortageDepParser::parse parameter 2", NUM2INT(args[1]));
@@ -84,15 +84,15 @@ namespace
/*
* Document-class: Paludis::PortageDepParser
*
- * The PortageDepParser converts string representations of a dependency specification into a DepAtom instance.
+ * The PortageDepParser converts string representations of a dependency specification into a DepSpec instance.
*/
c_portage_dep_parser = rb_define_class_under(paludis_module(), "PortageDepParser", rb_cObject);
rb_funcall(c_portage_dep_parser, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_singleton_method(c_portage_dep_parser, "parse",
RUBY_FUNC_CAST(&portage_dep_parser_parse), -1);
- rb_define_const(c_portage_dep_parser, "PackageDepAtom", INT2FIX(17));
- rb_define_const(c_portage_dep_parser, "PlainTextDepAtom", INT2FIX(23));
+ rb_define_const(c_portage_dep_parser, "PackageDepSpec", INT2FIX(17));
+ rb_define_const(c_portage_dep_parser, "PlainTextDepSpec", INT2FIX(23));
}
}
diff --git a/ruby/portage_dep_parser_TEST.rb b/ruby/portage_dep_parser_TEST.rb
index 9c4c960..6488695 100644
--- a/ruby/portage_dep_parser_TEST.rb
+++ b/ruby/portage_dep_parser_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
@@ -24,54 +24,54 @@ require 'Paludis'
module Paludis
class TestCase_PortageDepParser < Test::Unit::TestCase
def test_one_arg
- atom = PortageDepParser::parse("foo/monkey")
- assert_kind_of AllDepAtom, atom
- assert_equal 1, atom.to_a.length
- assert_equal "foo/monkey", atom.to_a[0].to_s
- assert_kind_of PackageDepAtom, atom.to_a[0]
+ spec = PortageDepParser::parse("foo/monkey")
+ assert_kind_of AllDepSpec, spec
+ assert_equal 1, spec.to_a.length
+ assert_equal "foo/monkey", spec.to_a[0].to_s
+ assert_kind_of PackageDepSpec, spec.to_a[0]
end
def test_many_args
- atom = PortageDepParser::parse("foo/monkey", PortageDepParser::PlainTextDepAtom, false)
- assert_kind_of AllDepAtom, atom
- assert_equal 1, atom.to_a.length
- assert_equal "foo/monkey", atom.to_a[0].to_s
- assert_kind_of PlainTextDepAtom, atom.to_a[0]
+ spec = PortageDepParser::parse("foo/monkey", PortageDepParser::PlainTextDepSpec, false)
+ assert_kind_of AllDepSpec, spec
+ assert_equal 1, spec.to_a.length
+ assert_equal "foo/monkey", spec.to_a[0].to_s
+ assert_kind_of PlainTextDepSpec, spec.to_a[0]
- atom = PortageDepParser::parse("foo/monkey", PortageDepParser::PlainTextDepAtom, true)
- assert_kind_of AllDepAtom, atom
- assert_equal 1, atom.to_a.length
- assert_equal "foo/monkey", atom.to_a[0].to_s
- assert_kind_of PlainTextDepAtom, atom.to_a[0]
+ spec = PortageDepParser::parse("foo/monkey", PortageDepParser::PlainTextDepSpec, true)
+ assert_kind_of AllDepSpec, spec
+ assert_equal 1, spec.to_a.length
+ assert_equal "foo/monkey", spec.to_a[0].to_s
+ assert_kind_of PlainTextDepSpec, spec.to_a[0]
- atom = PortageDepParser::parse("foo/monkey", PortageDepParser::PackageDepAtom, false)
- assert_kind_of AllDepAtom, atom
- assert_equal 1, atom.to_a.length
- assert_equal "foo/monkey", atom.to_a[0].to_s
- assert_kind_of PackageDepAtom, atom.to_a[0]
+ spec = PortageDepParser::parse("foo/monkey", PortageDepParser::PackageDepSpec, false)
+ assert_kind_of AllDepSpec, spec
+ assert_equal 1, spec.to_a.length
+ assert_equal "foo/monkey", spec.to_a[0].to_s
+ assert_kind_of PackageDepSpec, spec.to_a[0]
- atom = PortageDepParser::parse("foo/monkey", PortageDepParser::PackageDepAtom, true)
- assert_kind_of AllDepAtom, atom
- assert_equal 1, atom.to_a.length
- assert_equal "foo/monkey", atom.to_a[0].to_s
- assert_kind_of PackageDepAtom, atom.to_a[0]
+ spec = PortageDepParser::parse("foo/monkey", PortageDepParser::PackageDepSpec, true)
+ assert_kind_of AllDepSpec, spec
+ assert_equal 1, spec.to_a.length
+ assert_equal "foo/monkey", spec.to_a[0].to_s
+ assert_kind_of PackageDepSpec, spec.to_a[0]
assert_raise DepStringParseError do
- PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PackageDepAtom, false)
+ PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PackageDepSpec, false)
end
- PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PackageDepAtom, true)
+ PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PackageDepSpec, true)
assert_raise DepStringParseError do
- PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PlainTextDepAtom, false)
+ PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PlainTextDepSpec, false)
end
- PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PlainTextDepAtom, true)
+ PortageDepParser::parse("|| ( foo/bar )", PortageDepParser::PlainTextDepSpec, true)
end
def test_dep_string_nesting_error
assert_raise DepStringNestingError do
- PortageDepParser::parse("|| ( foo/var ", PortageDepParser::PackageDepAtom,true)
+ PortageDepParser::parse("|| ( foo/var ", PortageDepParser::PackageDepSpec,true)
end
end
end
diff --git a/ruby/qualified_package_name_TEST.rb b/ruby/qualified_package_name_TEST.rb
index 7013362..1784b1c 100644
--- a/ruby/qualified_package_name_TEST.rb
+++ b/ruby/qualified_package_name_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
@@ -95,7 +95,7 @@ module Paludis
def test_to_value_type_error
assert_raise TypeError do
- QualifiedPackageName.new('foo-bar/baz') <=> PackageDepAtom.new('foo-bar/baz')
+ QualifiedPackageName.new('foo-bar/baz') <=> PackageDepSpec.new('foo-bar/baz')
end
end
end
diff --git a/ruby/query.cc b/ruby/query.cc
index d245a74..0710ebc 100644
--- a/ruby/query.cc
+++ b/ruby/query.cc
@@ -79,7 +79,7 @@ namespace
* call-seq:
* Matches.new(pda)
*
- * Create a new Matches Query object from the given PackageDepAtom.
+ * Create a new Matches Query object from the given PackageDepSpec.
*/
VALUE
matches_new(VALUE self, VALUE pda)
@@ -87,7 +87,7 @@ namespace
query::Matches * ptr(0);
try
{
- ptr = new query::Matches(*value_to_package_dep_atom(pda));
+ ptr = new query::Matches(*value_to_package_dep_spec(pda));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<query::Matches>::free, ptr));
rb_obj_call_init(tdata, 1, &pda);
return tdata;
@@ -186,7 +186,7 @@ namespace
/*
* Document-class: Paludis::Query::Matches
*
- * Query for packages that match a PackageDepAtom
+ * Query for packages that match a PackageDepSpec
*/
c_matches = rb_define_class_under(c_query_module, "Matches", c_query);
rb_define_singleton_method(c_matches, "new", RUBY_FUNC_CAST(&matches_new), 1);
diff --git a/ruby/query_TEST.rb b/ruby/query_TEST.rb
index 57cb303..e40306e 100644
--- a/ruby/query_TEST.rb
+++ b/ruby/query_TEST.rb
@@ -120,7 +120,7 @@ module Paludis
class TestCase_Matches < Test::Unit::TestCase
def get_query
- Query::Matches.new(PackageDepAtom.new('>=foo-bar/baz-1'))
+ Query::Matches.new(PackageDepSpec.new('>=foo-bar/baz-1'))
end
def test_create
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 17cb139..097ba4f 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
# Copyright (c) 2006, 2007 Richard Brown <mynamewasgone@gmail.com>
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -127,7 +127,7 @@ module Paludis
def test_has_version_error
assert_raise TypeError do
- repo.has_version?('foo/bar', PackageDepAtom.new('foo-bar/baz'))
+ repo.has_version?('foo/bar', PackageDepSpec.new('foo-bar/baz'))
end
end
end
diff --git a/ruby/version_metadata.cc b/ruby/version_metadata.cc
index e941b1a..f52f48e 100644
--- a/ruby/version_metadata.cc
+++ b/ruby/version_metadata.cc
@@ -111,7 +111,7 @@ namespace
* call-seq:
* license
*
- * Fetch our license, as a DepAtom structure, or Nil if we don't support
+ * Fetch our license, as a DepSpec structure, or Nil if we don't support
* license_interface.
*/
VALUE
@@ -120,7 +120,7 @@ namespace
std::tr1::shared_ptr<const VersionMetadata> * self_ptr;
Data_Get_Struct(self, std::tr1::shared_ptr<const VersionMetadata>, self_ptr);
if ((*self_ptr)->license_interface)
- return dep_atom_to_value((*self_ptr)->license_interface->license());
+ return dep_spec_to_value((*self_ptr)->license_interface->license());
else
return Qnil;
}
@@ -284,39 +284,39 @@ namespace
* Document-method: build_depend
*
* call-seq:
- * build_depend -> DepAtom
+ * build_depend -> DepSpec
*
- * Fetches build_depend information as a DepAtom, or Nil if we have no deps
+ * Fetches build_depend information as a DepSpec, or Nil if we have no deps
* interface.
*/
/*
* Document-method: run_depend
*
* call-seq:
- * run_depend -> DepAtom
+ * run_depend -> DepSpec
*
- * Fetches run_depend information as a DepAtom, or Nil if we have no deps
+ * Fetches run_depend information as a DepSpec, or Nil if we have no deps
* interface.
*/
/*
* Document-method: suggested_depend
*
* call-seq:
- * suggested_depend -> DepAtom
+ * suggested_depend -> DepSpec
*
- * Fetches sugest_depend information as a DepAtom, or Nil if we have no deps
+ * Fetches sugest_depend information as a DepSpec, or Nil if we have no deps
* interface.
*/
/*
* Document-method: post_depend
*
* call-seq:
- * post_depend -> DepAtom
+ * post_depend -> DepSpec
*
- * Fetches post_depend information as a DepAtom, or Nil if we have no deps
+ * Fetches post_depend information as a DepSpec, or Nil if we have no deps
* interface.
*/
- template <std::tr1::shared_ptr<const DepAtom> (VersionMetadataDepsInterface::* m_) () const>
+ template <std::tr1::shared_ptr<const DepSpec> (VersionMetadataDepsInterface::* m_) () const>
struct DependValue
{
static VALUE
@@ -325,7 +325,7 @@ namespace
std::tr1::shared_ptr<const VersionMetadata> * self_ptr;
Data_Get_Struct(self, std::tr1::shared_ptr<const VersionMetadata>, self_ptr);
if ((*self_ptr)->deps_interface)
- return dep_atom_to_value(((*self_ptr)->deps_interface->*m_)());
+ return dep_spec_to_value(((*self_ptr)->deps_interface->*m_)());
else
return Qnil;
}
diff --git a/ruby/version_metadata_TEST.rb b/ruby/version_metadata_TEST.rb
index 26e3ba0..61be0f9 100644
--- a/ruby/version_metadata_TEST.rb
+++ b/ruby/version_metadata_TEST.rb
@@ -54,7 +54,7 @@ module Paludis
end
def test_license
- assert_kind_of DepAtom, vmd("1.0").license
+ assert_kind_of DepSpec, vmd("1.0").license
end
def test_interfaces
@@ -80,10 +80,10 @@ module Paludis
end
def test_deps
- assert_kind_of AllDepAtom, vmd("1.0").build_depend
- assert_kind_of AllDepAtom, vmd("1.0").run_depend
- assert_kind_of AllDepAtom, vmd("1.0").suggested_depend
- assert_kind_of AllDepAtom, vmd("1.0").post_depend
+ assert_kind_of AllDepSpec, vmd("1.0").build_depend
+ assert_kind_of AllDepSpec, vmd("1.0").run_depend
+ assert_kind_of AllDepSpec, vmd("1.0").suggested_depend
+ assert_kind_of AllDepSpec, vmd("1.0").post_depend
assert_equal 1, vmd("1.0").build_depend.to_a.length
assert vmd("1.0").run_depend.to_a.empty?
diff --git a/src/clients/adjutrix/command_line.cc b/src/clients/adjutrix/command_line.cc
index 66340a7..4a902f6 100644
--- a/src/clients/adjutrix/command_line.cc
+++ b/src/clients/adjutrix/command_line.cc
@@ -38,7 +38,7 @@ CommandLine::CommandLine() :
a_keywords_graph(&tree_action_args,
"keyword-graph", 'k', "Display keywords graphically"),
a_reverse_deps(&tree_action_args,
- "reverse-deps", 'r', "Find all package that depend on a given dep atom"),
+ "reverse-deps", 'r', "Find all package that depend on a given dep spec"),
a_what_needs_keywording(&tree_action_args,
"what-needs-keywording", 'w', "Display what needs to be done to keyword a target"),
@@ -118,11 +118,11 @@ CommandLine::CommandLine() :
add_usage_line("--reverse-deps [ --repository-dir /path ] "
"[ --category app-misc --category sys-apps ... ] "
"[ --package foo --package fnord ... ]"
- "target-atom");
+ "target-spec");
add_usage_line("--what-needs-keywording [ --repository-dir /path ] "
"[ --category app-misc --category sys-apps ... ] "
"[ --package foo --package fnord ... ]"
- "target-keyword target-atom");
+ "target-keyword target-spec");
add_usage_line("--display-profiles-use [ --profile default-linux/x86/2006.0 "
"--profile default-linux/x86/2006.1 ... ] [ --repository-dir /path ]");
add_usage_line("--display-default-system-resolution [ --profile default-linux/x86/2006.0 "
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 5c45489..031face 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -135,7 +135,7 @@ namespace
std::map<QPNS, VersionSpec>::const_iterator a(after.find(b->first));
if (after.end() == a)
{
- if (! env.package_database()->query(query::Matches(PackageDepAtom(
+ if (! env.package_database()->query(query::Matches(PackageDepSpec(
stringify(b->first.name) + ":" + stringify(b->first.slot))),
qo_whatever)->empty())
{
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index add7acd..540fb5e 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -61,10 +61,10 @@ namespace
}
class ListInsecureVisitor :
- public DepAtomVisitorTypes::ConstVisitor,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AllDepAtom>,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AnyDepAtom>,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, UseDepAtom>
+ public DepSpecVisitorTypes::ConstVisitor,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AllDepSpec>,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AnyDepSpec>,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, UseDepSpec>
{
private:
const Environment & _env;
@@ -72,16 +72,16 @@ namespace
ArbitrarilyOrderedPackageDatabaseEntryCollectionComparator> _found;
public:
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AnyDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, UseDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, AnyDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ListInsecureVisitor, UseDepSpec>::visit;
ListInsecureVisitor(const Environment & e) :
_env(e)
{
}
- void visit(const PackageDepAtom * const a)
+ void visit(const PackageDepSpec * const a)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> insecure(
_env.package_database()->query(query::Matches(*a), qo_order_by_version));
@@ -93,11 +93,11 @@ namespace
throw InternalError(PALUDIS_HERE, "didn't get a tag");
}
- void visit(const PlainTextDepAtom * const)
+ void visit(const PlainTextDepSpec * const)
{
}
- void visit(const BlockDepAtom * const)
+ void visit(const BlockDepSpec * const)
{
}
@@ -146,7 +146,7 @@ void do_find_insecure_packages(const Environment & env)
write_repository_header(r->name());
- std::tr1::shared_ptr<const DepAtom> all_insecure(r->sets_interface->package_set(SetName("insecurity")));
+ std::tr1::shared_ptr<const DepSpec> all_insecure(r->sets_interface->package_set(SetName("insecurity")));
if (! all_insecure)
continue;
ListInsecureVisitor v(env);
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index a280059..0d5c5a1 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -41,8 +41,8 @@ using std::endl;
namespace
{
class ReverseDepChecker :
- public DepAtomVisitorTypes::ConstVisitor,
- public DepAtomVisitorTypes::ConstVisitor::VisitChildren<ReverseDepChecker, AllDepAtom>
+ public DepSpecVisitorTypes::ConstVisitor,
+ public DepSpecVisitorTypes::ConstVisitor::VisitChildren<ReverseDepChecker, AllDepSpec>
{
private:
std::tr1::shared_ptr<const PackageDatabase> _db;
@@ -57,7 +57,7 @@ namespace
bool _found_matches;
public:
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ReverseDepChecker, AllDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<ReverseDepChecker, AllDepSpec>::visit;
ReverseDepChecker(std::tr1::shared_ptr<const PackageDatabase> db,
const PackageDatabaseEntryCollection & entries,
@@ -72,10 +72,10 @@ namespace
{
}
- void check(std::tr1::shared_ptr<const DepAtom> atom, const std::string & depname)
+ void check(std::tr1::shared_ptr<const DepSpec> spec, const std::string & depname)
{
_depname = depname;
- atom->accept(this);
+ spec->accept(this);
}
bool found_matches()
@@ -83,19 +83,19 @@ namespace
return _found_matches;
}
- void visit(const AnyDepAtom * const);
+ void visit(const AnyDepSpec * const);
- void visit(const UseDepAtom * const);
+ void visit(const UseDepSpec * const);
- void visit(const PackageDepAtom * const);
+ void visit(const PackageDepSpec * const);
- void visit(const PlainTextDepAtom * const);
+ void visit(const PlainTextDepSpec * const);
- void visit(const BlockDepAtom * const);
+ void visit(const BlockDepSpec * const);
};
void
- ReverseDepChecker::visit(const AnyDepAtom * const a)
+ ReverseDepChecker::visit(const AnyDepSpec * const a)
{
Save<bool> in_any_save(&_in_any, true);
@@ -103,7 +103,7 @@ namespace
}
void
- ReverseDepChecker::visit(const UseDepAtom * const a)
+ ReverseDepChecker::visit(const UseDepSpec * const a)
{
Save<bool> in_use_save(&_in_use, true);
Save<std::string> flag_save(&_flags);
@@ -116,7 +116,7 @@ namespace
}
void
- ReverseDepChecker::visit(const PackageDepAtom * const a)
+ ReverseDepChecker::visit(const PackageDepSpec * const a)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> dep_entries(_db->query(
query::Matches(*a), qo_order_by_version));
@@ -159,18 +159,18 @@ namespace
}
void
- ReverseDepChecker::visit(const PlainTextDepAtom * const)
+ ReverseDepChecker::visit(const PlainTextDepSpec * const)
{
}
void
- ReverseDepChecker::visit(const BlockDepAtom * const)
+ ReverseDepChecker::visit(const BlockDepSpec * const)
{
}
- void write_repository_header(std::string atom, const std::string &)
+ void write_repository_header(std::string spec, const std::string &)
{
- cout << "Reverse dependencies for '" << atom << "':" << std::endl;
+ cout << "Reverse dependencies for '" << spec << "':" << std::endl;
}
int check_one_package(const Environment & env, const Repository & r,
@@ -219,16 +219,16 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
{
Context context("When performing find-reverse-deps action:");
- std::tr1::shared_ptr<PackageDepAtom> atom;
+ std::tr1::shared_ptr<PackageDepSpec> spec;
try
{
if (std::string::npos == CommandLine::get_instance()->begin_parameters()->find('/'))
{
- atom.reset(new PackageDepAtom(env.package_database()->fetch_unique_qualified_package_name(
+ spec.reset(new PackageDepSpec(env.package_database()->fetch_unique_qualified_package_name(
PackageNamePart(*CommandLine::get_instance()->begin_parameters()))));
}
else
- atom.reset(new PackageDepAtom(*CommandLine::get_instance()->begin_parameters()));
+ spec.reset(new PackageDepSpec(*CommandLine::get_instance()->begin_parameters()));
}
catch (const AmbiguousPackageNameError & e)
{
@@ -244,13 +244,13 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
}
std::tr1::shared_ptr<PackageDatabaseEntryCollection> entries(env.package_database()->query(
- query::Matches(*atom), qo_order_by_version));
+ query::Matches(*spec), qo_order_by_version));
int ret(0);
if (entries->empty())
{
Log::get_instance()->message(ll_warning, lc_context, "No matches in package database for '"
- + stringify(*atom) + "'");
+ + stringify(*spec) + "'");
return 1;
}
@@ -261,7 +261,7 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
if (r->name() == RepositoryName("virtuals") || r->name() == RepositoryName("installed_virtuals"))
continue;
- write_repository_header(stringify(*atom), stringify(r->name()));
+ write_repository_header(stringify(*spec), stringify(r->name()));
std::tr1::shared_ptr<const CategoryNamePartCollection> cat_names(r->category_names());
for (CategoryNamePartCollection::Iterator c(cat_names->begin()), c_end(cat_names->end()) ;
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index d0abe33..47ccd5e 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -64,7 +64,7 @@ namespace
std::tr1::shared_ptr<const VersionSpecCollection> versions(repo.version_specs(package));
FindUnusedPackagesTask task(&e, &repo);
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> packages(e.package_database()->query(
- query::Matches(PackageDepAtom(stringify(package) + "::" + stringify(repo.name()))),
+ query::Matches(PackageDepSpec(stringify(package) + "::" + stringify(repo.name()))),
qo_group_by_slot));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> unused(task.execute(package));
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 8d93477..98356ca 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -74,11 +74,11 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
p_end(CommandLine::get_instance()->end_parameters()) ; p != p_end ; ++p)
{
if (std::string::npos == p->find('/'))
- d.add(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(
+ d.add(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(
env.package_database()->fetch_unique_qualified_package_name(PackageNamePart(*p)))),
env.default_destinations());
else
- d.add(std::tr1::shared_ptr<PackageDepAtom>(new PackageDepAtom(*p)),
+ d.add(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(*p)),
env.default_destinations());
}
diff --git a/src/clients/contrarius/contrarius_stage_options.sr b/src/clients/contrarius/contrarius_stage_options.sr
index daeb3ed..ecc9f97 100644
--- a/src/clients/contrarius/contrarius_stage_options.sr
+++ b/src/clients/contrarius/contrarius_stage_options.sr
@@ -5,10 +5,10 @@ make_class_ContrariusStageOptions()
{
key target HostTupleName
- key binutils "std::tr1::shared_ptr<const PackageDepAtom>"
- key gcc "std::tr1::shared_ptr<const PackageDepAtom>"
- key headers "std::tr1::shared_ptr<const PackageDepAtom>"
- key libc "std::tr1::shared_ptr<const PackageDepAtom>"
+ key binutils "std::tr1::shared_ptr<const PackageDepSpec>"
+ key gcc "std::tr1::shared_ptr<const PackageDepSpec>"
+ key headers "std::tr1::shared_ptr<const PackageDepSpec>"
+ key libc "std::tr1::shared_ptr<const PackageDepSpec>"
extra_constructors <<END
ContrariusStageOptions(const HostTupleName & target,
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 0d09fef..a910a7d 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -180,7 +180,7 @@ namespace
}
int
-do_install(std::tr1::shared_ptr<const PackageDepAtom> atom)
+do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
{
int return_code(0);
@@ -217,7 +217,7 @@ do_install(std::tr1::shared_ptr<const PackageDepAtom> atom)
try
{
- task.add_target(stringify(*atom));
+ task.add_target(stringify(*spec));
task.execute();
@@ -272,7 +272,7 @@ do_install(std::tr1::shared_ptr<const PackageDepAtom> atom)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(PackageDepAtom(e.query())) & query::RepositoryHasUninstallableInterface(),
+ query::Matches(PackageDepSpec(e.query())) & query::RepositoryHasUninstallableInterface(),
qo_order_by_version));
if (p->empty())
diff --git a/src/clients/contrarius/install.hh b/src/clients/contrarius/install.hh
index fbd8eb9..623037d 100644
--- a/src/clients/contrarius/install.hh
+++ b/src/clients/contrarius/install.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_SRC_DEPGRAPH_HH
#define PALUDIS_GUARD_SRC_DEPGRAPH_HH 1
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include "command_line.hh"
@@ -29,6 +29,6 @@
*/
/// Handle --install.
-int do_install(std::tr1::shared_ptr<const paludis::PackageDepAtom> atom);
+int do_install(std::tr1::shared_ptr<const paludis::PackageDepSpec> spec);
#endif
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 64317f1..8bd4c41 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -30,12 +30,12 @@ using namespace paludis;
namespace
{
- const PackageDepAtom * make_atom(const HostTupleName & target,
+ const PackageDepSpec * make_spec(const HostTupleName & target,
const std::string & name,
const std::string & default_name,
const std::string & version)
{
- return new PackageDepAtom(std::string(version.empty() ? "" : "=") + "cross-" + stringify(target) + "/"
+ return new PackageDepSpec(std::string(version.empty() ? "" : "=") + "cross-" + stringify(target) + "/"
+ (name.empty() ? default_name : name) + (version.empty() ? "" : "-" + version));
}
}
@@ -52,10 +52,10 @@ ContrariusStageOptions::ContrariusStageOptions(const HostTupleName & _target,
const std::string & libc_name,
const std::string & libc_version) :
target(_target),
- binutils(::make_atom(target, binutils_name, "binutils", binutils_version)),
- gcc(::make_atom(target, gcc_name, "gcc", gcc_version)),
- headers(::make_atom(target, headers_name, "linux-headers", headers_version)),
- libc(::make_atom(target, libc_name, "glibc", libc_version))
+ binutils(::make_spec(target, binutils_name, "binutils", binutils_version)),
+ gcc(::make_spec(target, gcc_name, "gcc", gcc_version)),
+ headers(::make_spec(target, headers_name, "linux-headers", headers_version)),
+ libc(::make_spec(target, libc_name, "glibc", libc_version))
{
}
diff --git a/src/clients/contrarius/stage.hh b/src/clients/contrarius/stage.hh
index 8ab817d..ef8497d 100644
--- a/src/clients/contrarius/stage.hh
+++ b/src/clients/contrarius/stage.hh
@@ -22,7 +22,7 @@
#include <paludis/name.hh>
#include <paludis/host_tuple_name.hh>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/tasks/stage_builder_task.hh>
#include <string>
diff --git a/src/clients/gtkpaludis/install.cc b/src/clients/gtkpaludis/install.cc
index 5541545..8fe0e4f 100644
--- a/src/clients/gtkpaludis/install.cc
+++ b/src/clients/gtkpaludis/install.cc
@@ -164,7 +164,7 @@ OurInstallTask::on_update_world_pre()
}
void
-OurInstallTask::on_update_world(const PackageDepAtom &)
+OurInstallTask::on_update_world(const PackageDepSpec &)
{
}
@@ -174,7 +174,7 @@ OurInstallTask::on_update_world(const SetName &)
}
void
-OurInstallTask::on_update_world_skip(const PackageDepAtom &, const std::string &)
+OurInstallTask::on_update_world_skip(const PackageDepSpec &, const std::string &)
{
}
diff --git a/src/clients/gtkpaludis/install.hh b/src/clients/gtkpaludis/install.hh
index 23e3b48..72aaea8 100644
--- a/src/clients/gtkpaludis/install.hh
+++ b/src/clients/gtkpaludis/install.hh
@@ -62,8 +62,8 @@ namespace gtkpaludis
const paludis::PackageDatabaseEntryCollection &);
virtual void on_update_world_pre();
- virtual void on_update_world(const paludis::PackageDepAtom &);
- virtual void on_update_world_skip(const paludis::PackageDepAtom &, const std::string &);
+ virtual void on_update_world(const paludis::PackageDepSpec &);
+ virtual void on_update_world_skip(const paludis::PackageDepSpec &, const std::string &);
virtual void on_update_world(const paludis::SetName &);
virtual void on_update_world_skip(const paludis::SetName &, const std::string &);
virtual void on_update_world_post();
diff --git a/src/clients/gtkpaludis/package_overview.cc b/src/clients/gtkpaludis/package_overview.cc
index 8e743f9..205ab6c 100644
--- a/src/clients/gtkpaludis/package_overview.cc
+++ b/src/clients/gtkpaludis/package_overview.cc
@@ -164,12 +164,12 @@ namespace
versions_row[_imp->columns.col_left] = "Versions";
versions_row[_imp->columns.col_right] = "";
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(stringify(_pkg)));
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(stringify(_pkg)));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
entries(DefaultEnvironment::get_instance()->package_database()->query(
- *atom, is_any, qo_order_by_version)),
+ *spec, is_any, qo_order_by_version)),
preferred_entries(DefaultEnvironment::get_instance()->package_database()->query(
- *atom, is_installed_only, qo_order_by_version));
+ *spec, is_installed_only, qo_order_by_version));
if (preferred_entries->empty())
preferred_entries = entries;
diff --git a/src/clients/gtkpaludis/packages_list.cc b/src/clients/gtkpaludis/packages_list.cc
index c4a3869..0fabfec 100644
--- a/src/clients/gtkpaludis/packages_list.cc
+++ b/src/clients/gtkpaludis/packages_list.cc
@@ -159,12 +159,12 @@ namespace
bool is_installed(true);
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> results(DefaultEnvironment::get_instance()->package_database()->query(
- PackageDepAtom(i->first), is_installed_only, qo_order_by_version));
+ PackageDepSpec(i->first), is_installed_only, qo_order_by_version));
if (results->empty())
{
is_installed = false;
results = DefaultEnvironment::get_instance()->package_database()->query(
- PackageDepAtom(i->first), is_any, qo_order_by_version);
+ PackageDepSpec(i->first), is_any, qo_order_by_version);
}
if (results->empty())
continue;
diff --git a/src/clients/gtkpaludis/queue_list.cc b/src/clients/gtkpaludis/queue_list.cc
index 630ecc5..d00744f 100644
--- a/src/clients/gtkpaludis/queue_list.cc
+++ b/src/clients/gtkpaludis/queue_list.cc
@@ -337,7 +337,7 @@ QueueList::Populate::display_entry(const paludis::DepListEntry & e)
row[_q->_imp->columns.col_left] = left;
std::tr1::shared_ptr<PackageDatabaseEntryCollection> existing(DefaultEnvironment::get_instance()->package_database()->
- query(PackageDepAtom(e.package.name), is_installed_only, qo_order_by_version));
+ query(PackageDepSpec(e.package.name), is_installed_only, qo_order_by_version));
std::string right = stringify(e.package.version);
@@ -345,7 +345,7 @@ QueueList::Populate::display_entry(const paludis::DepListEntry & e)
right.append(" [N]");
else
{
- existing = DefaultEnvironment::get_instance()->package_database()->query(PackageDepAtom(
+ existing = DefaultEnvironment::get_instance()->package_database()->query(PackageDepSpec(
stringify(e.package.name) + ":" + stringify(e.metadata->slot)),
is_installed_only, qo_order_by_version);
if (existing->empty())
diff --git a/src/clients/gtkpaludis/set_overview.cc b/src/clients/gtkpaludis/set_overview.cc
index f12cfb2..7fee62a 100644
--- a/src/clients/gtkpaludis/set_overview.cc
+++ b/src/clients/gtkpaludis/set_overview.cc
@@ -35,12 +35,12 @@ namespace
public Gtk::TreeModel::ColumnRecord
{
public:
- Gtk::TreeModelColumn<Glib::ustring> col_atom;
+ Gtk::TreeModelColumn<Glib::ustring> col_spec;
Gtk::TreeModelColumn<Glib::ustring> col_tag;
Columns()
{
- add(col_atom);
+ add(col_spec);
add(col_tag);
}
};
@@ -65,9 +65,9 @@ namespace
}
};
- class TreeFromDepAtom :
- private InstantiationPolicy<TreeFromDepAtom, instantiation_method::NonCopyableTag>,
- public DepAtomVisitorTypes::ConstVisitor
+ class TreeFromDepSpec :
+ private InstantiationPolicy<TreeFromDepSpec, instantiation_method::NonCopyableTag>,
+ public DepSpecVisitorTypes::ConstVisitor
{
private:
Glib::RefPtr<Gtk::TreeStore> _model;
@@ -75,7 +75,7 @@ namespace
Gtk::TreeModel::Row * _row;
public:
- TreeFromDepAtom(Glib::RefPtr<Gtk::TreeStore> model, const Columns * const columns,
+ TreeFromDepSpec(Glib::RefPtr<Gtk::TreeStore> model, const Columns * const columns,
Gtk::TreeModel::Row * top_row) :
_model(model),
_columns(columns),
@@ -83,59 +83,59 @@ namespace
{
}
- void visit(const AllDepAtom * atom)
+ void visit(const AllDepSpec * spec)
{
- if (atom->begin() != atom->end())
+ if (spec->begin() != spec->end())
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = "all of";
+ new_row[_columns->col_spec] = "all of";
Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(atom->begin(), atom->end(), accept_visitor(this));
+ std::for_each(spec->begin(), spec->end(), accept_visitor(this));
}
}
- void visit(const AnyDepAtom * atom)
+ void visit(const AnyDepSpec * spec)
{
- if (atom->begin() != atom->end())
+ if (spec->begin() != spec->end())
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = "any of";
+ new_row[_columns->col_spec] = "any of";
Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(atom->begin(), atom->end(), accept_visitor(this));
+ std::for_each(spec->begin(), spec->end(), accept_visitor(this));
}
}
- void visit(const UseDepAtom * atom)
+ void visit(const UseDepSpec * spec)
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = "if " + stringify(atom->inverse() ? "!" : "") + stringify(atom->flag());
+ new_row[_columns->col_spec] = "if " + stringify(spec->inverse() ? "!" : "") + stringify(spec->flag());
Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(atom->begin(), atom->end(), accept_visitor(this));
+ std::for_each(spec->begin(), spec->end(), accept_visitor(this));
}
- void visit(const PlainTextDepAtom * atom)
+ void visit(const PlainTextDepSpec * spec)
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = atom->text();
+ new_row[_columns->col_spec] = spec->text();
}
- void visit(const PackageDepAtom * atom)
+ void visit(const PackageDepSpec * spec)
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = stringify(*atom);
+ new_row[_columns->col_spec] = stringify(*spec);
- if (atom->tag())
+ if (spec->tag())
{
TagDecoder d;
- atom->tag()->accept(&d);
+ spec->tag()->accept(&d);
new_row[_columns->col_tag] = d.text;
}
}
- void visit(const BlockDepAtom * atom)
+ void visit(const BlockDepSpec * spec)
{
Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_atom] = "!" + stringify(*atom->blocked_atom());
+ new_row[_columns->col_spec] = "!" + stringify(*spec->blocked_spec());
}
};
}
@@ -169,7 +169,7 @@ SetOverview::SetOverview() :
PrivateImplementationPattern<SetOverview>(new Implementation<SetOverview>(this))
{
set_model(_imp->model);
- append_column("Atom", _imp->columns.col_atom);
+ append_column("Atom", _imp->columns.col_spec);
append_column("Tag", _imp->columns.col_tag);
}
@@ -203,11 +203,11 @@ namespace
StatusBarMessage m1(this, "Querying set information...");
- std::tr1::shared_ptr<const DepAtom> set_atom(DefaultEnvironment::get_instance()->package_set(_set));
+ std::tr1::shared_ptr<const DepSpec> set_spec(DefaultEnvironment::get_instance()->package_set(_set));
Gtk::TreeModel::Row top_row = *model->append();
- top_row[_imp->columns.col_atom] = stringify(_set);
- TreeFromDepAtom v(model, &_imp->columns, &top_row);
- set_atom->accept(&v);
+ top_row[_imp->columns.col_spec] = stringify(_set);
+ TreeFromDepSpec v(model, &_imp->columns, &top_row);
+ set_spec->accept(&v);
dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<SetOverview>::set_model), model));
}
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index 8fa6f91..70a7156 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -122,7 +122,7 @@ do_search(const Environment & env)
continue;
InquisitioQueryTask query(&env);
- query.show(PackageDepAtom(display_entry.name), &display_entry);
+ query.show(PackageDepSpec(display_entry.name), &display_entry);
}
return 0;
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 6499563..c4cf0af 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -49,9 +49,9 @@ int do_has_version()
Environment * const env(DefaultEnvironment::get_instance());
std::string query(*CommandLine::get_instance()->begin_parameters());
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(query));
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries(env->package_database()->query(
- query::Matches(*atom) & query::InstalledAtRoot(env->root()), qo_whatever));
+ query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_whatever));
if (entries->empty())
return_code = 1;
@@ -67,9 +67,9 @@ int do_best_version()
Environment * const env(DefaultEnvironment::get_instance());
std::string query(*CommandLine::get_instance()->begin_parameters());
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(query));
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries(env->package_database()->query(
- query::Matches(*atom) & query::InstalledAtRoot(env->root()), qo_order_by_version));
+ query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
/* make built_with_use work for virtuals... icky... */
while (! entries->empty())
@@ -111,18 +111,18 @@ int do_environment_variable()
Context context("When performing environment-variable action from command line:");
Environment * const env(DefaultEnvironment::get_instance());
- std::string atom_str(*CommandLine::get_instance()->begin_parameters());
+ std::string spec_str(*CommandLine::get_instance()->begin_parameters());
std::string var_str(* next(CommandLine::get_instance()->begin_parameters()));
- std::tr1::shared_ptr<PackageDepAtom> atom(new PackageDepAtom(atom_str));
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(spec_str));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries(env->package_database()->query(
- query::Matches(*atom) & query::InstalledAtRoot(env->root()), qo_order_by_version));
+ query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
if (entries->empty())
- entries = env->package_database()->query(query::Matches(*atom), qo_order_by_version);
+ entries = env->package_database()->query(query::Matches(*spec), qo_order_by_version);
if (entries->empty())
- throw NoSuchPackageError(atom_str);
+ throw NoSuchPackageError(spec_str);
std::tr1::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(
entries->begin()->repository));
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index 243284f..6606010 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -42,8 +42,8 @@ CommandLine::CommandLine() :
action_args_internal(this, "More actions",
"Additional actions, mostly for script and internal use."),
- a_has_version(&action_args_internal, "has-version", '\0', "Check whether the specified atom is installed"),
- a_best_version(&action_args_internal, "best-version", '\0', "Display the best version of the specified atom"),
+ a_has_version(&action_args_internal, "has-version", '\0', "Check whether the specified spec is installed"),
+ a_best_version(&action_args_internal, "best-version", '\0', "Display the best version of the specified spec"),
a_environment_variable(&action_args_internal, "environment-variable", '\0', "Display the value of an environment "
"variable for a particular package"),
a_configuration_variable(&action_args_internal, "configuration-variable", '\0', "Display the value of a "
@@ -80,8 +80,8 @@ CommandLine::CommandLine() :
a_pretend(&install_args, "pretend", 'p', "Pretend only"),
a_destinations(&install_args, "destinations", 'd', "Use specified destinations instead of defaults"),
a_preserve_world(&install_args, "preserve-world", '1', "Don't modify the world file"),
- a_add_to_world_atom(&install_args, "add-to-world-atom", '\0',
- "Use this atom, rather than all targets, for updating world (for resume commands)"),
+ a_add_to_world_spec(&install_args, "add-to-world-spec", '\0',
+ "Use this spec, rather than all targets, for updating world (for resume commands)"),
a_no_config_protection(&install_args, "no-config-protection", '\0', "Disable config file protection (dangerous)"),
a_debug_build(&install_args, "debug-build", '\0'),
a_fetch(&install_args, "fetch", 'f', "Only fetch sources; don't install anything"),
@@ -226,7 +226,9 @@ CommandLine::CommandLine() :
a_dl_ignore_installed(&deprecated_args, "dl-ignore-installed", 'e',
"Replaced by --dl-reinstall always"),
a_show_install_reasons(&deprecated_args, "show-install-reasons",
- '\0', "Replaced by --show-reasons")
+ '\0', "Replaced by --show-reasons"),
+ a_add_to_world_atom(&deprecated_args, "add-to-world-atom", '\0',
+ "Repoaced by --add-to-world-spec")
{
add_usage_line("--query [query options] target ...");
add_usage_line("--install [install options] target ...");
@@ -238,9 +240,9 @@ CommandLine::CommandLine() :
add_usage_line("--info");
add_usage_line("--help");
- add_usage_line("--has-version atom");
- add_usage_line("--best-version atom");
- add_usage_line("--environment-variable atom variable");
+ add_usage_line("--has-version spec");
+ add_usage_line("--best-version spec");
+ add_usage_line("--environment-variable spec variable");
add_usage_line("--configuration-variable repository variable");
add_usage_line("--list-repositories [--repository repo1 --repository repo2 ...]");
add_usage_line("--list-categories [--repository repo1 ... --category cat1 --category cat2 ...]");
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index 13a35ca..21c6b81 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -197,8 +197,8 @@ class CommandLine :
/// --preserve-world
paludis::args::SwitchArg a_preserve_world;
- /// --add-to-world-atom
- paludis::args::StringArg a_add_to_world_atom;
+ /// --add-to-world-spec
+ paludis::args::StringArg a_add_to_world_spec;
/// --no-config-protection
paludis::args::SwitchArg a_no_config_protection;
@@ -311,6 +311,7 @@ class CommandLine :
paludis::args::SwitchArg a_dl_drop_all;
paludis::args::SwitchArg a_dl_ignore_installed;
paludis::args::StringArg a_show_install_reasons;
+ paludis::args::StringArg a_add_to_world_atom;
///\}
};
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index 0535b41..e973376 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -72,15 +72,15 @@ namespace
{
Context local_context("When handling query '" + target + "':");
- /* we might have a dep atom, but we might just have a simple package name
+ /* we might have a dep spec, but we might just have a simple package name
* without a category. either should work. */
- std::tr1::shared_ptr<PackageDepAtom> atom(std::string::npos == target.find('/') ?
- new PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
+ std::tr1::shared_ptr<PackageDepSpec> spec(std::string::npos == target.find('/') ?
+ new PackageDepSpec(env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(target))) :
- new PackageDepAtom(target));
+ new PackageDepSpec(target));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
- entries(env->package_database()->query(query::Matches(*atom) & query::InstalledAtRoot(env->root()), qo_order_by_version));
+ entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
if (entries->empty())
throw NoSuchPackageError(target);
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index 6810d7b..62d34ec 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -97,15 +97,15 @@ do_one_contents(
{
Context local_context("When handling query '" + q + "':");
- /* we might have a dep atom, but we might just have a simple package name
+ /* we might have a dep spec, but we might just have a simple package name
* without a category. either should work. */
- std::tr1::shared_ptr<PackageDepAtom> atom(std::string::npos == q.find('/') ?
- new PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
+ std::tr1::shared_ptr<PackageDepSpec> spec(std::string::npos == q.find('/') ?
+ new PackageDepSpec(env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(q))) :
- new PackageDepAtom(q));
+ new PackageDepSpec(q));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
- entries(env->package_database()->query(query::Matches(*atom) & query::InstalledAtRoot(
+ entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(
env->root()), qo_order_by_version));
if (entries->empty())
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index f5f00b2..7f711dc 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -77,14 +77,14 @@ namespace
+ stringify(i->package.version) + "::"
+ stringify(i->package.repository) + "'";
- if (CommandLine::get_instance()->a_add_to_world_atom.specified())
- resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_atom.long_name()
- + " '" + CommandLine::get_instance()->a_add_to_world_atom.argument() + "'";
+ if (CommandLine::get_instance()->a_add_to_world_spec.specified())
+ resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_spec.long_name()
+ + " '" + CommandLine::get_instance()->a_add_to_world_spec.argument() + "'";
else if (task.had_set_targets())
- resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_atom.long_name()
+ resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_spec.long_name()
+ " '( )'";
else
- resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_atom.long_name()
+ resume_command = resume_command + " --" + CommandLine::get_instance()->a_add_to_world_spec.long_name()
+ " '( " + join(task.begin_targets(), task.end_targets(), " ") + " )'";
if (CommandLine::get_instance()->a_destinations.specified())
@@ -503,8 +503,8 @@ do_install()
task.set_preserve_world(CommandLine::get_instance()->a_preserve_world.specified());
task.set_safe_resume(CommandLine::get_instance()->a_safe_resume.specified());
- if (CommandLine::get_instance()->a_add_to_world_atom.specified())
- task.set_add_to_world_atom(CommandLine::get_instance()->a_add_to_world_atom.argument());
+ if (CommandLine::get_instance()->a_add_to_world_spec.specified())
+ task.set_add_to_world_spec(CommandLine::get_instance()->a_add_to_world_spec.argument());
if (CommandLine::get_instance()->a_debug_build.specified())
task.set_debug_mode(CommandLine::get_instance()->a_debug_build.option());
@@ -576,7 +576,7 @@ do_install()
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(PackageDepAtom(e.query())) & query::RepositoryHasInstalledInterface(),
+ query::Matches(PackageDepSpec(e.query())) & query::RepositoryHasInstalledInterface(),
qo_order_by_version));
if (p->empty())
{
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index 0bea7b9..fe28f7e 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -196,6 +196,14 @@ main(int argc, char *argv[])
CommandLine::get_instance()->a_show_reasons.set_specified(true);
}
+ if (CommandLine::get_instance()->a_add_to_world_atom.specified())
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context, "--add-to-world-atom is deprecated, use --add-to-world-spec");
+ CommandLine::get_instance()->a_add_to_world_spec.set_argument(
+ CommandLine::get_instance()->a_add_to_world_atom.argument());
+ CommandLine::get_instance()->a_add_to_world_spec.set_specified(true);
+ }
+
/* need an action */
if (1 != (CommandLine::get_instance()->a_query.specified() +
CommandLine::get_instance()->a_version.specified() +
@@ -464,7 +472,7 @@ main(int argc, char *argv[])
{
if (2 != std::distance(CommandLine::get_instance()->begin_parameters(),
CommandLine::get_instance()->end_parameters()))
- throw args::DoHelp("environment-variable action takes exactly two parameters (depatom var)");
+ throw args::DoHelp("environment-variable action takes exactly two parameters (depspec var)");
return do_environment_variable();
}
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 0ab183f..3d6e797 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -65,10 +65,10 @@ namespace
void do_one_package_query(
const Environment * const env,
MaskReasons & mask_reasons_to_explain,
- std::tr1::shared_ptr<PackageDepAtom> atom)
+ std::tr1::shared_ptr<PackageDepSpec> spec)
{
QueryTask query(env);
- query.show(*atom);
+ query.show(*spec);
mask_reasons_to_explain |= query.mask_reasons_to_explain();
cout << endl;
}
@@ -77,10 +77,10 @@ void do_one_set_query(
const Environment * const,
const std::string & q,
MaskReasons &,
- std::tr1::shared_ptr<DepAtom> set)
+ std::tr1::shared_ptr<DepSpec> set)
{
cout << "* " << colour(cl_package_name, q) << endl;
- DepAtomPrettyPrinter packages(12);
+ DepSpecPrettyPrinter packages(12);
set->accept(&packages);
cout << " " << std::setw(22) << std::left << "Packages:" << std::setw(0)
<< endl << packages << endl;
@@ -93,10 +93,10 @@ void do_one_query(
{
Context local_context("When handling query '" + q + "':");
- /* we might have a dep atom, but we might just have a simple package name
+ /* we might have a dep spec, but we might just have a simple package name
* without a category. or it might be a set... all should work. */
- std::tr1::shared_ptr<PackageDepAtom> atom;
- std::tr1::shared_ptr<DepAtom> set;
+ std::tr1::shared_ptr<PackageDepSpec> spec;
+ std::tr1::shared_ptr<DepSpec> set;
if (std::string::npos == q.find('/'))
{
try
@@ -107,14 +107,14 @@ void do_one_query(
{
}
if (0 == set)
- atom.reset(new PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
+ spec.reset(new PackageDepSpec(env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(q))));
}
else
- atom.reset(new PackageDepAtom(q));
+ spec.reset(new PackageDepSpec(q));
- if (atom)
- do_one_package_query(env, mask_reasons_to_explain, atom);
+ if (spec)
+ do_one_package_query(env, mask_reasons_to_explain, spec);
else
do_one_set_query(env, q, mask_reasons_to_explain, set);
}
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index 3f29efd..13ad0d5 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -152,7 +152,7 @@ namespace
cout << endl << colour(cl_heading, "Updating world file") << endl << endl;
}
- virtual void on_update_world(const PackageDepAtom & a)
+ virtual void on_update_world(const PackageDepSpec & a)
{
cout << "* removing " << colour(cl_package_name, a.package()) << endl;
}
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index b37b181..7cae724 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -210,10 +210,10 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
repo = "::" + stringify((d.destinations->begin()->destination)->name());
std::tr1::shared_ptr<PackageDatabaseEntryCollection> existing_repo(environment()->package_database()->
- query(query::Matches(PackageDepAtom(stringify(d.package.name) + repo)), qo_order_by_version));
+ query(query::Matches(PackageDepSpec(stringify(d.package.name) + repo)), qo_order_by_version));
std::tr1::shared_ptr<PackageDatabaseEntryCollection> existing_slot_repo(environment()->package_database()->
- query(query::Matches(PackageDepAtom(stringify(d.package.name) + ":" + stringify(d.metadata->slot) + repo)),
+ query(query::Matches(PackageDepSpec(stringify(d.package.name) + ":" + stringify(d.metadata->slot) + repo)),
qo_order_by_version));
display_merge_list_entry_start(d, m);
@@ -292,7 +292,7 @@ ConsoleInstallTask::on_update_world_pre()
}
void
-ConsoleInstallTask::on_update_world(const PackageDepAtom & a)
+ConsoleInstallTask::on_update_world(const PackageDepSpec & a)
{
output_starred_item("adding " + render_as_package_name(stringify(a)));
}
@@ -304,7 +304,7 @@ ConsoleInstallTask::on_update_world(const SetName & a)
}
void
-ConsoleInstallTask::on_update_world_skip(const PackageDepAtom & a, const std::string & s)
+ConsoleInstallTask::on_update_world_skip(const PackageDepSpec & a, const std::string & s)
{
output_starred_item("skipping " + render_as_package_name(stringify(a)) + " ("
+ s + ")");
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 7c83e62..e24d5c3 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -157,9 +157,9 @@ namespace paludis
const PackageDatabaseEntryCollection &);
virtual void on_update_world_pre();
- virtual void on_update_world(const PackageDepAtom &);
+ virtual void on_update_world(const PackageDepSpec &);
virtual void on_update_world(const SetName &);
- virtual void on_update_world_skip(const PackageDepAtom &, const std::string &);
+ virtual void on_update_world_skip(const PackageDepSpec &, const std::string &);
virtual void on_update_world_skip(const SetName &, const std::string &);
virtual void on_update_world_post();
virtual void on_preserve_world();
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 65cbe33..ba06725 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -52,7 +52,7 @@ ConsoleQueryTask::~ConsoleQueryTask()
}
void
-ConsoleQueryTask::show(const PackageDepAtom & a, const PackageDatabaseEntry * display_entry) const
+ConsoleQueryTask::show(const PackageDepSpec & a, const PackageDatabaseEntry * display_entry) const
{
/* prefer the best installed version, then the best visible version, then
* the best version */
@@ -81,7 +81,7 @@ ConsoleQueryTask::show(const PackageDepAtom & a, const PackageDatabaseEntry * di
}
void
-ConsoleQueryTask::display_header(const PackageDepAtom & a, const PackageDatabaseEntry & e) const
+ConsoleQueryTask::display_header(const PackageDepSpec & a, const PackageDatabaseEntry & e) const
{
if (a.version_requirements_ptr() || a.slot_ptr() || a.use_requirements_ptr() ||
a.repository_ptr())
@@ -91,7 +91,7 @@ ConsoleQueryTask::display_header(const PackageDepAtom & a, const PackageDatabase
}
void
-ConsoleQueryTask::display_versions_by_repository(const PackageDepAtom &,
+ConsoleQueryTask::display_versions_by_repository(const PackageDepSpec &,
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries,
const PackageDatabaseEntry & display_entry) const
{
@@ -184,7 +184,7 @@ ConsoleQueryTask::display_versions_by_repository(const PackageDepAtom &,
}
void
-ConsoleQueryTask::display_metadata(const PackageDepAtom &, const PackageDatabaseEntry & e) const
+ConsoleQueryTask::display_metadata(const PackageDepSpec &, const PackageDatabaseEntry & e) const
{
std::tr1::shared_ptr<const VersionMetadata> metadata(_imp->env->package_database()->fetch_repository(e.repository)->
version_metadata(e.name, e.version));
@@ -252,14 +252,14 @@ ConsoleQueryTask::display_metadata_key(const std::string & k, const std::string
}
void
-ConsoleQueryTask::display_metadata_license(const std::string & k, const std::string & kk, std::tr1::shared_ptr<const DepAtom> l,
+ConsoleQueryTask::display_metadata_license(const std::string & k, const std::string & kk, std::tr1::shared_ptr<const DepSpec> l,
const PackageDatabaseEntry & display_entry) const
{
output_left_column((want_raw() ? kk : k) + ":");
if (want_raw())
{
- DepAtomPrettyPrinter p(0, false);
+ DepSpecPrettyPrinter p(0, false);
l->accept(&p);
output_right_column(stringify(p));
}
@@ -274,14 +274,14 @@ ConsoleQueryTask::display_metadata_license(const std::string & k, const std::str
namespace
{
struct IsEmpty :
- DepAtomVisitorTypes::ConstVisitor,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepAtom>,
- DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepAtom>
+ DepSpecVisitorTypes::ConstVisitor,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepSpec>,
+ DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepSpec>
{
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepAtom>::visit;
- using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepAtom>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepSpec>::visit;
+ using DepSpecVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepSpec>::visit;
bool empty;
@@ -290,23 +290,23 @@ namespace
{
}
- void visit(const PackageDepAtom *)
+ void visit(const PackageDepSpec *)
{
empty = false;
}
- void visit(const BlockDepAtom *)
+ void visit(const BlockDepSpec *)
{
empty = false;
}
- void visit(const PlainTextDepAtom *)
+ void visit(const PlainTextDepSpec *)
{
empty = false;
}
};
- bool is_atom_empty(std::tr1::shared_ptr<const DepAtom> d)
+ bool is_spec_empty(std::tr1::shared_ptr<const DepSpec> d)
{
IsEmpty e;
d->accept(&e);
@@ -316,23 +316,23 @@ namespace
void
ConsoleQueryTask::display_metadata_dep(const std::string & k, const std::string & kk,
- std::tr1::shared_ptr<const DepAtom> d, const bool one_line) const
+ std::tr1::shared_ptr<const DepSpec> d, const bool one_line) const
{
- if (is_atom_empty(d))
+ if (is_spec_empty(d))
return;
output_left_column((want_raw() ? kk : k) + ":");
if (one_line)
{
- DepAtomPrettyPrinter p(0, false);
+ DepSpecPrettyPrinter p(0, false);
d->accept(&p);
output_stream() << p << std::endl;
}
else
{
output_right_column("");
- DepAtomPrettyPrinter p(left_column_width() + 5);
+ DepSpecPrettyPrinter p(left_column_width() + 5);
d->accept(&p);
output_stream() << p;
}
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
index ef152f9..7be1d14 100644
--- a/src/output/console_query_task.hh
+++ b/src/output/console_query_task.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_SRC_OUTPUT_CONSOLE_QUERY_TASK_HH 1
#include <paludis/environment.hh>
-#include <paludis/dep_atom.hh>
+#include <paludis/dep_spec.hh>
#include <src/output/console_task.hh>
namespace paludis
@@ -36,19 +36,19 @@ namespace paludis
public:
virtual ~ConsoleQueryTask();
- virtual void show(const PackageDepAtom &, const PackageDatabaseEntry * = 0) const;
+ virtual void show(const PackageDepSpec &, const PackageDatabaseEntry * = 0) const;
- virtual void display_header(const PackageDepAtom &, const PackageDatabaseEntry &) const;
- virtual void display_versions_by_repository(const PackageDepAtom &,
+ virtual void display_header(const PackageDepSpec &, const PackageDatabaseEntry &) const;
+ virtual void display_versions_by_repository(const PackageDepSpec &,
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>, const PackageDatabaseEntry &) const;
- virtual void display_metadata(const PackageDepAtom &, const PackageDatabaseEntry &) const;
+ virtual void display_metadata(const PackageDepSpec &, const PackageDatabaseEntry &) const;
virtual void display_metadata_key(const std::string &, const std::string &,
const std::string &) const;
virtual void display_metadata_license(const std::string &, const std::string &,
- std::tr1::shared_ptr<const DepAtom>, const PackageDatabaseEntry &) const;
+ std::tr1::shared_ptr<const DepSpec>, const PackageDatabaseEntry &) const;
virtual void display_metadata_dep(const std::string &, const std::string &,
- std::tr1::shared_ptr<const DepAtom>, const bool one_line) const;
+ std::tr1::shared_ptr<const DepSpec>, const bool one_line) const;
virtual void display_metadata_pde(const std::string &, const std::string &, const PackageDatabaseEntry &) const;
virtual void display_metadata_time(const std::string &, const std::string &, time_t) const;
virtual void display_metadata_iuse(const std::string &, const std::string &, const std::string &,
diff --git a/src/output/licence.cc b/src/output/licence.cc
index a460a97..bd28aed 100644
--- a/src/output/licence.cc
+++ b/src/output/licence.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,36 +22,36 @@
#include <ostream>
void
-LicenceDisplayer::visit(const paludis::AllDepAtom * atom)
+LicenceDisplayer::visit(const paludis::AllDepSpec * spec)
{
stream << "( ";
- std::for_each(atom->begin(), atom->end(), paludis::accept_visitor(this));
+ std::for_each(spec->begin(), spec->end(), paludis::accept_visitor(this));
stream << ") ";
}
void
-LicenceDisplayer::visit(const paludis::AnyDepAtom * atom)
+LicenceDisplayer::visit(const paludis::AnyDepSpec * spec)
{
stream << "|| ( ";
- std::for_each(atom->begin(), atom->end(), paludis::accept_visitor(this));
+ std::for_each(spec->begin(), spec->end(), paludis::accept_visitor(this));
stream << ") ";
}
void
-LicenceDisplayer::visit(const paludis::UseDepAtom * atom)
+LicenceDisplayer::visit(const paludis::UseDepSpec * spec)
{
- stream << atom->flag() << "? ( ";
- std::for_each(atom->begin(), atom->end(), paludis::accept_visitor(this));
+ stream << spec->flag() << "? ( ";
+ std::for_each(spec->begin(), spec->end(), paludis::accept_visitor(this));
stream << ") ";
}
void
-LicenceDisplayer::visit(const paludis::PlainTextDepAtom * atom)
+LicenceDisplayer::visit(const paludis::PlainTextDepSpec * spec)
{
- if (env->accept_license(atom->text(), db_entry))
- stream << colour(cl_not_masked, atom->text());
+ if (env->accept_license(spec->text(), db_entry))
+ stream << colour(cl_not_masked, spec->text());
else
- stream << colour(cl_masked, "(" + atom->text() + ")!");
+ stream << colour(cl_masked, "(" + spec->text() + ")!");
stream << " ";
}
diff --git a/src/output/licence.hh b/src/output/licence.hh
index 38d902e..d93e87c 100644
--- a/src/output/licence.hh
+++ b/src/output/licence.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -27,7 +27,7 @@
* Display licences.
*/
struct LicenceDisplayer :
- paludis::DepAtomVisitorTypes::ConstVisitor
+ paludis::DepSpecVisitorTypes::ConstVisitor
{
/// Our stream.
std::ostream & stream;
@@ -46,19 +46,19 @@ struct LicenceDisplayer :
///\name Visit methods
///{
- void visit(const paludis::AllDepAtom * atom);
+ void visit(const paludis::AllDepSpec * spec);
- void visit(const paludis::AnyDepAtom * atom);
+ void visit(const paludis::AnyDepSpec * spec);
- void visit(const paludis::UseDepAtom * atom);
+ void visit(const paludis::UseDepSpec * spec);
- void visit(const paludis::PlainTextDepAtom * atom);
+ void visit(const paludis::PlainTextDepSpec * spec);
- void visit(const paludis::PackageDepAtom *)
+ void visit(const paludis::PackageDepSpec *)
{
}
- void visit(const paludis::BlockDepAtom *)
+ void visit(const paludis::BlockDepSpec *)
{
}
///}