aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-07 14:15:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-07 14:15:31 +0100
commit5bca2928c8047c1d34e35d8c167a7a6644b2515a (patch)
treef89de8dc9aac885067abea62dc1f5e8fcb04eea9
parent4eb9754117cf6d1fe9985fc1950ffbaf943fcafc (diff)
downloadpaludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.gz
paludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.xz
Constraint -> Requirement
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec.cc56
-rw-r--r--doc/api/cplusplus/examples/example_match_package.cc2
-rw-r--r--doc/api/cplusplus/examples/example_selection.cc8
-rw-r--r--paludis/changed_choices.cc6
-rw-r--r--paludis/changed_choices.hh2
-rw-r--r--paludis/common_sets.cc6
-rw-r--r--paludis/dep_spec.cc78
-rw-r--r--paludis/dep_spec.hh54
-rw-r--r--paludis/dep_spec_data.cc290
-rw-r--r--paludis/dep_spec_data.hh162
-rw-r--r--paludis/elike_package_dep_spec-fwd.hh4
-rw-r--r--paludis/elike_package_dep_spec.cc38
-rw-r--r--paludis/elike_package_dep_spec.hh2
-rw-r--r--paludis/elike_use_requirement-fwd.hh4
-rw-r--r--paludis/elike_use_requirement.cc6
-rw-r--r--paludis/elike_use_requirement_TEST.cc180
-rw-r--r--paludis/environment_implementation.cc2
-rw-r--r--paludis/environments/paludis/keywords_conf.cc6
-rw-r--r--paludis/environments/paludis/licenses_conf.cc6
-rw-r--r--paludis/environments/paludis/suggestions_conf.cc18
-rw-r--r--paludis/environments/paludis/world.cc4
-rw-r--r--paludis/environments/paludis/world_TEST.cc2
-rw-r--r--paludis/environments/portage/portage_environment.cc6
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc2
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/filter.cc4
-rw-r--r--paludis/fuzzy_finder.cc16
-rw-r--r--paludis/generator.cc60
-rw-r--r--paludis/match_package.cc58
-rw-r--r--paludis/match_package.se2
-rw-r--r--paludis/package_dep_spec_collection.cc6
-rw-r--r--paludis/package_dep_spec_constraint-fwd.hh80
-rw-r--r--paludis/package_dep_spec_constraint.hh399
-rw-r--r--paludis/package_dep_spec_constraint.se33
-rw-r--r--paludis/package_dep_spec_properties.cc26
-rw-r--r--paludis/package_dep_spec_properties.hh20
-rw-r--r--paludis/package_dep_spec_requirement-fwd.hh80
-rw-r--r--paludis/package_dep_spec_requirement.cc (renamed from paludis/package_dep_spec_constraint.cc)510
-rw-r--r--paludis/package_dep_spec_requirement.hh399
-rw-r--r--paludis/package_dep_spec_requirement.se33
-rw-r--r--paludis/paludislike_options_conf.cc18
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc2
-rw-r--r--paludis/repositories/e/e_repository_sets.cc12
-rw-r--r--paludis/repositories/e/exheres_mask_store.cc6
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc8
-rw-r--r--paludis/repositories/e/traditional_mask_store.cc6
-rw-r--r--paludis/repositories/e/traditional_profile.cc6
-rw-r--r--paludis/repositories/e/vdb_repository.cc24
-rw-r--r--paludis/repositories/gemcutter/gemcutter_dependencies_key.cc4
-rw-r--r--paludis/repositories/virtuals/package_id.cc10
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc2
-rw-r--r--paludis/resolver/collect_depped_upon.cc8
-rw-r--r--paludis/resolver/decider.cc46
-rw-r--r--paludis/resolver/get_constraints_for_dependent_helper.cc4
-rw-r--r--paludis/resolver/get_constraints_for_purge_helper.cc4
-rw-r--r--paludis/resolver/get_constraints_for_via_binary_helper.cc2
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.cc2
-rw-r--r--paludis/resolver/get_resolvents_for_helper.cc2
-rw-r--r--paludis/resolver/get_use_existing_nothing_helper.cc8
-rw-r--r--paludis/resolver/interest_in_spec_helper.cc6
-rw-r--r--paludis/resolver/match_qpns.cc18
-rw-r--r--paludis/resolver/orderer.cc4
-rw-r--r--paludis/resolver/resolvent.cc6
-rw-r--r--paludis/resolver/sanitised_dependencies.cc4
-rw-r--r--paludis/resolver/spec_rewriter.cc22
-rw-r--r--paludis/set_file.cc16
-rw-r--r--paludis/user_dep_spec.cc62
-rw-r--r--paludis/user_dep_spec.hh4
-rw-r--r--paludis/user_dep_spec_TEST.cc88
-rw-r--r--python/dep_spec.cc224
-rw-r--r--python/dep_spec.hh20
-rwxr-xr-xpython/dep_spec_TEST.py6
-rw-r--r--python/generator_TEST.py4
-rwxr-xr-xpython/mask_TEST.py2
-rw-r--r--python/package_dep_spec_constraint.cc154
-rw-r--r--python/paludis_python.hh2
-rw-r--r--python/paludis_python_so.cc2
-rw-r--r--ruby/dep_spec.cc124
-rw-r--r--ruby/dep_spec_TEST.rb94
-rw-r--r--ruby/generator_TEST.rb4
-rw-r--r--ruby/package_dep_spec_constraint.cc488
-rw-r--r--ruby/paludis_ruby.cc8
-rw-r--r--ruby/paludis_ruby.hh2
-rw-r--r--src/clients/cave/cmd_digest.cc2
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc10
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc14
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc6
-rw-r--r--src/clients/cave/cmd_graph_jobs.cc14
-rw-r--r--src/clients/cave/cmd_print_spec.cc58
-rw-r--r--src/clients/cave/cmd_report.cc4
-rw-r--r--src/clients/cave/cmd_show.cc12
-rw-r--r--src/clients/cave/resolve_common.cc2
92 files changed, 2166 insertions, 2166 deletions
diff --git a/doc/api/cplusplus/examples/example_dep_spec.cc b/doc/api/cplusplus/examples/example_dep_spec.cc
index ba0f647..57fb2e5 100644
--- a/doc/api/cplusplus/examples/example_dep_spec.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec.cc
@@ -59,35 +59,35 @@ int main(int argc, char * argv[])
/* Display information about the PackageDepSpec. */
cout << "Information about '" << spec << "':" << endl;
- if (spec.package_name_constraint())
- cout << " " << left << setw(24) << "Package:" << " " << spec.package_name_constraint()->name() << endl;
+ if (spec.package_name_requirement())
+ cout << " " << left << setw(24) << "Package:" << " " << spec.package_name_requirement()->name() << endl;
- if (spec.category_name_part_constraint())
- cout << " " << left << setw(24) << "Category part:" << " " << spec.category_name_part_constraint()->name_part() << endl;
+ if (spec.category_name_part_requirement())
+ cout << " " << left << setw(24) << "Category part:" << " " << spec.category_name_part_requirement()->name_part() << endl;
- if (spec.package_name_part_constraint())
- cout << " " << left << setw(24) << "Package part:" << " " << spec.package_name_part_constraint()->name_part() << endl;
+ if (spec.package_name_part_requirement())
+ cout << " " << left << setw(24) << "Package part:" << " " << spec.package_name_part_requirement()->name_part() << endl;
- if (spec.all_version_constraints() && ! spec.all_version_constraints()->empty())
+ if (spec.all_version_requirements() && ! spec.all_version_requirements()->empty())
{
cout << " " << left << setw(24) << "Version requirements:" << " ";
bool need_join(false);
- for (auto r(spec.all_version_constraints()->begin()), r_end(spec.all_version_constraints()->end()) ;
+ for (auto r(spec.all_version_requirements()->begin()), r_end(spec.all_version_requirements()->end()) ;
r != r_end ; ++r)
{
if (need_join)
{
switch ((*r)->combiner())
{
- case vcc_and:
+ case vrc_and:
cout << " and ";
break;
- case vcc_or:
+ case vrc_or:
cout << " or ";
break;
- case last_vcc:
+ case last_vrc:
throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
}
}
@@ -98,36 +98,36 @@ int main(int argc, char * argv[])
cout << endl;
}
- if (spec.exact_slot_constraint())
- cout << " " << left << setw(24) << "Slot:" << " " << spec.exact_slot_constraint()->name() << endl;
+ if (spec.exact_slot_requirement())
+ cout << " " << left << setw(24) << "Slot:" << " " << spec.exact_slot_requirement()->name() << endl;
- if (spec.in_repository_constraint())
+ if (spec.in_repository_requirement())
cout << " " << left << setw(24) << "In repository:" << " " <<
- spec.in_repository_constraint()->name() << endl;
+ spec.in_repository_requirement()->name() << endl;
- if (spec.from_repository_constraint())
+ if (spec.from_repository_requirement())
cout << " " << left << setw(24) << "From repository:" << " " <<
- spec.from_repository_constraint()->name() << endl;
+ spec.from_repository_requirement()->name() << endl;
- if (spec.installed_at_path_constraint())
+ if (spec.installed_at_path_requirement())
cout << " " << left << setw(24) << "Installed at path:" << " " <<
- spec.installed_at_path_constraint()->path() << endl;
+ spec.installed_at_path_requirement()->path() << endl;
- if (spec.installable_to_path_constraint())
+ if (spec.installable_to_path_requirement())
cout << " " << left << setw(24) << "Installable to path:" << " " <<
- spec.installable_to_path_constraint()->path() << ", " <<
- spec.installable_to_path_constraint()->include_masked() << endl;
+ spec.installable_to_path_requirement()->path() << ", " <<
+ spec.installable_to_path_requirement()->include_masked() << endl;
- if (spec.installable_to_repository_constraint())
+ if (spec.installable_to_repository_requirement())
cout << " " << left << setw(24) << "Installable to repository:" << " " <<
- spec.installable_to_repository_constraint()->name() << ", " <<
- spec.installable_to_repository_constraint()->include_masked() << endl;
+ spec.installable_to_repository_requirement()->name() << ", " <<
+ spec.installable_to_repository_requirement()->include_masked() << endl;
- if (spec.all_choice_constraints() && ! spec.all_choice_constraints()->empty())
+ if (spec.all_choice_requirements() && ! spec.all_choice_requirements()->empty())
{
- cout << " " << left << setw(24) << "Choice constraints:" << " ";
+ cout << " " << left << setw(24) << "Choice requirements:" << " ";
bool need_join(false);
- for (auto u(spec.all_choice_constraints()->begin()), u_end(spec.all_choice_constraints()->end()) ; u != u_end ; ++u)
+ for (auto u(spec.all_choice_requirements()->begin()), u_end(spec.all_choice_requirements()->end()) ; u != u_end ; ++u)
{
if (need_join)
cout << " and ";
diff --git a/doc/api/cplusplus/examples/example_match_package.cc b/doc/api/cplusplus/examples/example_match_package.cc
index 0ff9e9f..94abb4c 100644
--- a/doc/api/cplusplus/examples/example_match_package.cc
+++ b/doc/api/cplusplus/examples/example_match_package.cc
@@ -54,7 +54,7 @@ int main(int argc, char * argv[])
i != i_end ; ++i)
{
/* Is it paludis? */
- if (match_package(*env, MutablePackageDepSpecData({ }).constrain_package(
+ if (match_package(*env, MutablePackageDepSpecData({ }).require_package(
QualifiedPackageName("sys-apps/paludis")), *i, make_null_shared_ptr(), { }))
cout << left << setw(50) << (stringify(**i) + ":") << " " << "paludis" << endl;
diff --git a/doc/api/cplusplus/examples/example_selection.cc b/doc/api/cplusplus/examples/example_selection.cc
index 0242dbd..f71a6ba 100644
--- a/doc/api/cplusplus/examples/example_selection.cc
+++ b/doc/api/cplusplus/examples/example_selection.cc
@@ -62,13 +62,13 @@ int main(int argc, char * argv[])
* object used determines the number and ordering of results. In the
* simplest form, it takes a Generator as a parameter. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).constrain_package(
+ generator::Matches(MutablePackageDepSpecData({ }).require_package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { })));
/* Generators can be passed through a Filter. The Selection optimises
* the code internally to avoid doing excess work. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).constrain_package(
+ generator::Matches(MutablePackageDepSpecData({ }).require_package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::InstalledAtSlash()));
@@ -76,7 +76,7 @@ int main(int argc, char * argv[])
* with filter::SupportsAction<InstallAction>, since installed packages
* aren't masked. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).constrain_package(
+ generator::Matches(MutablePackageDepSpecData({ }).require_package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked()));
@@ -85,7 +85,7 @@ int main(int argc, char * argv[])
* is no metadata cache. Consider using other Selection objects if
* you only need the best matching or some arbitrary matching ID. */
show_selection(env, selection::BestVersionOnly(
- generator::Matches(MutablePackageDepSpecData({ }).constrain_package(
+ generator::Matches(MutablePackageDepSpecData({ }).require_package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked()));
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index cca3885..d8a5c72 100644
--- a/paludis/changed_choices.cc
+++ b/paludis/changed_choices.cc
@@ -61,16 +61,16 @@ ChangedChoices::empty() const
}
void
-ChangedChoices::add_constraints_to(MutablePackageDepSpecData & spec) const
+ChangedChoices::add_requirements_to(MutablePackageDepSpecData & spec) const
{
for (auto o(_imp->overrides.begin()), o_end(_imp->overrides.end()) ;
o != o_end ; ++o)
{
if (o->second)
- spec.constrain_choice(parse_elike_use_requirement("" + stringify(o->first) + "(-)",
+ spec.require_choice(parse_elike_use_requirement("" + stringify(o->first) + "(-)",
{ euro_allow_default_values }));
else
- spec.constrain_choice(parse_elike_use_requirement("-" + stringify(o->first) + "(-)",
+ spec.require_choice(parse_elike_use_requirement("-" + stringify(o->first) + "(-)",
{ euro_allow_default_values }));
}
}
diff --git a/paludis/changed_choices.hh b/paludis/changed_choices.hh
index 580ed80..8171648 100644
--- a/paludis/changed_choices.hh
+++ b/paludis/changed_choices.hh
@@ -47,7 +47,7 @@ namespace paludis
bool empty() const PALUDIS_ATTRIBUTE((warn_unused_result));
- void add_constraints_to(MutablePackageDepSpecData &) const;
+ void add_requirements_to(MutablePackageDepSpecData &) const;
void serialise(Serialiser &) const;
diff --git a/paludis/common_sets.cc b/paludis/common_sets.cc
index e2df523..f633905 100644
--- a/paludis/common_sets.cc
+++ b/paludis/common_sets.cc
@@ -58,13 +58,13 @@ namespace
if (slots && (*i)->slot_key())
result->top()->append(std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package((*i)->name())
- .constrain_exact_slot((*i)->slot_key()->value(), false)
+ .require_package((*i)->name())
+ .require_exact_slot((*i)->slot_key()->value(), false)
));
else
result->top()->append(std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package((*i)->name())
+ .require_package((*i)->name())
));
return result;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index b2e48f8..7b221f3 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -540,82 +540,82 @@ PackageDepSpec::PackageDepSpec(const PackageDepSpec & d) :
set_annotations(d.maybe_annotations());
}
-const std::shared_ptr<const NameConstraint>
-PackageDepSpec::package_name_constraint() const
+const std::shared_ptr<const NameRequirement>
+PackageDepSpec::package_name_requirement() const
{
- return _imp->data->package_name_constraint();
+ return _imp->data->package_name_requirement();
}
-const std::shared_ptr<const PackageNamePartConstraint>
-PackageDepSpec::package_name_part_constraint() const
+const std::shared_ptr<const PackageNamePartRequirement>
+PackageDepSpec::package_name_part_requirement() const
{
- return _imp->data->package_name_part_constraint();
+ return _imp->data->package_name_part_requirement();
}
-const std::shared_ptr<const CategoryNamePartConstraint>
-PackageDepSpec::category_name_part_constraint() const
+const std::shared_ptr<const CategoryNamePartRequirement>
+PackageDepSpec::category_name_part_requirement() const
{
- return _imp->data->category_name_part_constraint();
+ return _imp->data->category_name_part_requirement();
}
-const std::shared_ptr<const VersionConstraintSequence>
-PackageDepSpec::all_version_constraints() const
+const std::shared_ptr<const VersionRequirementSequence>
+PackageDepSpec::all_version_requirements() const
{
- return _imp->data->all_version_constraints();
+ return _imp->data->all_version_requirements();
}
-const std::shared_ptr<const AnySlotConstraint>
-PackageDepSpec::any_slot_constraint() const
+const std::shared_ptr<const AnySlotRequirement>
+PackageDepSpec::any_slot_requirement() const
{
- return _imp->data->any_slot_constraint();
+ return _imp->data->any_slot_requirement();
}
-const std::shared_ptr<const ExactSlotConstraint>
-PackageDepSpec::exact_slot_constraint() const
+const std::shared_ptr<const ExactSlotRequirement>
+PackageDepSpec::exact_slot_requirement() const
{
- return _imp->data->exact_slot_constraint();
+ return _imp->data->exact_slot_requirement();
}
-const std::shared_ptr<const InRepositoryConstraint>
-PackageDepSpec::in_repository_constraint() const
+const std::shared_ptr<const InRepositoryRequirement>
+PackageDepSpec::in_repository_requirement() const
{
- return _imp->data->in_repository_constraint();
+ return _imp->data->in_repository_requirement();
}
-const std::shared_ptr<const InstallableToRepositoryConstraint>
-PackageDepSpec::installable_to_repository_constraint() const
+const std::shared_ptr<const InstallableToRepositoryRequirement>
+PackageDepSpec::installable_to_repository_requirement() const
{
- return _imp->data->installable_to_repository_constraint();
+ return _imp->data->installable_to_repository_requirement();
}
-const std::shared_ptr<const FromRepositoryConstraint>
-PackageDepSpec::from_repository_constraint() const
+const std::shared_ptr<const FromRepositoryRequirement>
+PackageDepSpec::from_repository_requirement() const
{
- return _imp->data->from_repository_constraint();
+ return _imp->data->from_repository_requirement();
}
-const std::shared_ptr<const InstalledAtPathConstraint>
-PackageDepSpec::installed_at_path_constraint() const
+const std::shared_ptr<const InstalledAtPathRequirement>
+PackageDepSpec::installed_at_path_requirement() const
{
- return _imp->data->installed_at_path_constraint();
+ return _imp->data->installed_at_path_requirement();
}
-const std::shared_ptr<const InstallableToPathConstraint>
-PackageDepSpec::installable_to_path_constraint() const
+const std::shared_ptr<const InstallableToPathRequirement>
+PackageDepSpec::installable_to_path_requirement() const
{
- return _imp->data->installable_to_path_constraint();
+ return _imp->data->installable_to_path_requirement();
}
-const std::shared_ptr<const ChoiceConstraintSequence>
-PackageDepSpec::all_choice_constraints() const
+const std::shared_ptr<const ChoiceRequirementSequence>
+PackageDepSpec::all_choice_requirements() const
{
- return _imp->data->all_choice_constraints();
+ return _imp->data->all_choice_requirements();
}
-const std::shared_ptr<const KeyConstraintSequence>
-PackageDepSpec::all_key_constraints() const
+const std::shared_ptr<const KeyRequirementSequence>
+PackageDepSpec::all_key_requirements() const
{
- return _imp->data->all_key_constraints();
+ return _imp->data->all_key_requirements();
}
std::string
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index a9f4616..46672f9 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -37,7 +37,7 @@
#include <paludis/environment-fwd.hh>
#include <paludis/dep_spec_data-fwd.hh>
#include <paludis/dep_spec_annotations-fwd.hh>
-#include <paludis/package_dep_spec_constraint-fwd.hh>
+#include <paludis/package_dep_spec_requirement-fwd.hh>
#include <memory>
@@ -313,105 +313,105 @@ namespace paludis
///\}
/**
- * Fetch the single NameConstraint, if we have one, or
+ * Fetch the single NameRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const NameConstraint> package_name_constraint() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::shared_ptr<const NameRequirement> package_name_requirement() const PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch the single PackageNamePartConstraint, if we have one, or
+ * Fetch the single PackageNamePartRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const PackageNamePartConstraint> package_name_part_constraint() const;
+ const std::shared_ptr<const PackageNamePartRequirement> package_name_part_requirement() const;
/**
- * Fetch the single CategoryNamePartConstraint, if we have one, or
+ * Fetch the single CategoryNamePartRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const CategoryNamePartConstraint> category_name_part_constraint() const;
+ const std::shared_ptr<const CategoryNamePartRequirement> category_name_part_requirement() const;
/**
- * Fetch all our VersionConstraints, if we have any, or
+ * Fetch all our VersionRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const VersionConstraintSequence> all_version_constraints() const;
+ const std::shared_ptr<const VersionRequirementSequence> all_version_requirements() const;
/**
- * Fetch the single ExactSlotConstraint, if we have one, or
+ * Fetch the single ExactSlotRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const;
+ const std::shared_ptr<const ExactSlotRequirement> exact_slot_requirement() const;
/**
- * Fetch the single AnySlotConstraint, if we have one, or
+ * Fetch the single AnySlotRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const;
+ const std::shared_ptr<const AnySlotRequirement> any_slot_requirement() const;
/**
- * Fetch the single InRepositoryConstraint, if we have one, or
+ * Fetch the single InRepositoryRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InRepositoryConstraint> in_repository_constraint() const;
+ const std::shared_ptr<const InRepositoryRequirement> in_repository_requirement() const;
/**
- * Fetch the single InstallableToRepositoryConstraint, if we have one, or
+ * Fetch the single InstallableToRepositoryRequirement, if we have one, or
*
* \since 0.61
*/
- const std::shared_ptr<const InstallableToRepositoryConstraint> installable_to_repository_constraint() const;
+ const std::shared_ptr<const InstallableToRepositoryRequirement> installable_to_repository_requirement() const;
/**
- * Fetch the single FromRepositoryConstraint, if we have one, or
+ * Fetch the single FromRepositoryRequirement, if we have one, or
* a null pointer otherwise.
*/
- const std::shared_ptr<const FromRepositoryConstraint> from_repository_constraint() const;
+ const std::shared_ptr<const FromRepositoryRequirement> from_repository_requirement() const;
/**
- * Fetch the single InstalledAtPathConstraint, if we have one, or
+ * Fetch the single InstalledAtPathRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InstalledAtPathConstraint> installed_at_path_constraint() const;
+ const std::shared_ptr<const InstalledAtPathRequirement> installed_at_path_requirement() const;
/**
- * Fetch the single InstallableToPathConstraint, if we have one, or
+ * Fetch the single InstallableToPathRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InstallableToPathConstraint> installable_to_path_constraint() const;
+ const std::shared_ptr<const InstallableToPathRequirement> installable_to_path_requirement() const;
/**
- * Fetch all our KeyConstraints, if we have any, or
+ * Fetch all our KeyRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const KeyConstraintSequence> all_key_constraints() const;
+ const std::shared_ptr<const KeyRequirementSequence> all_key_requirements() const;
/**
- * Fetch all our ChoiceConstraints, if we have any, or
+ * Fetch all our ChoiceRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const ChoiceConstraintSequence> all_choice_constraints() const;
+ const std::shared_ptr<const ChoiceRequirementSequence> all_choice_requirements() const;
/**
* Access to our data.
diff --git a/paludis/dep_spec_data.cc b/paludis/dep_spec_data.cc
index e02a69a..a4bed58 100644
--- a/paludis/dep_spec_data.cc
+++ b/paludis/dep_spec_data.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_spec_data.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
@@ -45,19 +45,19 @@ namespace paludis
template <>
struct Imp<PackageDepSpecData>
{
- std::shared_ptr<const NameConstraint> package;
- std::shared_ptr<const PackageNamePartConstraint> package_name_part;
- std::shared_ptr<const CategoryNamePartConstraint> category_name_part;
- std::shared_ptr<VersionConstraintSequence> all_versions;
- std::shared_ptr<const AnySlotConstraint> any_slot;
- std::shared_ptr<const ExactSlotConstraint> exact_slot;
- std::shared_ptr<const InRepositoryConstraint> in_repository;
- std::shared_ptr<const FromRepositoryConstraint> from_repository;
- std::shared_ptr<const InstallableToRepositoryConstraint> installable_to_repository;
- std::shared_ptr<const InstalledAtPathConstraint> installed_at_path;
- std::shared_ptr<const InstallableToPathConstraint> installable_to_path;
- std::shared_ptr<KeyConstraintSequence> all_keys;
- std::shared_ptr<ChoiceConstraintSequence> all_choices;
+ std::shared_ptr<const NameRequirement> package;
+ std::shared_ptr<const PackageNamePartRequirement> package_name_part;
+ std::shared_ptr<const CategoryNamePartRequirement> category_name_part;
+ std::shared_ptr<VersionRequirementSequence> all_versions;
+ std::shared_ptr<const AnySlotRequirement> any_slot;
+ std::shared_ptr<const ExactSlotRequirement> exact_slot;
+ std::shared_ptr<const InRepositoryRequirement> in_repository;
+ std::shared_ptr<const FromRepositoryRequirement> from_repository;
+ std::shared_ptr<const InstallableToRepositoryRequirement> installable_to_repository;
+ std::shared_ptr<const InstalledAtPathRequirement> installed_at_path;
+ std::shared_ptr<const InstallableToPathRequirement> installable_to_path;
+ std::shared_ptr<KeyRequirementSequence> all_keys;
+ std::shared_ptr<ChoiceRequirementSequence> all_choices;
PackageDepSpecDataOptions options;
Imp(const PackageDepSpecDataOptions & o) :
@@ -66,31 +66,31 @@ namespace paludis
}
Imp(const PackageDepSpecData & other) :
- package(other.package_name_constraint()),
- package_name_part(other.package_name_part_constraint()),
- category_name_part(other.category_name_part_constraint()),
- all_versions(other.all_version_constraints() ? new VersionConstraintSequence : 0),
- any_slot(other.any_slot_constraint()),
- exact_slot(other.exact_slot_constraint()),
- in_repository(other.in_repository_constraint()),
- from_repository(other.from_repository_constraint()),
- installable_to_repository(other.installable_to_repository_constraint()),
- installed_at_path(other.installed_at_path_constraint()),
- installable_to_path(other.installable_to_path_constraint()),
- all_keys(other.all_key_constraints() ? new KeyConstraintSequence : 0),
- all_choices(other.all_choice_constraints() ? new ChoiceConstraintSequence : 0),
+ package(other.package_name_requirement()),
+ package_name_part(other.package_name_part_requirement()),
+ category_name_part(other.category_name_part_requirement()),
+ all_versions(other.all_version_requirements() ? new VersionRequirementSequence : 0),
+ any_slot(other.any_slot_requirement()),
+ exact_slot(other.exact_slot_requirement()),
+ in_repository(other.in_repository_requirement()),
+ from_repository(other.from_repository_requirement()),
+ installable_to_repository(other.installable_to_repository_requirement()),
+ installed_at_path(other.installed_at_path_requirement()),
+ installable_to_path(other.installable_to_path_requirement()),
+ all_keys(other.all_key_requirements() ? new KeyRequirementSequence : 0),
+ all_choices(other.all_choice_requirements() ? new ChoiceRequirementSequence : 0),
options(other.options())
{
if (all_versions)
- std::copy(other.all_version_constraints()->begin(), other.all_version_constraints()->end(),
+ std::copy(other.all_version_requirements()->begin(), other.all_version_requirements()->end(),
all_versions->back_inserter());
if (all_keys)
- std::copy(other.all_key_constraints()->begin(), other.all_key_constraints()->end(),
+ std::copy(other.all_key_requirements()->begin(), other.all_key_requirements()->end(),
all_keys->back_inserter());
if (all_choices)
- std::copy(other.all_choice_constraints()->begin(), other.all_choice_constraints()->end(),
+ std::copy(other.all_choice_requirements()->begin(), other.all_choice_requirements()->end(),
all_choices->back_inserter());
}
};
@@ -108,80 +108,80 @@ PackageDepSpecData::PackageDepSpecData(const PackageDepSpecData & o) :
PackageDepSpecData::~PackageDepSpecData() = default;
-const std::shared_ptr<const NameConstraint>
-PackageDepSpecData::package_name_constraint() const
+const std::shared_ptr<const NameRequirement>
+PackageDepSpecData::package_name_requirement() const
{
return _imp->package;
}
-const std::shared_ptr<const PackageNamePartConstraint>
-PackageDepSpecData::package_name_part_constraint() const
+const std::shared_ptr<const PackageNamePartRequirement>
+PackageDepSpecData::package_name_part_requirement() const
{
return _imp->package_name_part;
}
-const std::shared_ptr<const CategoryNamePartConstraint>
-PackageDepSpecData::category_name_part_constraint() const
+const std::shared_ptr<const CategoryNamePartRequirement>
+PackageDepSpecData::category_name_part_requirement() const
{
return _imp->category_name_part;
}
-const std::shared_ptr<const VersionConstraintSequence>
-PackageDepSpecData::all_version_constraints() const
+const std::shared_ptr<const VersionRequirementSequence>
+PackageDepSpecData::all_version_requirements() const
{
return _imp->all_versions;
}
-const std::shared_ptr<const ExactSlotConstraint>
-PackageDepSpecData::exact_slot_constraint() const
+const std::shared_ptr<const ExactSlotRequirement>
+PackageDepSpecData::exact_slot_requirement() const
{
return _imp->exact_slot;
}
-const std::shared_ptr<const AnySlotConstraint>
-PackageDepSpecData::any_slot_constraint() const
+const std::shared_ptr<const AnySlotRequirement>
+PackageDepSpecData::any_slot_requirement() const
{
return _imp->any_slot;
}
-const std::shared_ptr<const InRepositoryConstraint>
-PackageDepSpecData::in_repository_constraint() const
+const std::shared_ptr<const InRepositoryRequirement>
+PackageDepSpecData::in_repository_requirement() const
{
return _imp->in_repository;
}
-const std::shared_ptr<const InstallableToRepositoryConstraint>
-PackageDepSpecData::installable_to_repository_constraint() const
+const std::shared_ptr<const InstallableToRepositoryRequirement>
+PackageDepSpecData::installable_to_repository_requirement() const
{
return _imp->installable_to_repository;
}
-const std::shared_ptr<const FromRepositoryConstraint>
-PackageDepSpecData::from_repository_constraint() const
+const std::shared_ptr<const FromRepositoryRequirement>
+PackageDepSpecData::from_repository_requirement() const
{
return _imp->from_repository;
}
-const std::shared_ptr<const InstalledAtPathConstraint>
-PackageDepSpecData::installed_at_path_constraint() const
+const std::shared_ptr<const InstalledAtPathRequirement>
+PackageDepSpecData::installed_at_path_requirement() const
{
return _imp->installed_at_path;
}
-const std::shared_ptr<const InstallableToPathConstraint>
-PackageDepSpecData::installable_to_path_constraint() const
+const std::shared_ptr<const InstallableToPathRequirement>
+PackageDepSpecData::installable_to_path_requirement() const
{
return _imp->installable_to_path;
}
-const std::shared_ptr<const KeyConstraintSequence>
-PackageDepSpecData::all_key_constraints() const
+const std::shared_ptr<const KeyRequirementSequence>
+PackageDepSpecData::all_key_requirements() const
{
return _imp->all_keys;
}
-const std::shared_ptr<const ChoiceConstraintSequence>
-PackageDepSpecData::all_choice_constraints() const
+const std::shared_ptr<const ChoiceRequirementSequence>
+PackageDepSpecData::all_choice_requirements() const
{
return _imp->all_choices;
}
@@ -197,67 +197,67 @@ PackageDepSpecData::as_string() const
{
std::ostringstream s;
- if (all_version_constraints())
+ if (all_version_requirements())
{
- if (all_version_constraints()->begin() == all_version_constraints()->end())
+ if (all_version_requirements()->begin() == all_version_requirements()->end())
{
}
- else if (next(all_version_constraints()->begin()) == all_version_constraints()->end() &&
+ else if (next(all_version_requirements()->begin()) == all_version_requirements()->end() &&
! options()[pdsdo_always_use_ranged_deps])
{
- if ((*all_version_constraints()->begin())->version_operator() == vo_stupid_equal_star ||
- (*all_version_constraints()->begin())->version_operator() == vo_nice_equal_star)
+ if ((*all_version_requirements()->begin())->version_operator() == vo_stupid_equal_star ||
+ (*all_version_requirements()->begin())->version_operator() == vo_nice_equal_star)
s << "=";
else
- s << (*all_version_constraints()->begin())->version_operator();
+ s << (*all_version_requirements()->begin())->version_operator();
}
}
- if (package_name_constraint())
- s << package_name_constraint()->name();
+ if (package_name_requirement())
+ s << package_name_requirement()->name();
else
{
- if (category_name_part_constraint())
- s << category_name_part_constraint()->name_part();
+ if (category_name_part_requirement())
+ s << category_name_part_requirement()->name_part();
else
s << "*";
s << "/";
- if (package_name_part_constraint())
- s << package_name_part_constraint()->name_part();
+ if (package_name_part_requirement())
+ s << package_name_part_requirement()->name_part();
else
s << "*";
}
- if (all_version_constraints())
+ if (all_version_requirements())
{
- if (all_version_constraints()->begin() == all_version_constraints()->end())
+ if (all_version_requirements()->begin() == all_version_requirements()->end())
{
}
- else if (next(all_version_constraints()->begin()) == all_version_constraints()->end() &&
+ else if (next(all_version_requirements()->begin()) == all_version_requirements()->end() &&
! options()[pdsdo_always_use_ranged_deps])
{
- s << "-" << (*all_version_constraints()->begin())->version_spec();
- if ((*all_version_constraints()->begin())->version_operator() == vo_stupid_equal_star ||
- (*all_version_constraints()->begin())->version_operator() == vo_nice_equal_star)
+ s << "-" << (*all_version_requirements()->begin())->version_spec();
+ if ((*all_version_requirements()->begin())->version_operator() == vo_stupid_equal_star ||
+ (*all_version_requirements()->begin())->version_operator() == vo_nice_equal_star)
s << "*";
}
}
- if (exact_slot_constraint())
+ if (exact_slot_requirement())
{
- if (exact_slot_constraint()->locked())
+ if (exact_slot_requirement()->locked())
s << ":=";
else
s << ":";
- s << stringify(exact_slot_constraint()->name());
+ s << stringify(exact_slot_requirement()->name());
}
- if (any_slot_constraint())
+ if (any_slot_requirement())
{
- if (any_slot_constraint()->locking())
+ if (any_slot_requirement()->locking())
s << ":=";
else
s << ":*";
@@ -266,46 +266,46 @@ PackageDepSpecData::as_string() const
std::string left, right;
bool need_arrow(false);
- if (from_repository_constraint())
- left = stringify(from_repository_constraint()->name());
+ if (from_repository_requirement())
+ left = stringify(from_repository_requirement()->name());
- if (in_repository_constraint())
- right = stringify(in_repository_constraint()->name());
+ if (in_repository_requirement())
+ right = stringify(in_repository_requirement()->name());
- if (installed_at_path_constraint())
+ if (installed_at_path_requirement())
{
if (! right.empty())
{
need_arrow = true;
right.append("->");
}
- right.append(stringify(installed_at_path_constraint()->path()));
+ right.append(stringify(installed_at_path_requirement()->path()));
}
- if (installable_to_repository_constraint())
+ if (installable_to_repository_requirement())
{
if (! right.empty())
{
need_arrow = true;
right.append("->");
}
- if (installable_to_repository_constraint()->include_masked())
- right.append(stringify(installable_to_repository_constraint()->name()) + "??");
+ if (installable_to_repository_requirement()->include_masked())
+ right.append(stringify(installable_to_repository_requirement()->name()) + "??");
else
- right.append(stringify(installable_to_repository_constraint()->name()) + "?");
+ right.append(stringify(installable_to_repository_requirement()->name()) + "?");
}
- if (installable_to_path_constraint())
+ if (installable_to_path_requirement())
{
if (! right.empty())
{
need_arrow = true;
right.append("->");
}
- if (installable_to_path_constraint()->include_masked())
- right.append(stringify(installable_to_path_constraint()->path()) + "??");
+ if (installable_to_path_requirement()->include_masked())
+ right.append(stringify(installable_to_path_requirement()->path()) + "??");
else
- right.append(stringify(installable_to_path_constraint()->path()) + "?");
+ right.append(stringify(installable_to_path_requirement()->path()) + "?");
}
if (need_arrow || ((! left.empty()) && (! right.empty())))
@@ -315,12 +315,12 @@ PackageDepSpecData::as_string() const
else if (! left.empty())
s << "::" << left << "->";
- if (all_version_constraints())
+ if (all_version_requirements())
{
- if (all_version_constraints()->begin() == all_version_constraints()->end())
+ if (all_version_requirements()->begin() == all_version_requirements()->end())
{
}
- else if (next(all_version_constraints()->begin()) == all_version_constraints()->end() &&
+ else if (next(all_version_requirements()->begin()) == all_version_requirements()->end() &&
! options()[pdsdo_always_use_ranged_deps])
{
}
@@ -328,7 +328,7 @@ PackageDepSpecData::as_string() const
{
bool need_op(false);
s << "[";
- for (auto r(all_version_constraints()->begin()), r_end(all_version_constraints()->end()) ; r != r_end ; ++r)
+ for (auto r(all_version_requirements()->begin()), r_end(all_version_requirements()->end()) ; r != r_end ; ++r)
{
if (need_op)
{
@@ -336,15 +336,15 @@ PackageDepSpecData::as_string() const
{
switch ((*r)->combiner())
{
- case vcc_and:
+ case vrc_and:
s << "&";
continue;
- case vcc_or:
+ case vrc_or:
s << "|";
continue;
- case last_vcc:
+ case last_vrc:
;
}
throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
@@ -367,12 +367,12 @@ PackageDepSpecData::as_string() const
}
}
- if (all_choice_constraints())
- for (auto u(all_choice_constraints()->begin()), u_end(all_choice_constraints()->end()) ; u != u_end ; ++u)
+ if (all_choice_requirements())
+ for (auto u(all_choice_requirements()->begin()), u_end(all_choice_requirements()->end()) ; u != u_end ; ++u)
s << (*u)->as_raw_string();
- if (all_key_constraints())
- for (auto u(all_key_constraints()->begin()), u_end(all_key_constraints()->end()) ; u != u_end ; ++u)
+ if (all_key_requirements())
+ for (auto u(all_key_requirements()->begin()), u_end(all_key_requirements()->end()) ; u != u_end ; ++u)
s << (*u)->as_raw_string();
return s.str();
@@ -397,188 +397,188 @@ MutablePackageDepSpecData::MutablePackageDepSpecData(const MutablePackageDepSpec
MutablePackageDepSpecData::~MutablePackageDepSpecData() = default;
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_package(const QualifiedPackageName & name)
+MutablePackageDepSpecData::require_package(const QualifiedPackageName & name)
{
- _imp->package = NameConstraintPool::get_instance()->create(name);
+ _imp->package = NameRequirementPool::get_instance()->create(name);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_package()
+MutablePackageDepSpecData::unrequire_package()
{
_imp->package.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_package_name_part(const PackageNamePart & part)
+MutablePackageDepSpecData::require_package_name_part(const PackageNamePart & part)
{
- _imp->package_name_part = PackageNamePartConstraintPool::get_instance()->create(part);
+ _imp->package_name_part = PackageNamePartRequirementPool::get_instance()->create(part);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_package_name_part()
+MutablePackageDepSpecData::unrequire_package_name_part()
{
_imp->package_name_part.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_category_name_part(const CategoryNamePart & part)
+MutablePackageDepSpecData::require_category_name_part(const CategoryNamePart & part)
{
- _imp->category_name_part = CategoryNamePartConstraintPool::get_instance()->create(part);
+ _imp->category_name_part = CategoryNamePartRequirementPool::get_instance()->create(part);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_category_name_part()
+MutablePackageDepSpecData::unrequire_category_name_part()
{
_imp->category_name_part.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_version(const VersionConstraintCombiner vc, const VersionOperator & vo, const VersionSpec & vs)
+MutablePackageDepSpecData::require_version(const VersionRequirementCombiner vc, const VersionOperator & vo, const VersionSpec & vs)
{
if (! _imp->all_versions)
- _imp->all_versions = std::make_shared<VersionConstraintSequence>();
- _imp->all_versions->push_back(std::make_shared<VersionConstraint>(vs, vo, vc));
+ _imp->all_versions = std::make_shared<VersionRequirementSequence>();
+ _imp->all_versions->push_back(std::make_shared<VersionRequirement>(vs, vo, vc));
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_versions()
+MutablePackageDepSpecData::unrequire_versions()
{
_imp->all_versions.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_exact_slot(const SlotName & n, const bool s)
+MutablePackageDepSpecData::require_exact_slot(const SlotName & n, const bool s)
{
- _imp->exact_slot = ExactSlotConstraintPool::get_instance()->create(n, s);
+ _imp->exact_slot = ExactSlotRequirementPool::get_instance()->create(n, s);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_exact_slot()
+MutablePackageDepSpecData::unrequire_exact_slot()
{
_imp->exact_slot.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_in_repository(const RepositoryName & s)
+MutablePackageDepSpecData::require_in_repository(const RepositoryName & s)
{
- _imp->in_repository = InRepositoryConstraintPool::get_instance()->create(s);
+ _imp->in_repository = InRepositoryRequirementPool::get_instance()->create(s);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_in_repository()
+MutablePackageDepSpecData::unrequire_in_repository()
{
_imp->in_repository.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_installable_to_path(const FSPath & s, const bool i)
+MutablePackageDepSpecData::require_installable_to_path(const FSPath & s, const bool i)
{
- _imp->installable_to_path = InstallableToPathConstraintPool::get_instance()->create(s, i);
+ _imp->installable_to_path = InstallableToPathRequirementPool::get_instance()->create(s, i);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_installable_to_path()
+MutablePackageDepSpecData::unrequire_installable_to_path()
{
_imp->installable_to_path.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_installable_to_repository(const RepositoryName & n, const bool i)
+MutablePackageDepSpecData::require_installable_to_repository(const RepositoryName & n, const bool i)
{
- _imp->installable_to_repository = InstallableToRepositoryConstraintPool::get_instance()->create(n, i);
+ _imp->installable_to_repository = InstallableToRepositoryRequirementPool::get_instance()->create(n, i);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_installable_to_repository()
+MutablePackageDepSpecData::unrequire_installable_to_repository()
{
_imp->installable_to_repository.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_from_repository(const RepositoryName & n)
+MutablePackageDepSpecData::require_from_repository(const RepositoryName & n)
{
- _imp->from_repository = FromRepositoryConstraintPool::get_instance()->create(n);
+ _imp->from_repository = FromRepositoryRequirementPool::get_instance()->create(n);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_from_repository()
+MutablePackageDepSpecData::unrequire_from_repository()
{
_imp->from_repository.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_installed_at_path(const FSPath & s)
+MutablePackageDepSpecData::require_installed_at_path(const FSPath & s)
{
- _imp->installed_at_path = InstalledAtPathConstraintPool::get_instance()->create(s);
+ _imp->installed_at_path = InstalledAtPathRequirementPool::get_instance()->create(s);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_installed_at_path()
+MutablePackageDepSpecData::unrequire_installed_at_path()
{
_imp->installed_at_path.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_any_slot(const bool s)
+MutablePackageDepSpecData::require_any_slot(const bool s)
{
- _imp->any_slot = AnySlotConstraintPool::get_instance()->create(s);
+ _imp->any_slot = AnySlotRequirementPool::get_instance()->create(s);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_any_slot()
+MutablePackageDepSpecData::unrequire_any_slot()
{
_imp->any_slot.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_choice(const std::shared_ptr<const ChoiceConstraint> & c)
+MutablePackageDepSpecData::require_choice(const std::shared_ptr<const ChoiceRequirement> & c)
{
if (! _imp->all_choices)
- _imp->all_choices = std::make_shared<ChoiceConstraintSequence>();
+ _imp->all_choices = std::make_shared<ChoiceRequirementSequence>();
_imp->all_choices->push_back(c);
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_choices()
+MutablePackageDepSpecData::unrequire_choices()
{
_imp->all_choices.reset();
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::constrain_key(const KeyConstraintKeyType t, const std::string & k, const KeyConstraintOperation o, const std::string & p)
+MutablePackageDepSpecData::require_key(const KeyRequirementKeyType t, const std::string & k, const KeyRequirementOperation o, const std::string & p)
{
if (! _imp->all_keys)
- _imp->all_keys = std::make_shared<KeyConstraintSequence>();
- _imp->all_keys->push_back(KeyConstraintPool::get_instance()->create(t, k, o, p));
+ _imp->all_keys = std::make_shared<KeyRequirementSequence>();
+ _imp->all_keys->push_back(KeyRequirementPool::get_instance()->create(t, k, o, p));
return *this;
}
MutablePackageDepSpecData &
-MutablePackageDepSpecData::unconstrain_keys()
+MutablePackageDepSpecData::unrequire_keys()
{
_imp->all_keys.reset();
return *this;
diff --git a/paludis/dep_spec_data.hh b/paludis/dep_spec_data.hh
index 45cd81f..e0e9edf 100644
--- a/paludis/dep_spec_data.hh
+++ b/paludis/dep_spec_data.hh
@@ -27,7 +27,7 @@
#include <paludis/dep_spec-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
-#include <paludis/package_dep_spec_constraint-fwd.hh>
+#include <paludis/package_dep_spec_requirement-fwd.hh>
#include <paludis/version_spec-fwd.hh>
#include <paludis/util/attributes.hh>
@@ -119,111 +119,111 @@ namespace paludis
std::string as_string() const;
/**
- * Fetch the single NameConstraint, if we have one, or
+ * Fetch the single NameRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const NameConstraint> package_name_constraint() const
+ const std::shared_ptr<const NameRequirement> package_name_requirement() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch the single PackageNamePartConstraint, if we have one, or
+ * Fetch the single PackageNamePartRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const PackageNamePartConstraint> package_name_part_constraint() const
+ const std::shared_ptr<const PackageNamePartRequirement> package_name_part_requirement() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch the single CategoryNamePartConstraint, if we have one, or
+ * Fetch the single CategoryNamePartRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const CategoryNamePartConstraint> category_name_part_constraint() const
+ const std::shared_ptr<const CategoryNamePartRequirement> category_name_part_requirement() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch all our VersionConstraints, if we have any, or
+ * Fetch all our VersionRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const VersionConstraintSequence> all_version_constraints() const;
+ const std::shared_ptr<const VersionRequirementSequence> all_version_requirements() const;
/**
- * Fetch the single ExactSlotConstraint, if we have one, or
+ * Fetch the single ExactSlotRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const;
+ const std::shared_ptr<const ExactSlotRequirement> exact_slot_requirement() const;
/**
- * Fetch the single AnySlotConstraint, if we have one, or
+ * Fetch the single AnySlotRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const;
+ const std::shared_ptr<const AnySlotRequirement> any_slot_requirement() const;
/**
- * Fetch the single InRepositoryConstraint, if we have one, or
+ * Fetch the single InRepositoryRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InRepositoryConstraint> in_repository_constraint() const
+ const std::shared_ptr<const InRepositoryRequirement> in_repository_requirement() const
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch the single InstallableToRepositoryConstraint, if we have one, or
+ * Fetch the single InstallableToRepositoryRequirement, if we have one, or
*
* \since 0.61
*/
- const std::shared_ptr<const InstallableToRepositoryConstraint> installable_to_repository_constraint() const;
+ const std::shared_ptr<const InstallableToRepositoryRequirement> installable_to_repository_requirement() const;
/**
- * Fetch the single FromRepositoryConstraint, if we have one, or
+ * Fetch the single FromRepositoryRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const FromRepositoryConstraint> from_repository_constraint() const;
+ const std::shared_ptr<const FromRepositoryRequirement> from_repository_requirement() const;
/**
- * Fetch the single InstalledAtPathConstraint, if we have one, or
+ * Fetch the single InstalledAtPathRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InstalledAtPathConstraint> installed_at_path_constraint() const;
+ const std::shared_ptr<const InstalledAtPathRequirement> installed_at_path_requirement() const;
/**
- * Fetch the single InstallableToPathConstraint, if we have one, or
+ * Fetch the single InstallableToPathRequirement, if we have one, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const InstallableToPathConstraint> installable_to_path_constraint() const;
+ const std::shared_ptr<const InstallableToPathRequirement> installable_to_path_requirement() const;
/**
- * Fetch all our KeyConstraints, if we have any, or
+ * Fetch all our KeyRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const KeyConstraintSequence> all_key_constraints() const;
+ const std::shared_ptr<const KeyRequirementSequence> all_key_requirements() const;
/**
- * Fetch all our ChoiceConstraints, if we have any, or
+ * Fetch all our ChoiceRequirements, if we have any, or
* a null pointer otherwise.
*
* \since 0.61
*/
- const std::shared_ptr<const ChoiceConstraintSequence> all_choice_constraints() const;
+ const std::shared_ptr<const ChoiceRequirementSequence> all_choice_requirements() const;
/**
* Our options.
@@ -253,190 +253,190 @@ namespace paludis
~MutablePackageDepSpecData();
/**
- * Add a package constraint.
+ * Add a package requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_package(const QualifiedPackageName &);
+ MutablePackageDepSpecData & require_package(const QualifiedPackageName &);
/**
- * Clear any package constraints.
+ * Clear any package requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_package();
+ MutablePackageDepSpecData & unrequire_package();
/**
- * Add a package name part constraint.
+ * Add a package name part requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_package_name_part(const PackageNamePart &);
+ MutablePackageDepSpecData & require_package_name_part(const PackageNamePart &);
/**
- * Clear any package name part constraints.
+ * Clear any package name part requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_package_name_part();
+ MutablePackageDepSpecData & unrequire_package_name_part();
/**
- * Add a category name part constraint.
+ * Add a category name part requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_category_name_part(const CategoryNamePart &);
+ MutablePackageDepSpecData & require_category_name_part(const CategoryNamePart &);
/**
- * Clear any category name part constraints.
+ * Clear any category name part requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_category_name_part();
+ MutablePackageDepSpecData & unrequire_category_name_part();
/**
- * Add a version constraint.
+ * Add a version requirement.
*
* The combiner must be vcc_and if this is the first version
- * constraint.
+ * requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_version(const VersionConstraintCombiner, const VersionOperator &, const VersionSpec &);
+ MutablePackageDepSpecData & require_version(const VersionRequirementCombiner, const VersionOperator &, const VersionSpec &);
/**
- * Clear any version constraints.
+ * Clear any version requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_versions();
+ MutablePackageDepSpecData & unrequire_versions();
/**
- * Add an exact slot constraint.
+ * Add an exact slot requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_exact_slot(const SlotName &, const bool locked);
+ MutablePackageDepSpecData & require_exact_slot(const SlotName &, const bool locked);
/**
- * Clear any exact slot constraints.
+ * Clear any exact slot requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_exact_slot();
+ MutablePackageDepSpecData & unrequire_exact_slot();
/**
- * Add an in repository constraint.
+ * Add an in repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_in_repository(const RepositoryName &);
+ MutablePackageDepSpecData & require_in_repository(const RepositoryName &);
/**
- * Clear any in repository constraint.
+ * Clear any in repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_in_repository();
+ MutablePackageDepSpecData & unrequire_in_repository();
/**
- * Add an installable to path constraint.
+ * Add an installable to path requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_installable_to_path(const FSPath &, const bool);
+ MutablePackageDepSpecData & require_installable_to_path(const FSPath &, const bool);
/**
- * Clear any installable to path constraint.
+ * Clear any installable to path requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_installable_to_path();
+ MutablePackageDepSpecData & unrequire_installable_to_path();
/**
- * Add an installable to repository constraint.
+ * Add an installable to repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_installable_to_repository(const RepositoryName &, const bool);
+ MutablePackageDepSpecData & require_installable_to_repository(const RepositoryName &, const bool);
/**
- * Clear any installable to repository constraint.
+ * Clear any installable to repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_installable_to_repository();
+ MutablePackageDepSpecData & unrequire_installable_to_repository();
/**
- * Add a from repository constraint.
+ * Add a from repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_from_repository(const RepositoryName &);
+ MutablePackageDepSpecData & require_from_repository(const RepositoryName &);
/**
- * Clear any from repository constraint.
+ * Clear any from repository requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_from_repository();
+ MutablePackageDepSpecData & unrequire_from_repository();
/**
- * Add an installed at path constraint.
+ * Add an installed at path requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_installed_at_path(const FSPath &);
+ MutablePackageDepSpecData & require_installed_at_path(const FSPath &);
/**
- * Clear any installed at path constraint.
+ * Clear any installed at path requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_installed_at_path();
+ MutablePackageDepSpecData & unrequire_installed_at_path();
/**
- * Add an any slot constraint.
+ * Add an any slot requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_any_slot(const bool);
+ MutablePackageDepSpecData & require_any_slot(const bool);
/**
- * Clear our AnySlotConstraint, if we have one.
+ * Clear our AnySlotRequirement, if we have one.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_any_slot();
+ MutablePackageDepSpecData & unrequire_any_slot();
/**
- * Add a choice constraint.
+ * Add a choice requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_choice(const std::shared_ptr<const ChoiceConstraint> &);
+ MutablePackageDepSpecData & require_choice(const std::shared_ptr<const ChoiceRequirement> &);
/**
- * Clear any choice constraints.
+ * Clear any choice requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_choices();
+ MutablePackageDepSpecData & unrequire_choices();
/**
- * Add a key constraint.
+ * Add a key requirement.
*
* \return *this
*/
- MutablePackageDepSpecData & constrain_key(
- const KeyConstraintKeyType, const std::string &, const KeyConstraintOperation, const std::string &);
+ MutablePackageDepSpecData & require_key(
+ const KeyRequirementKeyType, const std::string &, const KeyRequirementOperation, const std::string &);
/**
- * Clear any key constraints.
+ * Clear any key requirements.
*
* \return *this
*/
- MutablePackageDepSpecData & unconstrain_keys();
+ MutablePackageDepSpecData & unrequire_keys();
/**
* Convert ourself to a PackageDepSpec.
diff --git a/paludis/elike_package_dep_spec-fwd.hh b/paludis/elike_package_dep_spec-fwd.hh
index 03cb1f8..ac5b48f 100644
--- a/paludis/elike_package_dep_spec-fwd.hh
+++ b/paludis/elike_package_dep_spec-fwd.hh
@@ -27,7 +27,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/version_operator-fwd.hh>
#include <paludis/version_spec-fwd.hh>
-#include <paludis/package_dep_spec_constraint-fwd.hh>
+#include <paludis/package_dep_spec_requirement-fwd.hh>
#include <paludis/dep_spec_data-fwd.hh>
#include <functional>
@@ -84,7 +84,7 @@ namespace paludis
void elike_add_version_requirement(
const VersionSpec & spec,
const VersionOperator & op,
- const VersionConstraintCombiner,
+ const VersionRequirementCombiner,
MutablePackageDepSpecData & result)
PALUDIS_VISIBLE;
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index c899b85..aa72130 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -62,7 +62,7 @@ paludis::partial_parse_generic_elike_package_dep_spec(const std::string & ss, co
/* Leading (or maybe =*) operator, so trailing version. */
VersionOperator op(fns.get_remove_version_operator()(s));
VersionSpec spec(fns.get_remove_trailing_version()(s));
- fns.add_version_requirement()(spec, op, vcc_and, result);
+ fns.add_version_requirement()(spec, op, vrc_and, result);
fns.add_package_requirement()(s, result);
}
else
@@ -139,8 +139,8 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Mutable
<< "Key requirements not safe for use here";
}
- auto k(parse_user_key_constraint(flag.substr(1)));
- result.constrain_key(std::get<0>(k), std::get<1>(k), std::get<2>(k), std::get<3>(k));
+ auto k(parse_user_key_requirement(flag.substr(1)));
+ result.require_key(std::get<0>(k), std::get<1>(k), std::get<2>(k), std::get<3>(k));
}
break;
@@ -180,7 +180,7 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Mutable
if (options[epdso_strict_parsing])
euro += euro_strict_parsing;
- result.constrain_choice(parse_elike_use_requirement(flag, euro));
+ result.require_choice(parse_elike_use_requirement(flag, euro));
break;
};
@@ -207,7 +207,7 @@ paludis::elike_remove_trailing_repo_if_exists(std::string & s, MutablePackageDep
<< "Repository dependencies not safe for use here";
}
- result.constrain_in_repository(RepositoryName(s.substr(repo_p + 2)));
+ result.require_in_repository(RepositoryName(s.substr(repo_p + 2)));
s.erase(repo_p);
}
@@ -233,7 +233,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, MutablePackageDep
Log::get_instance()->message("e.package_dep_spec.slot_star_not_allowed", ll_warning, lc_context)
<< "Slot '*' dependencies not safe for use here";
}
- result.constrain_any_slot(false);
+ result.require_any_slot(false);
}
else if ('=' == match.at(0))
{
@@ -247,9 +247,9 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, MutablePackageDep
}
if (1 == match.length())
- result.constrain_any_slot(true);
+ result.require_any_slot(true);
else
- result.constrain_exact_slot(SlotName(s.substr(slot_p + 2)), true);
+ result.require_exact_slot(SlotName(s.substr(slot_p + 2)), true);
}
else
{
@@ -261,7 +261,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, MutablePackageDep
Log::get_instance()->message("e.package_dep_spec.slot_not_allowed", ll_warning, lc_context)
<< "Slot dependencies not safe for use here";
}
- result.constrain_exact_slot(SlotName(s.substr(slot_p + 1)), false);
+ result.require_exact_slot(SlotName(s.substr(slot_p + 1)), false);
}
s.erase(slot_p);
}
@@ -373,10 +373,10 @@ void
paludis::elike_add_version_requirement(
const VersionSpec & ver,
const VersionOperator & op,
- const VersionConstraintCombiner vcc,
+ const VersionRequirementCombiner vrc,
MutablePackageDepSpecData & result)
{
- result.constrain_version(vcc, op, ver);
+ result.require_version(vrc, op, ver);
}
void
@@ -390,16 +390,16 @@ paludis::elike_add_package_requirement(const std::string & s, MutablePackageDepS
throw PackageDepSpecError("Wildcard '*' not allowed here");
if (0 != s.compare(s.length() - 2, 2, "/*"))
- result.constrain_package_name_part(PackageNamePart(s.substr(2)));
+ result.require_package_name_part(PackageNamePart(s.substr(2)));
}
else if (s.length() >= 3 && (0 == s.compare(s.length() - 2, 2, "/*")))
{
throw PackageDepSpecError("Wildcard '*' not allowed here");
- result.constrain_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
+ result.require_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
}
else
- result.constrain_package(QualifiedPackageName(s));
+ result.require_package(QualifiedPackageName(s));
}
MutablePackageDepSpecData
@@ -449,12 +449,12 @@ paludis::parse_elike_version_range(
bool & had_bracket_version_requirements)
{
std::string flag(s);
- VersionConstraintCombiner vcc(vcc_and);
+ VersionRequirementCombiner vrc(vrc_and);
while (! flag.empty())
{
Context cc("When parsing [] segment '" + flag + "':");
- VersionConstraintCombiner next_vcc(vcc);
+ VersionRequirementCombiner next_vrc(vrc);
std::string op;
std::string::size_type opos(0);
@@ -481,7 +481,7 @@ paludis::parse_elike_version_range(
}
else
{
- next_vcc = (flag.at(opos) == '|' ? vcc_or : vcc_and);
+ next_vrc = (flag.at(opos) == '|' ? vrc_or : vrc_and);
ver = flag.substr(0, opos++);
flag.erase(0, opos);
}
@@ -499,9 +499,9 @@ paludis::parse_elike_version_range(
}
VersionSpec vs(ver, version_options);
- result.constrain_version(vcc, vop, vs);
+ result.require_version(vrc, vop, vs);
had_bracket_version_requirements = true;
- vcc = next_vcc;
+ vrc = next_vrc;
}
}
diff --git a/paludis/elike_package_dep_spec.hh b/paludis/elike_package_dep_spec.hh
index 54d6478..7f35f73 100644
--- a/paludis/elike_package_dep_spec.hh
+++ b/paludis/elike_package_dep_spec.hh
@@ -47,7 +47,7 @@ namespace paludis
NamedValue<n::add_version_requirement, std::function<void (
const VersionSpec &,
const VersionOperator &,
- const VersionConstraintCombiner,
+ const VersionRequirementCombiner,
MutablePackageDepSpecData &)> > add_version_requirement;
NamedValue<n::check_sanity, std::function<void (const std::string &)> > check_sanity;
NamedValue<n::get_remove_trailing_version, std::function<VersionSpec (std::string &)> > get_remove_trailing_version;
diff --git a/paludis/elike_use_requirement-fwd.hh b/paludis/elike_use_requirement-fwd.hh
index 22c0260..52b9645 100644
--- a/paludis/elike_use_requirement-fwd.hh
+++ b/paludis/elike_use_requirement-fwd.hh
@@ -24,7 +24,7 @@
#include <paludis/util/options-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
-#include <paludis/package_dep_spec_constraint-fwd.hh>
+#include <paludis/package_dep_spec_requirement-fwd.hh>
#include <iosfwd>
#include <string>
#include <memory>
@@ -37,7 +37,7 @@ namespace paludis
typedef Options<ELikeUseRequirementOption> ELikeUseRequirementOptions;
- std::shared_ptr<const ChoiceConstraint> parse_elike_use_requirement(
+ std::shared_ptr<const ChoiceRequirement> parse_elike_use_requirement(
const std::string &, const ELikeUseRequirementOptions &)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
}
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 422baf1..8808a84 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -25,7 +25,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/choice.hh>
#include <paludis/changed_choices.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
@@ -500,7 +500,7 @@ namespace
};
class UseRequirements :
- public ChoiceConstraint
+ public ChoiceRequirement
{
private:
typedef std::vector<std::shared_ptr<const UseRequirement> > Reqs;
@@ -811,7 +811,7 @@ ELikeUseRequirementError::ELikeUseRequirementError(const std::string & s, const
{
}
-std::shared_ptr<const ChoiceConstraint>
+std::shared_ptr<const ChoiceRequirement>
paludis::parse_elike_use_requirement(const std::string & s,
const ELikeUseRequirementOptions & options)
{
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index ddfc7dd..184b819 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -21,7 +21,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/elike_use_requirement.hh>
#include <paludis/choice.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -68,25 +68,25 @@ TEST(ELikeUseRequirements, Simple)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("enabled", { euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("disabled", { euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req3(
+ std::shared_ptr<const ChoiceRequirement> req3(
parse_elike_use_requirement("-enabled", { euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req4(
+ std::shared_ptr<const ChoiceRequirement> req4(
parse_elike_use_requirement("-disabled", { euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(make_null_shared_ptr()));
@@ -104,25 +104,25 @@ TEST(ELikeUseRequirements, Portage)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req3(
+ std::shared_ptr<const ChoiceRequirement> req3(
parse_elike_use_requirement("-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req4(
+ std::shared_ptr<const ChoiceRequirement> req4(
parse_elike_use_requirement("-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(make_null_shared_ptr()));
@@ -140,31 +140,31 @@ TEST(ELikeUseRequirements, Multiple)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("enabled,disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req3(
+ std::shared_ptr<const ChoiceRequirement> req3(
parse_elike_use_requirement("-enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled,-disabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled; Flag 'disabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req4(
+ std::shared_ptr<const ChoiceRequirement> req4(
parse_elike_use_requirement("enabled,-disabled,-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,-enabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled", req4->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req5(
+ std::shared_ptr<const ChoiceRequirement> req5(
parse_elike_use_requirement("enabled,-disabled,enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,enabled]", req5->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled", req5->as_human_string(make_null_shared_ptr()));
@@ -184,84 +184,84 @@ TEST(ELikeUseRequirements, Complex)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
set_conditionals(id2, "pkgname");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req3(
+ std::shared_ptr<const ChoiceRequirement> req3(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req3->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req3->as_human_string(id));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req3->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req4(
+ std::shared_ptr<const ChoiceRequirement> req4(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req4->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req4->as_human_string(id2));
EXPECT_TRUE(req4->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req4->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req5(
+ std::shared_ptr<const ChoiceRequirement> req5(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req5->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req5->as_human_string(id));
EXPECT_TRUE(req5->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req5->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req6(
+ std::shared_ptr<const ChoiceRequirement> req6(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req6->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req6->as_human_string(id2));
EXPECT_TRUE(req6->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req6->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req7(
+ std::shared_ptr<const ChoiceRequirement> req7(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req8(
+ std::shared_ptr<const ChoiceRequirement> req8(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req9(
+ std::shared_ptr<const ChoiceRequirement> req9(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req10(
+ std::shared_ptr<const ChoiceRequirement> req10(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req11(
+ std::shared_ptr<const ChoiceRequirement> req11(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req12(
+ std::shared_ptr<const ChoiceRequirement> req12(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
@@ -282,56 +282,56 @@ TEST(ELikeUseRequirements, ComplexPortage)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
set_conditionals(id2, "pkgname");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req7(
+ std::shared_ptr<const ChoiceRequirement> req7(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req8(
+ std::shared_ptr<const ChoiceRequirement> req8(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req9(
+ std::shared_ptr<const ChoiceRequirement> req9(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req10(
+ std::shared_ptr<const ChoiceRequirement> req10(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req11(
+ std::shared_ptr<const ChoiceRequirement> req11(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req12(
+ std::shared_ptr<const ChoiceRequirement> req12(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
@@ -352,112 +352,112 @@ TEST(ELikeUseRequirements, Both)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
set_conditionals(id2, "pkgname");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req7(
+ std::shared_ptr<const ChoiceRequirement> req7(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req8(
+ std::shared_ptr<const ChoiceRequirement> req8(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req9(
+ std::shared_ptr<const ChoiceRequirement> req9(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req10(
+ std::shared_ptr<const ChoiceRequirement> req10(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req11(
+ std::shared_ptr<const ChoiceRequirement> req11(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req12(
+ std::shared_ptr<const ChoiceRequirement> req12(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req13(
+ std::shared_ptr<const ChoiceRequirement> req13(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req14(
+ std::shared_ptr<const ChoiceRequirement> req14(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req15(
+ std::shared_ptr<const ChoiceRequirement> req15(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req16(
+ std::shared_ptr<const ChoiceRequirement> req16(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req17(
+ std::shared_ptr<const ChoiceRequirement> req17(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req18(
+ std::shared_ptr<const ChoiceRequirement> req18(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req19(
+ std::shared_ptr<const ChoiceRequirement> req19(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req20(
+ std::shared_ptr<const ChoiceRequirement> req20(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
@@ -556,112 +556,112 @@ TEST(ELikeUseRequirements, ComplexNonStrict)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
set_conditionals(id2, "pkgname");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req7(
+ std::shared_ptr<const ChoiceRequirement> req7(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req8(
+ std::shared_ptr<const ChoiceRequirement> req8(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req9(
+ std::shared_ptr<const ChoiceRequirement> req9(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req10(
+ std::shared_ptr<const ChoiceRequirement> req10(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req11(
+ std::shared_ptr<const ChoiceRequirement> req11(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req12(
+ std::shared_ptr<const ChoiceRequirement> req12(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req13(
+ std::shared_ptr<const ChoiceRequirement> req13(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req14(
+ std::shared_ptr<const ChoiceRequirement> req14(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req15(
+ std::shared_ptr<const ChoiceRequirement> req15(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req16(
+ std::shared_ptr<const ChoiceRequirement> req16(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req17(
+ std::shared_ptr<const ChoiceRequirement> req17(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req18(
+ std::shared_ptr<const ChoiceRequirement> req18(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req19(
+ std::shared_ptr<const ChoiceRequirement> req19(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req20(
+ std::shared_ptr<const ChoiceRequirement> req20(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
@@ -682,112 +682,112 @@ TEST(ELikeUseRequirements, PortageNonStrict)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
set_conditionals(id2, "pkgname");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req7(
+ std::shared_ptr<const ChoiceRequirement> req7(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req8(
+ std::shared_ptr<const ChoiceRequirement> req8(
parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req9(
+ std::shared_ptr<const ChoiceRequirement> req9(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req10(
+ std::shared_ptr<const ChoiceRequirement> req10(
parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req11(
+ std::shared_ptr<const ChoiceRequirement> req11(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req12(
+ std::shared_ptr<const ChoiceRequirement> req12(
parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req13(
+ std::shared_ptr<const ChoiceRequirement> req13(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req14(
+ std::shared_ptr<const ChoiceRequirement> req14(
parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req15(
+ std::shared_ptr<const ChoiceRequirement> req15(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req16(
+ std::shared_ptr<const ChoiceRequirement> req16(
parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req17(
+ std::shared_ptr<const ChoiceRequirement> req17(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req18(
+ std::shared_ptr<const ChoiceRequirement> req18(
parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req19(
+ std::shared_ptr<const ChoiceRequirement> req19(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req20(
+ std::shared_ptr<const ChoiceRequirement> req20(
parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
@@ -806,25 +806,25 @@ TEST(ELikeUseRequirements, Defaults)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(+)]", req1->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming enabled if missing", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(-)]", req2->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming disabled if missing", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req3(
+ std::shared_ptr<const ChoiceRequirement> req3(
parse_elike_use_requirement("-missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(+)]", req3->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming enabled if missing", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
- std::shared_ptr<const ChoiceConstraint> req4(
+ std::shared_ptr<const ChoiceRequirement> req4(
parse_elike_use_requirement("-missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(-)]", req4->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming disabled if missing", req4->as_human_string(make_null_shared_ptr()));
@@ -842,12 +842,12 @@ TEST(ELikeUseRequirements, PrefixStar)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "foo:enabled foo:disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("foo:*", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*]", req1->as_raw_string());
EXPECT_TRUE(! req1->requirement_met(&env, 0, id, id, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("foo:*=", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*=]", req2->as_raw_string());
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id, 0).first);
@@ -868,13 +868,13 @@ TEST(ELikeUseRequirements, QuestionDefaults)
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "pkg2", "1"));
set_conditionals(id2, "foo:enabled foo:disabled bar:enabled bar:disabled");
- std::shared_ptr<const ChoiceConstraint> req1(
+ std::shared_ptr<const ChoiceRequirement> req1(
parse_elike_use_requirement("foo:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[foo:*(?)=]", req1->as_raw_string());
EXPECT_TRUE(req1->requirement_met(&env, 0, id2, id2, 0).first);
EXPECT_TRUE(req1->requirement_met(&env, 0, id1, id2, 0).first);
- std::shared_ptr<const ChoiceConstraint> req2(
+ std::shared_ptr<const ChoiceRequirement> req2(
parse_elike_use_requirement("bar:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[bar:*(?)=]", req2->as_raw_string());
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index cfcf7e1..f4e6455 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -516,7 +516,7 @@ EnvironmentImplementation::fetch_unique_qualified_package_name(const PackageName
std::set<std::pair<CategoryNamePart, RepositoryName>, CategoryRepositoryNamePairComparator> checked;
std::shared_ptr<const PackageIDSequence> pkgs((*this)[selection::AllVersionsUnsorted(
- generator::Matches(MutablePackageDepSpecData({ }).constrain_package_name_part(p), make_null_shared_ptr(), { }) | f)]);
+ generator::Matches(MutablePackageDepSpecData({ }).require_package_name_part(p), make_null_shared_ptr(), { }) | f)]);
for (IndirectIterator<PackageIDSequence::ConstIterator> it(pkgs->begin()),
it_end(pkgs->end()); it_end != it; ++it)
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index dd90b23..4618078 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -28,7 +28,7 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/match_package.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
@@ -108,9 +108,9 @@ KeywordsConf::add(const FSPath & filename)
{
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env, { updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_name_constraint())
+ if (d->package_name_requirement())
{
- KeywordsList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
+ KeywordsList & k(_imp->qualified[d->package_name_requirement()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(KeywordName(*t));
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 70b2748..6c4a15c 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -29,7 +29,7 @@
#include <paludis/match_package.hh>
#include <paludis/util/config_file.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
@@ -108,9 +108,9 @@ LicensesConf::add(const FSPath & filename)
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
{ updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_name_constraint())
+ if (d->package_name_requirement())
{
- LicensesList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
+ LicensesList & k(_imp->qualified[d->package_name_requirement()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(*t);
diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc
index 1eafbf1..4289dc6 100644
--- a/paludis/environments/paludis/suggestions_conf.cc
+++ b/paludis/environments/paludis/suggestions_conf.cc
@@ -41,7 +41,7 @@
#include <paludis/match_package.hh>
#include <paludis/package_id.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <unordered_map>
#include <list>
@@ -150,9 +150,9 @@ SuggestionsConf::add(const FSPath & filename)
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
{ updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->package_name_constraint())
+ if (d->package_name_requirement())
{
- ValuesList & k(_imp->qualified[d->package_name_constraint()->name()][d]);
+ ValuesList & k(_imp->qualified[d->package_name_requirement()->name()][d]);
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
k.push_back(ValueFlag(*t));
@@ -212,10 +212,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_requirement()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
+ if (stringify(spec.package_name_requirement()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;
@@ -256,10 +256,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_requirement()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
+ if (stringify(spec.package_name_requirement()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;
@@ -287,10 +287,10 @@ SuggestionsConf::interest_in_suggestion(
else
{
if (! l->pkg_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().package()) != l->pkg_requirement)
+ if (stringify(spec.package_name_requirement()->name().package()) != l->pkg_requirement)
continue;
if (! l->cat_requirement.empty())
- if (stringify(spec.package_name_constraint()->name().category()) != l->cat_requirement)
+ if (stringify(spec.package_name_requirement()->name().category()) != l->cat_requirement)
continue;
return l->negated ? false : true;
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index a3de07a..3256925 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -171,8 +171,8 @@ World::update_config_files_for_package_move(const PackageDepSpec & s, const Qual
if (_remove_string_from_world(stringify(s)))
_add_string_to_world(stringify(
MutablePackageDepSpecData(*s.data())
- .unconstrain_package()
- .constrain_package(n)));
+ .unrequire_package()
+ .require_package(n)));
}
const std::shared_ptr<const SetSpecTree>
diff --git a/paludis/environments/paludis/world_TEST.cc b/paludis/environments/paludis/world_TEST.cc
index 0b5d565..d3b572f 100644
--- a/paludis/environments/paludis/world_TEST.cc
+++ b/paludis/environments/paludis/world_TEST.cc
@@ -40,7 +40,7 @@ TEST(World, Updates)
TestEnvironment env;
paludis_environment::World world(&env, w);
world.update_config_files_for_package_move(MutablePackageDepSpecData({ })
- .constrain_package(QualifiedPackageName("cat/before")),
+ .require_package(QualifiedPackageName("cat/before")),
QualifiedPackageName("cat/after"));
}
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 0a86a28..5899a7b 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -388,7 +388,7 @@ PortageEnvironment::_load_atom_file(const FSPath & f, I_ i, const std::string &
std::shared_ptr<PackageDepSpec> p(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), this, UserPackageDepSpecOptions() + updso_no_disambiguation)));
- if (reject_choices && p->all_choice_constraints() && ! p->all_choice_constraints()->empty())
+ if (reject_choices && p->all_choice_requirements() && ! p->all_choice_requirements()->empty())
{
Log::get_instance()->message("portage_environment.bad_spec", ll_warning, lc_context)
<< "Dependency specification '" << stringify(*p)
@@ -941,8 +941,8 @@ PortageEnvironment::update_config_files_for_package_move(const PackageDepSpec &
if (_remove_string_from_world(stringify(s)))
_add_string_to_world(stringify(
MutablePackageDepSpecData(*s.data())
- .unconstrain_package()
- .constrain_package(n)));
+ .unrequire_package()
+ .require_package(n)));
}
void
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index db06a6f..113a4e1 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -178,7 +178,7 @@ TEST(PortageEnvironment, World)
FSPath w(FSPath::cwd() / "portage_environment_TEST_dir" / "world" / "var" / "lib" / "portage" / "world");
env.update_config_files_for_package_move(MutablePackageDepSpecData({ })
- .constrain_package(QualifiedPackageName("cat/before")),
+ .require_package(QualifiedPackageName("cat/before")),
QualifiedPackageName("cat/after"));
SafeIFStream f(w);
diff --git a/paludis/files.m4 b/paludis/files.m4
index 3a67ff2..0eda506 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -74,8 +74,8 @@ add(`output_manager', `hh', `fwd', `cc', `se')
add(`output_manager_factory', `hh', `fwd', `cc')
add(`output_manager_from_environment', `hh', `fwd', `cc')
add(`package_dep_spec_collection', `hh', `cc', `fwd')
-add(`package_dep_spec_constraint', `hh', `cc', `fwd', `se')
add(`package_dep_spec_properties', `hh', `cc', `fwd')
+add(`package_dep_spec_requirement', `hh', `cc', `fwd', `se')
add(`package_id', `hh', `cc', `fwd', `se')
add(`paludis', `hh')
add(`paludislike_options_conf', `hh', `cc', `fwd')
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 787dd9e..1ccf0da 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -467,8 +467,8 @@ namespace
virtual std::string as_string() const
{
std::string suffix;
- if (options[mpo_ignore_choice_constraints])
- suffix = " (ignoring choice constraints)";
+ if (options[mpo_ignore_choice_requirements])
+ suffix = " (ignoring choice requirements)";
return "packages matching " + stringify(spec) + suffix;
}
};
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index ce0a193..efcd8ae 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -28,7 +28,7 @@
#include <paludis/filter_handler.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
@@ -144,17 +144,17 @@ FuzzyCandidatesFinder::FuzzyCandidatesFinder(const Environment & e, const std::s
{
PackageDepSpec pds(parse_user_package_dep_spec(name, &e, { }));
- if (pds.package_name_constraint())
+ if (pds.package_name_requirement())
{
- g = g & generator::Category(pds.package_name_constraint()->name().category());
- package = stringify(pds.package_name_constraint()->name().package());
+ g = g & generator::Category(pds.package_name_requirement()->name().category());
+ package = stringify(pds.package_name_requirement()->name().package());
}
- if (pds.in_repository_constraint())
- g = g & generator::InRepository(pds.in_repository_constraint()->name());
+ if (pds.in_repository_requirement())
+ g = g & generator::InRepository(pds.in_repository_requirement()->name());
- if (pds.from_repository_constraint())
- g = g & generator::FromRepository(pds.from_repository_constraint()->name());
+ if (pds.from_repository_requirement())
+ g = g & generator::FromRepository(pds.from_repository_requirement()->name());
}
std::shared_ptr<const PackageIDSequence> ids(e[selection::BestVersionOnly(g | FuzzyPackageName(package) | filter)]);
diff --git a/paludis/generator.cc b/paludis/generator.cc
index b1e8817..ef3932c 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -29,7 +29,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/repository.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/set.hh>
@@ -305,44 +305,44 @@ namespace
const RepositoryContentMayExcludes & x) const
{
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_constraint() = indeterminate,
+ n::has_any_slot_requirement() = indeterminate,
n::has_category_name_part() = indeterminate,
- n::has_choice_constraints() = indeterminate,
- n::has_exact_slot_constraint() = indeterminate,
+ n::has_choice_requirements() = indeterminate,
+ n::has_exact_slot_requirement() = indeterminate,
n::has_from_repository() = indeterminate,
n::has_in_repository() = false,
n::has_installable_to_path() = indeterminate,
n::has_installable_to_repository() = indeterminate,
n::has_installed_at_path() = false,
- n::has_key_constraints() = indeterminate,
+ n::has_key_requirements() = indeterminate,
n::has_package() = indeterminate,
n::has_package_name_part() = indeterminate,
n::has_tag() = indeterminate,
- n::has_version_constraints() = indeterminate
+ n::has_version_requirements() = indeterminate
)))
return AllGeneratorHandlerBase::repositories(env, x);
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- if (spec.in_repository_constraint())
+ if (spec.in_repository_requirement())
{
- if (env->has_repository_named(spec.in_repository_constraint()->name()))
+ if (env->has_repository_named(spec.in_repository_requirement()->name()))
{
- if (spec.installed_at_path_constraint())
+ if (spec.installed_at_path_requirement())
{
- std::shared_ptr<const Repository> repo(env->fetch_repository(spec.in_repository_constraint()->name()));
+ std::shared_ptr<const Repository> repo(env->fetch_repository(spec.in_repository_requirement()->name()));
if (! repo->installed_root_key())
return result;
- if (repo->installed_root_key()->value() != spec.installed_at_path_constraint()->path())
+ if (repo->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
return result;
}
- result->insert(spec.in_repository_constraint()->name());
+ result->insert(spec.in_repository_requirement()->name());
}
}
else
{
- if (spec.installed_at_path_constraint())
+ if (spec.installed_at_path_requirement())
{
for (auto i(env->begin_repositories()),
i_end(env->end_repositories()) ; i != i_end ; ++i)
@@ -350,7 +350,7 @@ namespace
if (! (*i)->installed_root_key())
continue;
- if ((*i)->installed_root_key()->value() != spec.installed_at_path_constraint()->path())
+ if ((*i)->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
continue;
result->insert((*i)->name());
@@ -368,40 +368,40 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos,
const RepositoryContentMayExcludes & x) const
{
- if (spec.category_name_part_constraint())
+ if (spec.category_name_part_requirement())
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->fetch_repository(*r)->has_category_named(spec.category_name_part_constraint()->name_part(), x))
+ if (env->fetch_repository(*r)->has_category_named(spec.category_name_part_requirement()->name_part(), x))
{
- result->insert(spec.category_name_part_constraint()->name_part());
+ result->insert(spec.category_name_part_requirement()->name_part());
break;
}
return result;
}
- else if (spec.package_name_part_constraint())
+ else if (spec.package_name_part_requirement())
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
std::shared_ptr<const CategoryNamePartSet> cats(
- env->fetch_repository(*r)->category_names_containing_package(spec.package_name_part_constraint()->name_part(), x));
+ env->fetch_repository(*r)->category_names_containing_package(spec.package_name_part_requirement()->name_part(), x));
std::copy(cats->begin(), cats->end(), result->inserter());
}
return result;
}
- else if (spec.package_name_constraint())
+ else if (spec.package_name_requirement())
{
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->fetch_repository(*r)->has_category_named(spec.package_name_constraint()->name().category(), x))
+ if (env->fetch_repository(*r)->has_category_named(spec.package_name_requirement()->name().category(), x))
{
- result->insert(spec.package_name_constraint()->name().category());
+ result->insert(spec.package_name_requirement()->name().category());
break;
}
@@ -417,26 +417,26 @@ namespace
const std::shared_ptr<const CategoryNamePartSet> & cats,
const RepositoryContentMayExcludes & x) const
{
- if (spec.package_name_part_constraint())
+ if (spec.package_name_part_requirement())
{
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (env->fetch_repository(*r)->has_package_named(*c + spec.package_name_part_constraint()->name_part(), x))
- result->insert(*c + spec.package_name_part_constraint()->name_part());
+ if (env->fetch_repository(*r)->has_package_named(*c + spec.package_name_part_requirement()->name_part(), x))
+ result->insert(*c + spec.package_name_part_requirement()->name_part());
return result;
}
- else if (spec.package_name_constraint())
+ else if (spec.package_name_requirement())
{
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->fetch_repository(*r)->has_package_named(spec.package_name_constraint()->name(), x))
+ if (env->fetch_repository(*r)->has_package_named(spec.package_name_requirement()->name(), x))
{
- result->insert(spec.package_name_constraint()->name());
+ result->insert(spec.package_name_requirement()->name());
break;
}
@@ -475,8 +475,8 @@ namespace
virtual std::string as_string() const
{
std::string suffix;
- if (options[mpo_ignore_choice_constraints])
- suffix = " (ignoring choice constraints)";
+ if (options[mpo_ignore_choice_requirements])
+ suffix = " (ignoring choice requirements)";
return "packages matching " + stringify(spec) + suffix;
}
};
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 8e92d7c..d15aca5 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -25,7 +25,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/contents.hh>
#include <paludis/version_operator.hh>
@@ -59,29 +59,29 @@ paludis::match_package_with_maybe_changes(
const ChangedChoices * const maybe_changes_to_target,
const MatchPackageOptions & options)
{
- if (spec.package_name_constraint() && spec.package_name_constraint()->name() != id->name())
+ if (spec.package_name_requirement() && spec.package_name_requirement()->name() != id->name())
return false;
- if (spec.package_name_part_constraint() && spec.package_name_part_constraint()->name_part() != id->name().package())
+ if (spec.package_name_part_requirement() && spec.package_name_part_requirement()->name_part() != id->name().package())
return false;
- if (spec.category_name_part_constraint() && spec.category_name_part_constraint()->name_part() != id->name().category())
+ if (spec.category_name_part_requirement() && spec.category_name_part_requirement()->name_part() != id->name().category())
return false;
- if (spec.all_version_constraints())
+ if (spec.all_version_requirements())
{
bool ok(true);
- for (auto r(spec.all_version_constraints()->begin()), r_end(spec.all_version_constraints()->end()) ;
+ for (auto r(spec.all_version_requirements()->begin()), r_end(spec.all_version_requirements()->end()) ;
r != r_end ; ++r)
{
bool one((*r)->version_operator().as_version_spec_comparator()(id->version(), (*r)->version_spec()));
switch ((*r)->combiner())
{
- case vcc_and: ok &= one; break;
- case vcc_or: ok |= one; break;
- case last_vcc: throw InternalError(PALUDIS_HERE, "Bad vcc");
+ case vrc_and: ok &= one; break;
+ case vrc_or: ok |= one; break;
+ case last_vrc: throw InternalError(PALUDIS_HERE, "Bad vrc");
}
}
@@ -89,50 +89,50 @@ paludis::match_package_with_maybe_changes(
return false;
}
- if (spec.in_repository_constraint())
- if (spec.in_repository_constraint()->name() != id->repository_name())
+ if (spec.in_repository_requirement())
+ if (spec.in_repository_requirement()->name() != id->repository_name())
return false;
- if (spec.from_repository_constraint())
+ if (spec.from_repository_requirement())
{
if (! id->from_repositories_key())
return false;
if (id->from_repositories_key()->value()->end() == id->from_repositories_key()->value()->find(
- stringify(spec.from_repository_constraint()->name())))
+ stringify(spec.from_repository_requirement()->name())))
return false;
}
- if (spec.installed_at_path_constraint())
+ if (spec.installed_at_path_requirement())
{
auto repo(env.fetch_repository(id->repository_name()));
if (! repo->installed_root_key())
return false;
- if (repo->installed_root_key()->value() != spec.installed_at_path_constraint()->path())
+ if (repo->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
return false;
}
- if (spec.installable_to_repository_constraint())
+ if (spec.installable_to_repository_requirement())
{
if (! id->supports_action(SupportsActionTest<InstallAction>()))
return false;
- if (! spec.installable_to_repository_constraint()->include_masked())
+ if (! spec.installable_to_repository_requirement()->include_masked())
if (id->masked())
return false;
const std::shared_ptr<const Repository> dest(env.fetch_repository(
- spec.installable_to_repository_constraint()->name()));
+ spec.installable_to_repository_requirement()->name()));
if (! dest->destination_interface())
return false;
if (! dest->destination_interface()->is_suitable_destination_for(id))
return false;
}
- if (spec.installable_to_path_constraint())
+ if (spec.installable_to_path_requirement())
{
if (! id->supports_action(SupportsActionTest<InstallAction>()))
return false;
- if (! spec.installable_to_path_constraint()->include_masked())
+ if (! spec.installable_to_path_requirement()->include_masked())
if (id->masked())
return false;
@@ -144,7 +144,7 @@ paludis::match_package_with_maybe_changes(
continue;
if (! (*d)->installed_root_key())
continue;
- if ((*d)->installed_root_key()->value() != spec.installable_to_path_constraint()->path())
+ if ((*d)->installed_root_key()->value() != spec.installable_to_path_requirement()->path())
continue;
if (! (*d)->destination_interface()->is_suitable_destination_for(id))
continue;
@@ -157,31 +157,31 @@ paludis::match_package_with_maybe_changes(
return false;
}
- if (spec.exact_slot_constraint())
+ if (spec.exact_slot_requirement())
{
- if ((! id->slot_key()) || (id->slot_key()->value() != spec.exact_slot_constraint()->name()))
+ if ((! id->slot_key()) || (id->slot_key()->value() != spec.exact_slot_requirement()->name()))
return false;
}
- if (spec.any_slot_constraint())
+ if (spec.any_slot_requirement())
{
/* don't care */
}
- if (! options[mpo_ignore_choice_constraints])
+ if (! options[mpo_ignore_choice_requirements])
{
- if (spec.all_choice_constraints())
+ if (spec.all_choice_requirements())
{
- for (auto u(spec.all_choice_constraints()->begin()), u_end(spec.all_choice_constraints()->end()) ;
+ for (auto u(spec.all_choice_requirements()->begin()), u_end(spec.all_choice_requirements()->end()) ;
u != u_end ; ++u)
if (! (*u)->requirement_met(&env, maybe_changes_to_owner, id, from_id, maybe_changes_to_target).first)
return false;
}
}
- if (spec.all_key_constraints())
+ if (spec.all_key_requirements())
{
- for (auto c(spec.all_key_constraints()->begin()), c_end(spec.all_key_constraints()->end()) ;
+ for (auto c(spec.all_key_requirements()->begin()), c_end(spec.all_key_requirements()->end()) ;
c != c_end ; ++c)
if (! (*c)->matches(&env, id))
return false;
diff --git a/paludis/match_package.se b/paludis/match_package.se
index a98ca1d..5c449ff 100644
--- a/paludis/match_package.se
+++ b/paludis/match_package.se
@@ -6,7 +6,7 @@ make_enum_MatchPackageOption()
prefix mpo
want_destringify
- key mpo_ignore_choice_constraints "Ignore choice constraints"
+ key mpo_ignore_choice_requirements "Ignore choice requirements"
doxygen_comment << "END"
/**
diff --git a/paludis/package_dep_spec_collection.cc b/paludis/package_dep_spec_collection.cc
index f09cba5..c46dc21 100644
--- a/paludis/package_dep_spec_collection.cc
+++ b/paludis/package_dep_spec_collection.cc
@@ -22,7 +22,7 @@
#include <paludis/package_id.hh>
#include <paludis/dep_spec.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <list>
#include <map>
@@ -54,8 +54,8 @@ PackageDepSpecCollection::~PackageDepSpecCollection() = default;
void
PackageDepSpecCollection::insert(const PackageDepSpec & spec)
{
- if (spec.package_name_constraint())
- _imp->by_name.insert(std::make_pair(spec.package_name_constraint()->name(), spec));
+ if (spec.package_name_requirement())
+ _imp->by_name.insert(std::make_pair(spec.package_name_requirement()->name(), spec));
else
_imp->unnamed.push_back(spec);
}
diff --git a/paludis/package_dep_spec_constraint-fwd.hh b/paludis/package_dep_spec_constraint-fwd.hh
deleted file mode 100644
index fecc8fa..0000000
--- a/paludis/package_dep_spec_constraint-fwd.hh
+++ /dev/null
@@ -1,80 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2011 Ciaran McCreesh
- *
- * 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_CONSTRAINT_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_CONSTRAINT_FWD_HH 1
-
-#include <paludis/util/pool-fwd.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/sequence-fwd.hh>
-#include <iosfwd>
-#include <memory>
-
-namespace paludis
-{
- class PackageDepSpecConstraint;
-
- class NameConstraint;
- typedef Pool<NameConstraint> NameConstraintPool;
-
- class PackageNamePartConstraint;
- typedef Pool<PackageNamePartConstraint> PackageNamePartConstraintPool;
-
- class CategoryNamePartConstraint;
- typedef Pool<CategoryNamePartConstraint> CategoryNamePartConstraintPool;
-
- class VersionConstraint;
-
- typedef Sequence<std::shared_ptr<const VersionConstraint> > VersionConstraintSequence;
-
- class InRepositoryConstraint;
- typedef Pool<InRepositoryConstraint> InRepositoryConstraintPool;
-
- class FromRepositoryConstraint;
- typedef Pool<FromRepositoryConstraint> FromRepositoryConstraintPool;
-
- class InstalledAtPathConstraint;
- typedef Pool<InstalledAtPathConstraint> InstalledAtPathConstraintPool;
-
- class InstallableToPathConstraint;
- typedef Pool<InstallableToPathConstraint> InstallableToPathConstraintPool;
-
- class InstallableToRepositoryConstraint;
- typedef Pool<InstallableToRepositoryConstraint> InstallableToRepositoryConstraintPool;
-
- class ExactSlotConstraint;
- typedef Pool<ExactSlotConstraint> ExactSlotConstraintPool;
-
- class AnySlotConstraint;
- typedef Pool<AnySlotConstraint> AnySlotConstraintPool;
-
- class KeyConstraint;
- typedef Pool<KeyConstraint> KeyConstraintPool;
-
- typedef Sequence<std::shared_ptr<const KeyConstraint> > KeyConstraintSequence;
-
- class ChoiceConstraint;
-
- typedef Sequence<std::shared_ptr<const ChoiceConstraint> > ChoiceConstraintSequence;
-
-#include <paludis/package_dep_spec_constraint-se.hh>
-
-}
-
-#endif
diff --git a/paludis/package_dep_spec_constraint.hh b/paludis/package_dep_spec_constraint.hh
deleted file mode 100644
index 244352f..0000000
--- a/paludis/package_dep_spec_constraint.hh
+++ /dev/null
@@ -1,399 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2011 Ciaran McCreesh
- *
- * 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_CONSTRAINT_HH
-#define PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_CONSTRAINT_HH 1
-
-#include <paludis/package_dep_spec_constraint-fwd.hh>
-#include <paludis/name.hh>
-#include <paludis/version_operator-fwd.hh>
-#include <paludis/version_spec-fwd.hh>
-#include <paludis/environment-fwd.hh>
-#include <paludis/package_id-fwd.hh>
-#include <paludis/changed_choices-fwd.hh>
-
-#include <paludis/util/attributes.hh>
-#include <paludis/util/pool.hh>
-#include <paludis/util/visitor.hh>
-#include <paludis/util/type_list.hh>
-#include <paludis/util/fs_path.hh>
-#include <paludis/util/pimp.hh>
-#include <paludis/util/tribool-fwd.hh>
-
-namespace paludis
-{
- class PALUDIS_VISIBLE PackageDepSpecConstraint :
- public virtual DeclareAbstractAcceptMethods<PackageDepSpecConstraint, MakeTypeList<
- NameConstraint,
- PackageNamePartConstraint,
- CategoryNamePartConstraint,
- VersionConstraint,
- InRepositoryConstraint,
- FromRepositoryConstraint,
- InstalledAtPathConstraint,
- InstallableToPathConstraint,
- InstallableToRepositoryConstraint,
- AnySlotConstraint,
- ExactSlotConstraint,
- KeyConstraint,
- ChoiceConstraint
- >::Type>
- {
- public:
- virtual ~PackageDepSpecConstraint() = 0;
- };
-
- class PALUDIS_VISIBLE NameConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, NameConstraint>
- {
- friend class Pool<NameConstraint>;
-
- private:
- QualifiedPackageName _name;
-
- NameConstraint(const QualifiedPackageName &);
-
- NameConstraint(const NameConstraint &) = delete;
-
- public:
- ~NameConstraint();
-
- const QualifiedPackageName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE CategoryNamePartConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, CategoryNamePartConstraint>
- {
- friend class Pool<CategoryNamePartConstraint>;
-
- private:
- CategoryNamePart _name_part;
-
- CategoryNamePartConstraint(const CategoryNamePart &);
-
- CategoryNamePartConstraint(const CategoryNamePartConstraint &) = delete;
-
- public:
- ~CategoryNamePartConstraint();
-
- const CategoryNamePart name_part() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE PackageNamePartConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, PackageNamePartConstraint>
- {
- friend class Pool<PackageNamePartConstraint>;
-
- private:
- PackageNamePart _name_part;
-
- PackageNamePartConstraint(const PackageNamePart &);
-
- PackageNamePartConstraint(const PackageNamePartConstraint &) = delete;
-
- public:
- ~PackageNamePartConstraint();
-
- const PackageNamePart name_part() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE VersionConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, VersionConstraint>
- {
- private:
- Pimp<VersionConstraint> _imp;
-
- VersionConstraint(const VersionConstraint &) = delete;
-
- public:
- /* not pooled for now, since VersionSpec gives equality for 1 and 1-r0 */
- VersionConstraint(const VersionSpec &, const VersionOperator &, const VersionConstraintCombiner);
-
- ~VersionConstraint();
-
- const VersionSpec version_spec() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const VersionOperator version_operator() const PALUDIS_ATTRIBUTE((warn_unused_result));
- VersionConstraintCombiner combiner() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE InRepositoryConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, InRepositoryConstraint>
- {
- friend class Pool<InRepositoryConstraint>;
-
- private:
- RepositoryName _name;
-
- InRepositoryConstraint(const RepositoryName &);
-
- InRepositoryConstraint(const InRepositoryConstraint &) = delete;
-
- public:
- ~InRepositoryConstraint();
-
- const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE FromRepositoryConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, FromRepositoryConstraint>
- {
- friend class Pool<FromRepositoryConstraint>;
-
- private:
- RepositoryName _name;
-
- FromRepositoryConstraint(const RepositoryName &);
-
- FromRepositoryConstraint(const FromRepositoryConstraint &) = delete;
-
- public:
- ~FromRepositoryConstraint();
-
- const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE InstalledAtPathConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, InstalledAtPathConstraint>
- {
- friend class Pool<InstalledAtPathConstraint>;
-
- private:
- FSPath _path;
-
- InstalledAtPathConstraint(const FSPath &);
-
- InstalledAtPathConstraint(const InstalledAtPathConstraint &) = delete;
-
- public:
- ~InstalledAtPathConstraint();
-
- const FSPath path() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE InstallableToPathConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, InstallableToPathConstraint>
- {
- friend class Pool<InstallableToPathConstraint>;
-
- private:
- FSPath _path;
- bool _include_masked;
-
- InstallableToPathConstraint(const FSPath &, const bool);
-
- InstallableToPathConstraint(const InstallableToPathConstraint &) = delete;
-
- public:
- ~InstallableToPathConstraint();
-
- const FSPath path() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool include_masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE InstallableToRepositoryConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, InstallableToRepositoryConstraint>
- {
- friend class Pool<InstallableToRepositoryConstraint>;
-
- private:
- RepositoryName _name;
- bool _include_masked;
-
- InstallableToRepositoryConstraint(const RepositoryName &, const bool);
-
- InstallableToRepositoryConstraint(const InstallableToRepositoryConstraint &) = delete;
-
- public:
- ~InstallableToRepositoryConstraint();
-
- const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool include_masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE ExactSlotConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, ExactSlotConstraint>
- {
- friend class Pool<ExactSlotConstraint>;
-
- private:
- SlotName _name;
- bool _locked;
-
- ExactSlotConstraint(const SlotName &, const bool);
-
- ExactSlotConstraint(const ExactSlotConstraint &) = delete;
-
- public:
- ~ExactSlotConstraint();
-
- const SlotName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool locked() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE AnySlotConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, AnySlotConstraint>
- {
- friend class Pool<AnySlotConstraint>;
-
- private:
- bool _locking;
-
- AnySlotConstraint(const bool);
-
- AnySlotConstraint(const AnySlotConstraint &) = delete;
-
- public:
- ~AnySlotConstraint();
-
- bool locking() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE KeyConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, KeyConstraint>
- {
- friend class Pool<KeyConstraint>;
-
- private:
- KeyConstraintKeyType _key_type;
- std::string _key;
- KeyConstraintOperation _operation;
- std::string _pattern;
-
- KeyConstraint(const KeyConstraintKeyType, const std::string &, const KeyConstraintOperation, const std::string &);
-
- KeyConstraint(const KeyConstraint &) = delete;
-
- public:
- ~KeyConstraint();
-
- KeyConstraintKeyType key_type() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::string key() const PALUDIS_ATTRIBUTE((warn_unused_result));
- KeyConstraintOperation operation() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::string pattern() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- bool matches(
- const Environment * const env,
- const std::shared_ptr<const PackageID> & id) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /**
- * Return a raw string representation of ourself.
- */
- const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE ChoiceConstraint :
- public PackageDepSpecConstraint,
- public ImplementAcceptMethods<PackageDepSpecConstraint, ChoiceConstraint>
- {
- private:
- ChoiceConstraint(const ChoiceConstraint &) = delete;
-
- protected:
- ChoiceConstraint();
-
- public:
- /**
- * Is our requirement met for a given PackageID?
- *
- * The string in the return type might be a description of why the
- * requirement was not met. Sometimes better messages can be given
- * than simply the return value of as_human_string() when the ID to
- * be matched is known. If the bool is false, the string is
- * meaningless.
- *
- * \param spec_id The PackageID the spec comes from. May be null. Used for
- * [use=] style dependencies.
- *
- * \since 0.61 is in ChoiceConstraint
- */
- virtual const std::pair<bool, std::string> requirement_met(
- const Environment * const,
- const ChangedChoices * const maybe_changes_to_owner,
- const std::shared_ptr<const PackageID> & target_id,
- const std::shared_ptr<const PackageID> & spec_id,
- const ChangedChoices * const maybe_changes_to_target) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * If possible, indicate which choices to change to make our
- * requirement met for a particular ID.
- *
- * Verifies that the ID has the appropriate choice, and that that
- * choice isn't locked.
- *
- * Returns true for changes made, false for not possible,
- * indeterminate for nothing needs changing.
- *
- * \param spec_id The PackageID the spec comes from. May be null. Used for
- * [use=] style dependencies.
- *
- * \since 0.61 is in ChoiceConstraint
- */
- virtual Tribool accumulate_changes_to_make_met(
- const Environment * const,
- const ChangedChoices * const maybe_changes_to_owner,
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const PackageID> & spec_id,
- ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Return a human readable string representation of ourself.
- *
- * \param spec_id The PackageID the spec comes from. May be null. Used for
- * [use=] style dependencies.
- *
- * \since 0.61 is in ChoiceConstraint
- */
- virtual const std::string as_human_string(
- const std::shared_ptr<const PackageID> & spec_id) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Return a raw string representation of ourself.
- */
- virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- extern template class Pool<NameConstraint>;
- extern template class Pool<PackageNamePartConstraint>;
- extern template class Pool<CategoryNamePartConstraint>;
- extern template class Pool<VersionConstraint>;
- extern template class Pool<InRepositoryConstraint>;
- extern template class Pool<FromRepositoryConstraint>;
- extern template class Pool<InstalledAtPathConstraint>;
- extern template class Pool<InstallableToPathConstraint>;
- extern template class Pool<InstallableToRepositoryConstraint>;
- extern template class Pool<ExactSlotConstraint>;
- extern template class Pool<AnySlotConstraint>;
- extern template class Pool<KeyConstraint>;
-
- extern template class Pimp<VersionConstraint>;
-}
-
-#endif
diff --git a/paludis/package_dep_spec_constraint.se b/paludis/package_dep_spec_constraint.se
deleted file mode 100644
index f224c1b..0000000
--- a/paludis/package_dep_spec_constraint.se
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et ft=sh :
-
-make_enum_KeyConstraintOperation()
-{
- prefix kco
-
- key kco_equals "An = constraint"
- key kco_tilde "A ~ constraint"
- key kco_less_than "A less than constraint"
- key kco_greater_than "A greater than constraint"
- key kco_question "A question constraint"
-}
-
-make_enum_KeyConstraintKeyType()
-{
- prefix kckt
-
- key kckt_id "A regular [.key] constraint"
- key kckt_id_role "A role [.\$key] constraint"
- key kckt_id_mask "A role [.(mask)] constraint"
- key kckt_repo "A [.::repo] constraint"
- key kckt_repo_role "A [.::\$repo] constraint"
-}
-
-make_enum_VersionConstraintCombiner()
-{
- prefix vcc
-
- key vcc_and "And with previous value"
- key vcc_or "Or with previons value"
-}
-
diff --git a/paludis/package_dep_spec_properties.cc b/paludis/package_dep_spec_properties.cc
index 5dfaa86..0ac1b39 100644
--- a/paludis/package_dep_spec_properties.cc
+++ b/paludis/package_dep_spec_properties.cc
@@ -41,19 +41,19 @@ paludis::package_dep_spec_has_properties(const PackageDepSpec & spec, const Pack
{
bool result(true);
- result = result && check(bool(spec.all_choice_constraints()) && ! spec.all_choice_constraints()->empty(), properties.has_choice_constraints());
- result = result && check(bool(spec.category_name_part_constraint()), properties.has_category_name_part());
- result = result && check(bool(spec.from_repository_constraint()), properties.has_from_repository());
- result = result && check(bool(spec.all_key_constraints()) && ! spec.all_key_constraints()->empty(), properties.has_key_constraints());
- result = result && check(bool(spec.in_repository_constraint()), properties.has_in_repository());
- result = result && check(bool(spec.installable_to_path_constraint()), properties.has_installable_to_path());
- result = result && check(bool(spec.installable_to_repository_constraint()), properties.has_installable_to_repository());
- result = result && check(bool(spec.installed_at_path_constraint()), properties.has_installed_at_path());
- result = result && check(bool(spec.package_name_constraint()), properties.has_package());
- result = result && check(bool(spec.package_name_part_constraint()), properties.has_package_name_part());
- result = result && check(bool(spec.exact_slot_constraint()), properties.has_exact_slot_constraint());
- result = result && check(bool(spec.any_slot_constraint()), properties.has_any_slot_constraint());
- result = result && check(bool(spec.all_version_constraints()) && ! spec.all_version_constraints()->empty(), properties.has_version_constraints());
+ result = result && check(bool(spec.all_choice_requirements()) && ! spec.all_choice_requirements()->empty(), properties.has_choice_requirements());
+ result = result && check(bool(spec.category_name_part_requirement()), properties.has_category_name_part());
+ result = result && check(bool(spec.from_repository_requirement()), properties.has_from_repository());
+ result = result && check(bool(spec.all_key_requirements()) && ! spec.all_key_requirements()->empty(), properties.has_key_requirements());
+ result = result && check(bool(spec.in_repository_requirement()), properties.has_in_repository());
+ result = result && check(bool(spec.installable_to_path_requirement()), properties.has_installable_to_path());
+ result = result && check(bool(spec.installable_to_repository_requirement()), properties.has_installable_to_repository());
+ result = result && check(bool(spec.installed_at_path_requirement()), properties.has_installed_at_path());
+ result = result && check(bool(spec.package_name_requirement()), properties.has_package());
+ result = result && check(bool(spec.package_name_part_requirement()), properties.has_package_name_part());
+ result = result && check(bool(spec.exact_slot_requirement()), properties.has_exact_slot_requirement());
+ result = result && check(bool(spec.any_slot_requirement()), properties.has_any_slot_requirement());
+ result = result && check(bool(spec.all_version_requirements()) && ! spec.all_version_requirements()->empty(), properties.has_version_requirements());
return result;
}
diff --git a/paludis/package_dep_spec_properties.hh b/paludis/package_dep_spec_properties.hh
index dedd625..093b584 100644
--- a/paludis/package_dep_spec_properties.hh
+++ b/paludis/package_dep_spec_properties.hh
@@ -28,20 +28,20 @@ namespace paludis
{
namespace n
{
- typedef Name<struct name_has_any_slot_constraint> has_any_slot_constraint;
+ typedef Name<struct name_has_any_slot_requirement> has_any_slot_requirement;
typedef Name<struct name_has_category_name_part> has_category_name_part;
- typedef Name<struct name_has_choice_constraints> has_choice_constraints;
- typedef Name<struct name_has_exact_slot_constraint> has_exact_slot_constraint;
+ typedef Name<struct name_has_choice_requirements> has_choice_requirements;
+ typedef Name<struct name_has_exact_slot_requirement> has_exact_slot_requirement;
typedef Name<struct name_has_from_repository> has_from_repository;
typedef Name<struct name_has_in_repository> has_in_repository;
typedef Name<struct name_has_installable_to_path> has_installable_to_path;
typedef Name<struct name_has_installable_to_repository> has_installable_to_repository;
typedef Name<struct name_has_installed_at_path> has_installed_at_path;
- typedef Name<struct name_has_key_constraints> has_key_constraints;
+ typedef Name<struct name_has_key_requirements> has_key_requirements;
typedef Name<struct name_has_package> has_package;
typedef Name<struct name_has_package_name_part> has_package_name_part;
typedef Name<struct name_has_tag> has_tag;
- typedef Name<struct name_has_version_constraints> has_version_constraints;
+ typedef Name<struct name_has_version_requirements> has_version_requirements;
}
/**
@@ -52,20 +52,20 @@ namespace paludis
*/
struct PackageDepSpecProperties
{
- NamedValue<n::has_any_slot_constraint, Tribool> has_any_slot_constraint;
+ NamedValue<n::has_any_slot_requirement, Tribool> has_any_slot_requirement;
NamedValue<n::has_category_name_part, Tribool> has_category_name_part;
- NamedValue<n::has_choice_constraints, Tribool> has_choice_constraints;
- NamedValue<n::has_exact_slot_constraint, Tribool> has_exact_slot_constraint;
+ NamedValue<n::has_choice_requirements, Tribool> has_choice_requirements;
+ NamedValue<n::has_exact_slot_requirement, Tribool> has_exact_slot_requirement;
NamedValue<n::has_from_repository, Tribool> has_from_repository;
NamedValue<n::has_in_repository, Tribool> has_in_repository;
NamedValue<n::has_installable_to_path, Tribool> has_installable_to_path;
NamedValue<n::has_installable_to_repository, Tribool> has_installable_to_repository;
NamedValue<n::has_installed_at_path, Tribool> has_installed_at_path;
- NamedValue<n::has_key_constraints, Tribool> has_key_constraints;
+ NamedValue<n::has_key_requirements, Tribool> has_key_requirements;
NamedValue<n::has_package, Tribool> has_package;
NamedValue<n::has_package_name_part, Tribool> has_package_name_part;
NamedValue<n::has_tag, Tribool> has_tag;
- NamedValue<n::has_version_constraints, Tribool> has_version_constraints;
+ NamedValue<n::has_version_requirements, Tribool> has_version_requirements;
};
}
diff --git a/paludis/package_dep_spec_requirement-fwd.hh b/paludis/package_dep_spec_requirement-fwd.hh
new file mode 100644
index 0000000..40386fd
--- /dev/null
+++ b/paludis/package_dep_spec_requirement-fwd.hh
@@ -0,0 +1,80 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2011 Ciaran McCreesh
+ *
+ * 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
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_REQUIREMENT_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_REQUIREMENT_FWD_HH 1
+
+#include <paludis/util/pool-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/sequence-fwd.hh>
+#include <iosfwd>
+#include <memory>
+
+namespace paludis
+{
+ class PackageDepSpecRequirement;
+
+ class NameRequirement;
+ typedef Pool<NameRequirement> NameRequirementPool;
+
+ class PackageNamePartRequirement;
+ typedef Pool<PackageNamePartRequirement> PackageNamePartRequirementPool;
+
+ class CategoryNamePartRequirement;
+ typedef Pool<CategoryNamePartRequirement> CategoryNamePartRequirementPool;
+
+ class VersionRequirement;
+
+ typedef Sequence<std::shared_ptr<const VersionRequirement> > VersionRequirementSequence;
+
+ class InRepositoryRequirement;
+ typedef Pool<InRepositoryRequirement> InRepositoryRequirementPool;
+
+ class FromRepositoryRequirement;
+ typedef Pool<FromRepositoryRequirement> FromRepositoryRequirementPool;
+
+ class InstalledAtPathRequirement;
+ typedef Pool<InstalledAtPathRequirement> InstalledAtPathRequirementPool;
+
+ class InstallableToPathRequirement;
+ typedef Pool<InstallableToPathRequirement> InstallableToPathRequirementPool;
+
+ class InstallableToRepositoryRequirement;
+ typedef Pool<InstallableToRepositoryRequirement> InstallableToRepositoryRequirementPool;
+
+ class ExactSlotRequirement;
+ typedef Pool<ExactSlotRequirement> ExactSlotRequirementPool;
+
+ class AnySlotRequirement;
+ typedef Pool<AnySlotRequirement> AnySlotRequirementPool;
+
+ class KeyRequirement;
+ typedef Pool<KeyRequirement> KeyRequirementPool;
+
+ typedef Sequence<std::shared_ptr<const KeyRequirement> > KeyRequirementSequence;
+
+ class ChoiceRequirement;
+
+ typedef Sequence<std::shared_ptr<const ChoiceRequirement> > ChoiceRequirementSequence;
+
+#include <paludis/package_dep_spec_requirement-se.hh>
+
+}
+
+#endif
diff --git a/paludis/package_dep_spec_constraint.cc b/paludis/package_dep_spec_requirement.cc
index 5a80529..51d81c8 100644
--- a/paludis/package_dep_spec_constraint.cc
+++ b/paludis/package_dep_spec_requirement.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/version_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/contents.hh>
@@ -50,74 +50,74 @@
using namespace paludis;
-#include <paludis/package_dep_spec_constraint-se.cc>
+#include <paludis/package_dep_spec_requirement-se.cc>
-PackageDepSpecConstraint::~PackageDepSpecConstraint() = default;
+PackageDepSpecRequirement::~PackageDepSpecRequirement() = default;
-NameConstraint::NameConstraint(const QualifiedPackageName & n) :
+NameRequirement::NameRequirement(const QualifiedPackageName & n) :
_name(n)
{
}
-NameConstraint::~NameConstraint() = default;
+NameRequirement::~NameRequirement() = default;
const QualifiedPackageName
-NameConstraint::name() const
+NameRequirement::name() const
{
return _name;
}
-template class Pool<NameConstraint>;
-template class Singleton<Pool<NameConstraint> >;
-template const std::shared_ptr<const NameConstraint> Pool<NameConstraint>::create(
+template class Pool<NameRequirement>;
+template class Singleton<Pool<NameRequirement> >;
+template const std::shared_ptr<const NameRequirement> Pool<NameRequirement>::create(
const QualifiedPackageName &) const;
-CategoryNamePartConstraint::CategoryNamePartConstraint(const CategoryNamePart & n) :
+CategoryNamePartRequirement::CategoryNamePartRequirement(const CategoryNamePart & n) :
_name_part(n)
{
}
-CategoryNamePartConstraint::~CategoryNamePartConstraint() = default;
+CategoryNamePartRequirement::~CategoryNamePartRequirement() = default;
const CategoryNamePart
-CategoryNamePartConstraint::name_part() const
+CategoryNamePartRequirement::name_part() const
{
return _name_part;
}
-template class Pool<CategoryNamePartConstraint>;
-template class Singleton<Pool<CategoryNamePartConstraint> >;
-template const std::shared_ptr<const CategoryNamePartConstraint> Pool<CategoryNamePartConstraint>::create(
+template class Pool<CategoryNamePartRequirement>;
+template class Singleton<Pool<CategoryNamePartRequirement> >;
+template const std::shared_ptr<const CategoryNamePartRequirement> Pool<CategoryNamePartRequirement>::create(
const CategoryNamePart &) const;
-PackageNamePartConstraint::PackageNamePartConstraint(const PackageNamePart & n) :
+PackageNamePartRequirement::PackageNamePartRequirement(const PackageNamePart & n) :
_name_part(n)
{
}
-PackageNamePartConstraint::~PackageNamePartConstraint() = default;
+PackageNamePartRequirement::~PackageNamePartRequirement() = default;
const PackageNamePart
-PackageNamePartConstraint::name_part() const
+PackageNamePartRequirement::name_part() const
{
return _name_part;
}
-template class Pool<PackageNamePartConstraint>;
-template class Singleton<Pool<PackageNamePartConstraint> >;
-template const std::shared_ptr<const PackageNamePartConstraint> Pool<PackageNamePartConstraint>::create(
+template class Pool<PackageNamePartRequirement>;
+template class Singleton<Pool<PackageNamePartRequirement> >;
+template const std::shared_ptr<const PackageNamePartRequirement> Pool<PackageNamePartRequirement>::create(
const PackageNamePart &) const;
namespace paludis
{
template <>
- struct Imp<VersionConstraint>
+ struct Imp<VersionRequirement>
{
VersionSpec spec;
VersionOperator op;
- VersionConstraintCombiner combiner;
+ VersionRequirementCombiner combiner;
- Imp(const VersionSpec & s, const VersionOperator & o, const VersionConstraintCombiner c) :
+ Imp(const VersionSpec & s, const VersionOperator & o, const VersionRequirementCombiner c) :
spec(s),
op(o),
combiner(c)
@@ -126,182 +126,182 @@ namespace paludis
};
}
-VersionConstraint::VersionConstraint(const VersionSpec & s, const VersionOperator & o, const VersionConstraintCombiner c) :
+VersionRequirement::VersionRequirement(const VersionSpec & s, const VersionOperator & o, const VersionRequirementCombiner c) :
_imp(s, o, c)
{
}
-VersionConstraint::~VersionConstraint() = default;
+VersionRequirement::~VersionRequirement() = default;
const VersionSpec
-VersionConstraint::version_spec() const
+VersionRequirement::version_spec() const
{
return _imp->spec;
}
const VersionOperator
-VersionConstraint::version_operator() const
+VersionRequirement::version_operator() const
{
return _imp->op;
}
-VersionConstraintCombiner
-VersionConstraint::combiner() const
+VersionRequirementCombiner
+VersionRequirement::combiner() const
{
return _imp->combiner;
}
-template class Sequence<std::shared_ptr<const VersionConstraint> >;
-template class WrappedForwardIterator<Sequence<std::shared_ptr<const VersionConstraint> >::ConstIteratorTag, const std::shared_ptr<const VersionConstraint> >;
-template class WrappedOutputIterator<Sequence<std::shared_ptr<const VersionConstraint> >::InserterTag, std::shared_ptr<const VersionConstraint> >;
-template class Pimp<VersionConstraint>;
+template class Sequence<std::shared_ptr<const VersionRequirement> >;
+template class WrappedForwardIterator<Sequence<std::shared_ptr<const VersionRequirement> >::ConstIteratorTag, const std::shared_ptr<const VersionRequirement> >;
+template class WrappedOutputIterator<Sequence<std::shared_ptr<const VersionRequirement> >::InserterTag, std::shared_ptr<const VersionRequirement> >;
+template class Pimp<VersionRequirement>;
-InRepositoryConstraint::InRepositoryConstraint(const RepositoryName & n) :
+InRepositoryRequirement::InRepositoryRequirement(const RepositoryName & n) :
_name(n)
{
}
-InRepositoryConstraint::~InRepositoryConstraint() = default;
+InRepositoryRequirement::~InRepositoryRequirement() = default;
const RepositoryName
-InRepositoryConstraint::name() const
+InRepositoryRequirement::name() const
{
return _name;
}
-template class Pool<InRepositoryConstraint>;
-template class Singleton<Pool<InRepositoryConstraint> >;
-template const std::shared_ptr<const InRepositoryConstraint> Pool<InRepositoryConstraint>::create(
+template class Pool<InRepositoryRequirement>;
+template class Singleton<Pool<InRepositoryRequirement> >;
+template const std::shared_ptr<const InRepositoryRequirement> Pool<InRepositoryRequirement>::create(
const RepositoryName &) const;
-FromRepositoryConstraint::FromRepositoryConstraint(const RepositoryName & n) :
+FromRepositoryRequirement::FromRepositoryRequirement(const RepositoryName & n) :
_name(n)
{
}
-FromRepositoryConstraint::~FromRepositoryConstraint() = default;
+FromRepositoryRequirement::~FromRepositoryRequirement() = default;
const RepositoryName
-FromRepositoryConstraint::name() const
+FromRepositoryRequirement::name() const
{
return _name;
}
-template class Pool<FromRepositoryConstraint>;
-template class Singleton<Pool<FromRepositoryConstraint> >;
-template const std::shared_ptr<const FromRepositoryConstraint> Pool<FromRepositoryConstraint>::create(
+template class Pool<FromRepositoryRequirement>;
+template class Singleton<Pool<FromRepositoryRequirement> >;
+template const std::shared_ptr<const FromRepositoryRequirement> Pool<FromRepositoryRequirement>::create(
const RepositoryName &) const;
-InstalledAtPathConstraint::InstalledAtPathConstraint(const FSPath & n) :
+InstalledAtPathRequirement::InstalledAtPathRequirement(const FSPath & n) :
_path(n)
{
}
-InstalledAtPathConstraint::~InstalledAtPathConstraint() = default;
+InstalledAtPathRequirement::~InstalledAtPathRequirement() = default;
const FSPath
-InstalledAtPathConstraint::path() const
+InstalledAtPathRequirement::path() const
{
return _path;
}
-template class Pool<InstalledAtPathConstraint>;
-template class Singleton<Pool<InstalledAtPathConstraint> >;
-template const std::shared_ptr<const InstalledAtPathConstraint> Pool<InstalledAtPathConstraint>::create(
+template class Pool<InstalledAtPathRequirement>;
+template class Singleton<Pool<InstalledAtPathRequirement> >;
+template const std::shared_ptr<const InstalledAtPathRequirement> Pool<InstalledAtPathRequirement>::create(
const FSPath &) const;
-InstallableToPathConstraint::InstallableToPathConstraint(const FSPath & n, const bool i) :
+InstallableToPathRequirement::InstallableToPathRequirement(const FSPath & n, const bool i) :
_path(n),
_include_masked(i)
{
}
-InstallableToPathConstraint::~InstallableToPathConstraint() = default;
+InstallableToPathRequirement::~InstallableToPathRequirement() = default;
const FSPath
-InstallableToPathConstraint::path() const
+InstallableToPathRequirement::path() const
{
return _path;
}
bool
-InstallableToPathConstraint::include_masked() const
+InstallableToPathRequirement::include_masked() const
{
return _include_masked;
}
-template class Pool<InstallableToPathConstraint>;
-template class Singleton<Pool<InstallableToPathConstraint> >;
-template const std::shared_ptr<const InstallableToPathConstraint> Pool<InstallableToPathConstraint>::create(
+template class Pool<InstallableToPathRequirement>;
+template class Singleton<Pool<InstallableToPathRequirement> >;
+template const std::shared_ptr<const InstallableToPathRequirement> Pool<InstallableToPathRequirement>::create(
const FSPath &, const bool &) const;
-InstallableToRepositoryConstraint::InstallableToRepositoryConstraint(const RepositoryName & n, const bool i) :
+InstallableToRepositoryRequirement::InstallableToRepositoryRequirement(const RepositoryName & n, const bool i) :
_name(n),
_include_masked(i)
{
}
-InstallableToRepositoryConstraint::~InstallableToRepositoryConstraint() = default;
+InstallableToRepositoryRequirement::~InstallableToRepositoryRequirement() = default;
const RepositoryName
-InstallableToRepositoryConstraint::name() const
+InstallableToRepositoryRequirement::name() const
{
return _name;
}
bool
-InstallableToRepositoryConstraint::include_masked() const
+InstallableToRepositoryRequirement::include_masked() const
{
return _include_masked;
}
-template class Pool<InstallableToRepositoryConstraint>;
-template class Singleton<Pool<InstallableToRepositoryConstraint> >;
-template const std::shared_ptr<const InstallableToRepositoryConstraint> Pool<InstallableToRepositoryConstraint>::create(
+template class Pool<InstallableToRepositoryRequirement>;
+template class Singleton<Pool<InstallableToRepositoryRequirement> >;
+template const std::shared_ptr<const InstallableToRepositoryRequirement> Pool<InstallableToRepositoryRequirement>::create(
const RepositoryName &, const bool &) const;
-ExactSlotConstraint::ExactSlotConstraint(const SlotName & n, const bool i) :
+ExactSlotRequirement::ExactSlotRequirement(const SlotName & n, const bool i) :
_name(n),
_locked(i)
{
}
-ExactSlotConstraint::~ExactSlotConstraint() = default;
+ExactSlotRequirement::~ExactSlotRequirement() = default;
const SlotName
-ExactSlotConstraint::name() const
+ExactSlotRequirement::name() const
{
return _name;
}
bool
-ExactSlotConstraint::locked() const
+ExactSlotRequirement::locked() const
{
return _locked;
}
-template class Pool<ExactSlotConstraint>;
-template class Singleton<Pool<ExactSlotConstraint> >;
-template const std::shared_ptr<const ExactSlotConstraint> Pool<ExactSlotConstraint>::create(const SlotName &, const bool &) const;
+template class Pool<ExactSlotRequirement>;
+template class Singleton<Pool<ExactSlotRequirement> >;
+template const std::shared_ptr<const ExactSlotRequirement> Pool<ExactSlotRequirement>::create(const SlotName &, const bool &) const;
-AnySlotConstraint::AnySlotConstraint(const bool i) :
+AnySlotRequirement::AnySlotRequirement(const bool i) :
_locking(i)
{
}
-AnySlotConstraint::~AnySlotConstraint() = default;
+AnySlotRequirement::~AnySlotRequirement() = default;
bool
-AnySlotConstraint::locking() const
+AnySlotRequirement::locking() const
{
return _locking;
}
-template class Pool<AnySlotConstraint>;
-template class Singleton<Pool<AnySlotConstraint> >;
-template const std::shared_ptr<const AnySlotConstraint> Pool<AnySlotConstraint>::create(const bool &) const;
+template class Pool<AnySlotRequirement>;
+template class Singleton<Pool<AnySlotRequirement> >;
+template const std::shared_ptr<const AnySlotRequirement> Pool<AnySlotRequirement>::create(const bool &) const;
-KeyConstraint::KeyConstraint(const KeyConstraintKeyType t, const std::string & k, const KeyConstraintOperation o, const std::string & p) :
+KeyRequirement::KeyRequirement(const KeyRequirementKeyType t, const std::string & k, const KeyRequirementOperation o, const std::string & p) :
_key_type(t),
_key(k),
_operation(o),
@@ -309,28 +309,28 @@ KeyConstraint::KeyConstraint(const KeyConstraintKeyType t, const std::string & k
{
}
-KeyConstraint::~KeyConstraint() = default;
+KeyRequirement::~KeyRequirement() = default;
-KeyConstraintKeyType
-KeyConstraint::key_type() const
+KeyRequirementKeyType
+KeyRequirement::key_type() const
{
return _key_type;
}
const std::string
-KeyConstraint::key() const
+KeyRequirement::key() const
{
return _key;
}
-KeyConstraintOperation
-KeyConstraint::operation() const
+KeyRequirementOperation
+KeyRequirement::operation() const
{
return _operation;
}
const std::string
-KeyConstraint::pattern() const
+KeyRequirement::pattern() const
{
return _pattern;
}
@@ -461,10 +461,10 @@ namespace
const Environment * const env;
const std::shared_ptr<const PackageID> id;
const std::string pattern;
- const KeyConstraintOperation op;
+ const KeyRequirementOperation op;
KeyComparator(const Environment * const e, const std::shared_ptr<const PackageID> & i,
- const std::string & p, const KeyConstraintOperation o) :
+ const std::string & p, const KeyRequirementOperation o) :
env(e),
id(i),
pattern(p),
@@ -481,16 +481,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value().seconds());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value().seconds()).find(pattern);
- case kco_less_than:
+ case kro_less_than:
return k.value().seconds() < destringify<time_t>(pattern);
- case kco_greater_than:
+ case kro_greater_than:
return k.value().seconds() > destringify<time_t>(pattern);
- case kco_question:
- case last_kco:
+ case kro_question:
+ case last_kro:
break;
}
@@ -501,14 +501,14 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value()).find(pattern);
- case kco_less_than:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_less_than:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -519,14 +519,14 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value()).find(pattern);
- case kco_less_than:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_less_than:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -537,14 +537,14 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value()).find(pattern);
- case kco_less_than:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_less_than:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -555,14 +555,14 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value()).find(pattern);
- case kco_less_than:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_less_than:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -573,16 +573,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(k.value()).find(pattern);
- case kco_less_than:
+ case kro_less_than:
return k.value() < destringify<long>(pattern);
- case kco_greater_than:
+ case kro_greater_than:
return k.value() > destringify<long>(pattern);
- case kco_question:
- case last_kco:
+ case kro_question:
+ case last_kro:
break;
}
@@ -598,19 +598,19 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(indirect_iterator(s.value()->begin()), indirect_iterator(s.value()->end()), " ",
stringify_contents_entry);
- case kco_less_than:
+ case kro_less_than:
return indirect_iterator(s.value()->end()) != std::find_if(
indirect_iterator(s.value()->begin()),
indirect_iterator(s.value()->end()),
StringifyEqual(pattern));
- case kco_greater_than:
- case kco_question:
- case kco_tilde:
- case last_kco:
+ case kro_greater_than:
+ case kro_question:
+ case kro_tilde:
+ case last_kro:
break;
}
@@ -621,14 +621,14 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == stringify(*k.value());
- case kco_tilde:
+ case kro_tilde:
return std::string::npos != stringify(*k.value()).find(pattern);
- case kco_less_than:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_less_than:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -639,15 +639,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -658,15 +658,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -677,15 +677,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -696,15 +696,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -715,15 +715,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -734,15 +734,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -753,15 +753,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -772,15 +772,15 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return false;
- case kco_less_than:
+ case kro_less_than:
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -791,16 +791,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(s.value()->begin(), s.value()->end(), " ");
- case kco_less_than:
+ case kro_less_than:
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
StringifyEqual(pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -811,18 +811,18 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(indirect_iterator(s.value()->begin()), indirect_iterator(s.value()->end()), " ");
- case kco_less_than:
+ case kro_less_than:
return indirect_iterator(s.value()->end()) != std::find_if(
indirect_iterator(s.value()->begin()),
indirect_iterator(s.value()->end()),
StringifyEqual(pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -833,16 +833,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(s.value()->begin(), s.value()->end(), " ");
- case kco_less_than:
+ case kro_less_than:
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
StringifyEqual(pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -853,16 +853,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(s.value()->begin(), s.value()->end(), " ");
- case kco_less_than:
+ case kro_less_than:
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
StringifyEqual(pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -878,16 +878,16 @@ namespace
{
switch (op)
{
- case kco_equals:
+ case kro_equals:
return pattern == join(s.value()->begin(), s.value()->end(), " ");
- case kco_less_than:
+ case kro_less_than:
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
StringifyEqual(pattern));
- case kco_tilde:
- case kco_greater_than:
- case kco_question:
- case last_kco:
+ case kro_tilde:
+ case kro_greater_than:
+ case kro_question:
+ case last_kro:
break;
}
@@ -962,7 +962,7 @@ namespace
}
bool
-KeyConstraint::matches(
+KeyRequirement::matches(
const Environment * const env,
const std::shared_ptr<const PackageID> & id) const
{
@@ -971,7 +971,7 @@ KeyConstraint::matches(
switch (key_type())
{
- case kckt_repo_role:
+ case krkt_repo_role:
{
auto repo(env->fetch_repository(id->repository_name()));
if (key() == "format")
@@ -987,7 +987,7 @@ KeyConstraint::matches(
}
break;
- case kckt_id_role:
+ case krkt_id_role:
{
if (key() == "behaviours")
k = id->behaviours_key().get();
@@ -1034,7 +1034,7 @@ KeyConstraint::matches(
}
break;
- case kckt_repo:
+ case krkt_repo:
{
auto repo(env->fetch_repository(id->repository_name()));
Repository::MetadataConstIterator mm(repo->find_metadata(key()));
@@ -1043,7 +1043,7 @@ KeyConstraint::matches(
}
break;
- case kckt_id:
+ case krkt_id:
{
PackageID::MetadataConstIterator mm(id->find_metadata(key()));
if (mm != id->end_metadata())
@@ -1051,7 +1051,7 @@ KeyConstraint::matches(
}
break;
- case kckt_id_mask:
+ case krkt_id_mask:
{
for (auto mm(id->begin_masks()), mm_end(id->end_masks()) ;
mm != mm_end ; ++mm)
@@ -1063,14 +1063,14 @@ KeyConstraint::matches(
}
break;
- case last_kckt:
+ case last_krkt:
break;
}
if ((! k) && (! m))
return false;
- if (operation() == kco_question)
+ if (operation() == kro_question)
return true;
else
{
@@ -1088,19 +1088,19 @@ KeyConstraint::matches(
}
const std::string
-KeyConstraint::as_raw_string() const
+KeyRequirement::as_raw_string() const
{
std::stringstream s;
s << "[.";
switch (key_type())
{
- case kckt_id: break;
- case kckt_id_role: s << "$"; break;
- case kckt_id_mask: s << "("; break;
- case kckt_repo: s << "::"; break;
- case kckt_repo_role: s << "::$"; break;
- case last_kckt:
+ case krkt_id: break;
+ case krkt_id_role: s << "$"; break;
+ case krkt_id_mask: s << "("; break;
+ case krkt_repo: s << "::"; break;
+ case krkt_repo_role: s << "::$"; break;
+ case last_krkt:
break;
}
@@ -1108,24 +1108,24 @@ KeyConstraint::as_raw_string() const
switch (operation())
{
- case kco_equals: s << "=" << pattern(); break;
- case kco_tilde: s << "~" << pattern(); break;
- case kco_less_than: s << "<" << pattern(); break;
- case kco_greater_than: s << ">" << pattern(); break;
- case kco_question: s << "?"; break;
-
- case last_kco:
- throw InternalError(PALUDIS_HERE, "Bad KeyConstraintOperation");
+ case kro_equals: s << "=" << pattern(); break;
+ case kro_tilde: s << "~" << pattern(); break;
+ case kro_less_than: s << "<" << pattern(); break;
+ case kro_greater_than: s << ">" << pattern(); break;
+ case kro_question: s << "?"; break;
+
+ case last_kro:
+ throw InternalError(PALUDIS_HERE, "Bad KeyRequirementOperation");
}
switch (key_type())
{
- case kckt_id: break;
- case kckt_id_role: break;
- case kckt_id_mask: s << ")"; break;
- case kckt_repo: break;
- case kckt_repo_role: break;
- case last_kckt:
+ case krkt_id: break;
+ case krkt_id_role: break;
+ case krkt_id_mask: s << ")"; break;
+ case krkt_repo: break;
+ case krkt_repo_role: break;
+ case last_krkt:
break;
}
@@ -1134,17 +1134,17 @@ KeyConstraint::as_raw_string() const
return s.str();
}
-template class Pool<KeyConstraint>;
-template class Singleton<Pool<KeyConstraint> >;
-template const std::shared_ptr<const KeyConstraint> Pool<KeyConstraint>::create(
- const KeyConstraintKeyType &, const std::string &, const KeyConstraintOperation &, const std::string &) const;
-template class Sequence<std::shared_ptr<const KeyConstraint> >;
-template class WrappedOutputIterator<Sequence<std::shared_ptr<const KeyConstraint> >::InserterTag, std::shared_ptr<const KeyConstraint> >;
-template class WrappedForwardIterator<Sequence<std::shared_ptr<const KeyConstraint> >::ConstIteratorTag, const std::shared_ptr<const KeyConstraint> >;
+template class Pool<KeyRequirement>;
+template class Singleton<Pool<KeyRequirement> >;
+template const std::shared_ptr<const KeyRequirement> Pool<KeyRequirement>::create(
+ const KeyRequirementKeyType &, const std::string &, const KeyRequirementOperation &, const std::string &) const;
+template class Sequence<std::shared_ptr<const KeyRequirement> >;
+template class WrappedOutputIterator<Sequence<std::shared_ptr<const KeyRequirement> >::InserterTag, std::shared_ptr<const KeyRequirement> >;
+template class WrappedForwardIterator<Sequence<std::shared_ptr<const KeyRequirement> >::ConstIteratorTag, const std::shared_ptr<const KeyRequirement> >;
-ChoiceConstraint::ChoiceConstraint() = default;
+ChoiceRequirement::ChoiceRequirement() = default;
-template class Sequence<std::shared_ptr<const ChoiceConstraint> >;
-template class WrappedForwardIterator<Sequence<std::shared_ptr<const ChoiceConstraint> >::ConstIteratorTag, const std::shared_ptr<const ChoiceConstraint> >;
-template class WrappedOutputIterator<Sequence<std::shared_ptr<const ChoiceConstraint> >::InserterTag, std::shared_ptr<const ChoiceConstraint> >;
+template class Sequence<std::shared_ptr<const ChoiceRequirement> >;
+template class WrappedForwardIterator<Sequence<std::shared_ptr<const ChoiceRequirement> >::ConstIteratorTag, const std::shared_ptr<const ChoiceRequirement> >;
+template class WrappedOutputIterator<Sequence<std::shared_ptr<const ChoiceRequirement> >::InserterTag, std::shared_ptr<const ChoiceRequirement> >;
diff --git a/paludis/package_dep_spec_requirement.hh b/paludis/package_dep_spec_requirement.hh
new file mode 100644
index 0000000..4a3e930
--- /dev/null
+++ b/paludis/package_dep_spec_requirement.hh
@@ -0,0 +1,399 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2011 Ciaran McCreesh
+ *
+ * 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
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_REQUIREMENT_HH
+#define PALUDIS_GUARD_PALUDIS_PACKAGE_DEP_SPEC_REQUIREMENT_HH 1
+
+#include <paludis/package_dep_spec_requirement-fwd.hh>
+#include <paludis/name.hh>
+#include <paludis/version_operator-fwd.hh>
+#include <paludis/version_spec-fwd.hh>
+#include <paludis/environment-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/changed_choices-fwd.hh>
+
+#include <paludis/util/attributes.hh>
+#include <paludis/util/pool.hh>
+#include <paludis/util/visitor.hh>
+#include <paludis/util/type_list.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/pimp.hh>
+#include <paludis/util/tribool-fwd.hh>
+
+namespace paludis
+{
+ class PALUDIS_VISIBLE PackageDepSpecRequirement :
+ public virtual DeclareAbstractAcceptMethods<PackageDepSpecRequirement, MakeTypeList<
+ NameRequirement,
+ PackageNamePartRequirement,
+ CategoryNamePartRequirement,
+ VersionRequirement,
+ InRepositoryRequirement,
+ FromRepositoryRequirement,
+ InstalledAtPathRequirement,
+ InstallableToPathRequirement,
+ InstallableToRepositoryRequirement,
+ AnySlotRequirement,
+ ExactSlotRequirement,
+ KeyRequirement,
+ ChoiceRequirement
+ >::Type>
+ {
+ public:
+ virtual ~PackageDepSpecRequirement() = 0;
+ };
+
+ class PALUDIS_VISIBLE NameRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, NameRequirement>
+ {
+ friend class Pool<NameRequirement>;
+
+ private:
+ QualifiedPackageName _name;
+
+ NameRequirement(const QualifiedPackageName &);
+
+ NameRequirement(const NameRequirement &) = delete;
+
+ public:
+ ~NameRequirement();
+
+ const QualifiedPackageName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE CategoryNamePartRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, CategoryNamePartRequirement>
+ {
+ friend class Pool<CategoryNamePartRequirement>;
+
+ private:
+ CategoryNamePart _name_part;
+
+ CategoryNamePartRequirement(const CategoryNamePart &);
+
+ CategoryNamePartRequirement(const CategoryNamePartRequirement &) = delete;
+
+ public:
+ ~CategoryNamePartRequirement();
+
+ const CategoryNamePart name_part() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE PackageNamePartRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, PackageNamePartRequirement>
+ {
+ friend class Pool<PackageNamePartRequirement>;
+
+ private:
+ PackageNamePart _name_part;
+
+ PackageNamePartRequirement(const PackageNamePart &);
+
+ PackageNamePartRequirement(const PackageNamePartRequirement &) = delete;
+
+ public:
+ ~PackageNamePartRequirement();
+
+ const PackageNamePart name_part() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE VersionRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, VersionRequirement>
+ {
+ private:
+ Pimp<VersionRequirement> _imp;
+
+ VersionRequirement(const VersionRequirement &) = delete;
+
+ public:
+ /* not pooled for now, since VersionSpec gives equality for 1 and 1-r0 */
+ VersionRequirement(const VersionSpec &, const VersionOperator &, const VersionRequirementCombiner);
+
+ ~VersionRequirement();
+
+ const VersionSpec version_spec() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const VersionOperator version_operator() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ VersionRequirementCombiner combiner() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE InRepositoryRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, InRepositoryRequirement>
+ {
+ friend class Pool<InRepositoryRequirement>;
+
+ private:
+ RepositoryName _name;
+
+ InRepositoryRequirement(const RepositoryName &);
+
+ InRepositoryRequirement(const InRepositoryRequirement &) = delete;
+
+ public:
+ ~InRepositoryRequirement();
+
+ const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE FromRepositoryRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, FromRepositoryRequirement>
+ {
+ friend class Pool<FromRepositoryRequirement>;
+
+ private:
+ RepositoryName _name;
+
+ FromRepositoryRequirement(const RepositoryName &);
+
+ FromRepositoryRequirement(const FromRepositoryRequirement &) = delete;
+
+ public:
+ ~FromRepositoryRequirement();
+
+ const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE InstalledAtPathRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, InstalledAtPathRequirement>
+ {
+ friend class Pool<InstalledAtPathRequirement>;
+
+ private:
+ FSPath _path;
+
+ InstalledAtPathRequirement(const FSPath &);
+
+ InstalledAtPathRequirement(const InstalledAtPathRequirement &) = delete;
+
+ public:
+ ~InstalledAtPathRequirement();
+
+ const FSPath path() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE InstallableToPathRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, InstallableToPathRequirement>
+ {
+ friend class Pool<InstallableToPathRequirement>;
+
+ private:
+ FSPath _path;
+ bool _include_masked;
+
+ InstallableToPathRequirement(const FSPath &, const bool);
+
+ InstallableToPathRequirement(const InstallableToPathRequirement &) = delete;
+
+ public:
+ ~InstallableToPathRequirement();
+
+ const FSPath path() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool include_masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE InstallableToRepositoryRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, InstallableToRepositoryRequirement>
+ {
+ friend class Pool<InstallableToRepositoryRequirement>;
+
+ private:
+ RepositoryName _name;
+ bool _include_masked;
+
+ InstallableToRepositoryRequirement(const RepositoryName &, const bool);
+
+ InstallableToRepositoryRequirement(const InstallableToRepositoryRequirement &) = delete;
+
+ public:
+ ~InstallableToRepositoryRequirement();
+
+ const RepositoryName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool include_masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE ExactSlotRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, ExactSlotRequirement>
+ {
+ friend class Pool<ExactSlotRequirement>;
+
+ private:
+ SlotName _name;
+ bool _locked;
+
+ ExactSlotRequirement(const SlotName &, const bool);
+
+ ExactSlotRequirement(const ExactSlotRequirement &) = delete;
+
+ public:
+ ~ExactSlotRequirement();
+
+ const SlotName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool locked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE AnySlotRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, AnySlotRequirement>
+ {
+ friend class Pool<AnySlotRequirement>;
+
+ private:
+ bool _locking;
+
+ AnySlotRequirement(const bool);
+
+ AnySlotRequirement(const AnySlotRequirement &) = delete;
+
+ public:
+ ~AnySlotRequirement();
+
+ bool locking() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE KeyRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, KeyRequirement>
+ {
+ friend class Pool<KeyRequirement>;
+
+ private:
+ KeyRequirementKeyType _key_type;
+ std::string _key;
+ KeyRequirementOperation _operation;
+ std::string _pattern;
+
+ KeyRequirement(const KeyRequirementKeyType, const std::string &, const KeyRequirementOperation, const std::string &);
+
+ KeyRequirement(const KeyRequirement &) = delete;
+
+ public:
+ ~KeyRequirement();
+
+ KeyRequirementKeyType key_type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::string key() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ KeyRequirementOperation operation() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::string pattern() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ bool matches(
+ const Environment * const env,
+ const std::shared_ptr<const PackageID> & id) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ /**
+ * Return a raw string representation of ourself.
+ */
+ const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE ChoiceRequirement :
+ public PackageDepSpecRequirement,
+ public ImplementAcceptMethods<PackageDepSpecRequirement, ChoiceRequirement>
+ {
+ private:
+ ChoiceRequirement(const ChoiceRequirement &) = delete;
+
+ protected:
+ ChoiceRequirement();
+
+ public:
+ /**
+ * Is our requirement met for a given PackageID?
+ *
+ * The string in the return type might be a description of why the
+ * requirement was not met. Sometimes better messages can be given
+ * than simply the return value of as_human_string() when the ID to
+ * be matched is known. If the bool is false, the string is
+ * meaningless.
+ *
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.61 is in ChoiceRequirement
+ */
+ virtual const std::pair<bool, std::string> requirement_met(
+ const Environment * const,
+ const ChangedChoices * const maybe_changes_to_owner,
+ const std::shared_ptr<const PackageID> & target_id,
+ const std::shared_ptr<const PackageID> & spec_id,
+ const ChangedChoices * const maybe_changes_to_target) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * If possible, indicate which choices to change to make our
+ * requirement met for a particular ID.
+ *
+ * Verifies that the ID has the appropriate choice, and that that
+ * choice isn't locked.
+ *
+ * Returns true for changes made, false for not possible,
+ * indeterminate for nothing needs changing.
+ *
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.61 is in ChoiceRequirement
+ */
+ virtual Tribool accumulate_changes_to_make_met(
+ const Environment * const,
+ const ChangedChoices * const maybe_changes_to_owner,
+ const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & spec_id,
+ ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Return a human readable string representation of ourself.
+ *
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.61 is in ChoiceRequirement
+ */
+ virtual const std::string as_human_string(
+ const std::shared_ptr<const PackageID> & spec_id) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Return a raw string representation of ourself.
+ */
+ virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ };
+
+ extern template class Pool<NameRequirement>;
+ extern template class Pool<PackageNamePartRequirement>;
+ extern template class Pool<CategoryNamePartRequirement>;
+ extern template class Pool<VersionRequirement>;
+ extern template class Pool<InRepositoryRequirement>;
+ extern template class Pool<FromRepositoryRequirement>;
+ extern template class Pool<InstalledAtPathRequirement>;
+ extern template class Pool<InstallableToPathRequirement>;
+ extern template class Pool<InstallableToRepositoryRequirement>;
+ extern template class Pool<ExactSlotRequirement>;
+ extern template class Pool<AnySlotRequirement>;
+ extern template class Pool<KeyRequirement>;
+
+ extern template class Pimp<VersionRequirement>;
+}
+
+#endif
diff --git a/paludis/package_dep_spec_requirement.se b/paludis/package_dep_spec_requirement.se
new file mode 100644
index 0000000..b3fc7ff
--- /dev/null
+++ b/paludis/package_dep_spec_requirement.se
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_KeyRequirementOperation()
+{
+ prefix kro
+
+ key kro_equals "An = requirement"
+ key kro_tilde "A ~ requirement"
+ key kro_less_than "A less than requirement"
+ key kro_greater_than "A greater than requirement"
+ key kro_question "A question requirement"
+}
+
+make_enum_KeyRequirementKeyType()
+{
+ prefix krkt
+
+ key krkt_id "A regular [.key] requirement"
+ key krkt_id_role "A role [.\$key] requirement"
+ key krkt_id_mask "A role [.(mask)] requirement"
+ key krkt_repo "A [.::repo] requirement"
+ key krkt_repo_role "A [.::\$repo] requirement"
+}
+
+make_enum_VersionRequirementCombiner()
+{
+ prefix vrc
+
+ key vrc_and "And with previous value"
+ key vrc_or "Or with previons value"
+}
+
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 5a35e9b..2b62a8e 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -44,7 +44,7 @@
#include <paludis/environment.hh>
#include <paludis/spec_tree.hh>
#include <paludis/package_dep_spec_properties.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <unordered_map>
#include <unordered_set>
@@ -204,7 +204,7 @@ PaludisLikeOptionsConf::add_file(const FSPath & f)
tokens.at(0), _imp->params.environment(),
{ updso_allow_wildcards, updso_no_disambiguation, updso_throw_if_set })));
- if (d->all_choice_constraints() && ! d->all_choice_constraints()->empty())
+ if (d->all_choice_requirements() && ! d->all_choice_requirements()->empty())
{
Log::get_instance()->message("paludislike_options_conf.bad_spec", ll_warning, lc_context)
<< "Dependency specification '" << stringify(*d)
@@ -212,10 +212,10 @@ PaludisLikeOptionsConf::add_file(const FSPath & f)
continue;
}
- if (d->package_name_constraint())
+ if (d->package_name_requirement())
{
SpecificSpecs::iterator i(_imp->specific_specs.insert(std::make_pair(
- d->package_name_constraint()->name(),
+ d->package_name_requirement()->name(),
SpecsWithValuesGroups())).first);
values_groups = &i->second.insert(i->second.end(),
make_named_values<SpecWithValuesGroups>(
@@ -341,20 +341,20 @@ namespace
bool match_anything(const PackageDepSpec & spec)
{
return package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_constraint() = indeterminate,
+ n::has_any_slot_requirement() = indeterminate,
n::has_category_name_part() = false,
- n::has_choice_constraints() = false,
- n::has_exact_slot_constraint() = false,
+ n::has_choice_requirements() = false,
+ n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
n::has_installable_to_repository() = false,
n::has_installed_at_path() = false,
- n::has_key_constraints() = false,
+ n::has_key_requirements() = false,
n::has_package() = false,
n::has_package_name_part() = false,
n::has_tag() = false,
- n::has_version_constraints() = false
+ n::has_version_requirements() = false
));
}
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index 0d08a66..6337682 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -76,7 +76,7 @@ namespace paludis
{
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package(CategoryNamePart("group") + PackageNamePart(*i))));
+ .require_package(CategoryNamePart("group") + PackageNamePart(*i))));
specs->push_back(spec);
tree->top()->append(spec);
}
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 83e179c..bae7c80 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -294,9 +294,9 @@ ERepositorySets::security_set(bool insecurity) const
{
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package((*c)->name())
- .constrain_version(vcc_and, vo_equal, (*c)->version())
- .constrain_in_repository((*c)->repository_name())));
+ .require_package((*c)->name())
+ .require_version(vrc_and, vo_equal, (*c)->version())
+ .require_in_repository((*c)->repository_name())));
security_packages->top()->append(spec);
}
else
@@ -324,9 +324,9 @@ ERepositorySets::security_set(bool insecurity) const
}
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(MutablePackageDepSpecData({ })
- .constrain_package((*r)->name())
- .constrain_version(vcc_and, vo_equal, (*r)->version())
- .constrain_in_repository((*r)->repository_name())));
+ .require_package((*r)->name())
+ .require_version(vrc_and, vo_equal, (*r)->version())
+ .require_in_repository((*r)->repository_name())));
security_packages->top()->append(spec);
ok = true;
break;
diff --git a/paludis/repositories/e/exheres_mask_store.cc b/paludis/repositories/e/exheres_mask_store.cc
index 5b5a0e1..b6c6fd7 100644
--- a/paludis/repositories/e/exheres_mask_store.cc
+++ b/paludis/repositories/e/exheres_mask_store.cc
@@ -37,7 +37,7 @@
#include <paludis/match_package.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <algorithm>
#include <unordered_map>
@@ -165,8 +165,8 @@ ExheresMaskStore::_populate()
for (auto s(flat_specs.begin()), s_end(flat_specs.end()) ;
s != s_end ; ++s)
{
- if ((*s)->package_name_constraint())
- _imp->repo_mask[(*s)->package_name_constraint()->name()].push_back(std::make_pair(**s, make_mask_info(**s, *f)));
+ if ((*s)->package_name_requirement())
+ _imp->repo_mask[(*s)->package_name_requirement()->name()].push_back(std::make_pair(**s, make_mask_info(**s, *f)));
else
Log::get_instance()->message("e.package_mask.bad_spec", ll_warning, lc_context)
<< "Loading package mask spec '" << **s << "' failed because specification does not restrict to a "
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index db1864d..8f1a90f 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -35,7 +35,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <functional>
@@ -102,7 +102,7 @@ namespace
do
{
- if ((! node.spec()->any_slot_constraint()) || (! node.spec()->any_slot_constraint()->locking()))
+ if ((! node.spec()->any_slot_requirement()) || (! node.spec()->any_slot_requirement()->locking()))
break;
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
@@ -113,8 +113,8 @@ namespace
if ((*matches->last())->slot_key())
{
PackageDepSpec new_s(MutablePackageDepSpecData(*node.spec()->data())
- .unconstrain_any_slot()
- .constrain_exact_slot((*matches->last())->slot_key()->value(), true));
+ .unrequire_any_slot()
+ .require_exact_slot((*matches->last())->slot_key()->value(), true));
c = std::make_shared<PackageDepSpec>(new_s);
}
} while (false);
diff --git a/paludis/repositories/e/traditional_mask_store.cc b/paludis/repositories/e/traditional_mask_store.cc
index f969ab3..4c969ff 100644
--- a/paludis/repositories/e/traditional_mask_store.cc
+++ b/paludis/repositories/e/traditional_mask_store.cc
@@ -32,7 +32,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <algorithm>
#include <unordered_map>
@@ -101,8 +101,8 @@ TraditionalMaskStore::_populate()
auto a(parse_elike_package_dep_spec(
line->second.first, line->first->supported()->package_dep_spec_parse_options(),
line->first->supported()->version_spec_options()));
- if (a.package_name_constraint())
- _imp->repo_mask[a.package_name_constraint()->name()].push_back(std::make_pair(a, line->second.second));
+ if (a.package_name_requirement())
+ _imp->repo_mask[a.package_name_requirement()->name()].push_back(std::make_pair(a, line->second.second));
else
Log::get_instance()->message("e.package_mask.bad_spec", ll_warning, lc_context)
<< "Loading package mask spec '" << line->second.first << "' failed because specification does not restrict to a "
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index 50a26c8..ef501e0 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -51,7 +51,7 @@
#include <paludis/distribution.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <unordered_map>
#include <unordered_set>
@@ -361,8 +361,8 @@ namespace
line->first->supported()->package_dep_spec_parse_options(),
line->first->supported()->version_spec_options())));
- if (a->package_name_constraint())
- _imp->package_mask[a->package_name_constraint()->name()].push_back(std::make_pair(a, line->second.second));
+ if (a->package_name_requirement())
+ _imp->package_mask[a->package_name_requirement()->name()].push_back(std::make_pair(a, line->second.second));
else
Log::get_instance()->message("e.profile.package_mask.bad_spec", ll_warning, lc_context)
<< "Loading package.mask spec '" << line->second.first << "' failed because specification does not restrict to a "
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index a9515c4..99209e1 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -52,7 +52,7 @@
#include <paludis/output_manager.hh>
#include <paludis/dep_spec_annotations.hh>
#include <paludis/unformatted_pretty_printer.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <paludis/util/accept_visitor.hh>
@@ -1106,15 +1106,15 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
continue;
PackageDepSpec p(parse_user_package_dep_spec("=" + stringify(c) + "/" + s, _imp->params.environment(), { }));
- q->insert(p.package_name_constraint()->name());
- IDMap::iterator i(_imp->ids.find(p.package_name_constraint()->name()));
+ q->insert(p.package_name_requirement()->name());
+ IDMap::iterator i(_imp->ids.find(p.package_name_requirement()->name()));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(p.package_name_constraint()->name(), std::make_shared<PackageIDSequence>())).first;
+ i = _imp->ids.insert(std::make_pair(p.package_name_requirement()->name(), std::make_shared<PackageIDSequence>())).first;
- if ((! bool(p.all_version_constraints())) || (std::distance(p.all_version_constraints()->begin(), p.all_version_constraints()->end()) != 1))
- throw InternalError(PALUDIS_HERE, "didn't get a single version constraint");
+ if ((! bool(p.all_version_requirements())) || (std::distance(p.all_version_requirements()->begin(), p.all_version_requirements()->end()) != 1))
+ throw InternalError(PALUDIS_HERE, "didn't get a single version requirement");
- i->second->push_back(make_id(p.package_name_constraint()->name(), (*p.all_version_constraints()->begin())->version_spec(), *d));
+ i->second->push_back(make_id(p.package_name_requirement()->name(), (*p.all_version_requirements()->begin())->version_spec(), *d));
}
catch (const InternalError &)
{
@@ -1272,12 +1272,12 @@ namespace
void visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & node)
{
- if (node.spec()->package_name_constraint() && rewrites.end() != rewrites.find(node.spec()->package_name_constraint()->name()))
+ if (node.spec()->package_name_requirement() && rewrites.end() != rewrites.find(node.spec()->package_name_requirement()->name()))
{
changed = true;
str << f.prettify(MutablePackageDepSpecData(*node.spec()->data())
- .unconstrain_package()
- .constrain_package(rewrites.find(node.spec()->package_name_constraint()->name())->second)) << " ";
+ .unrequire_package()
+ .require_package(rewrites.find(node.spec()->package_name_requirement()->name())->second)) << " ";
}
else
str << f.prettify(*node.spec()) << " ";
@@ -1615,8 +1615,8 @@ VDBRepository::perform_updates()
i != i_end ; ++i)
_imp->params.environment()->update_config_files_for_package_move(
MutablePackageDepSpecData({ })
- .unconstrain_package()
- .constrain_package(i->first),
+ .unrequire_package()
+ .require_package(i->first),
i->second
);
}
diff --git a/paludis/repositories/gemcutter/gemcutter_dependencies_key.cc b/paludis/repositories/gemcutter/gemcutter_dependencies_key.cc
index 757f4ab..deccd13 100644
--- a/paludis/repositories/gemcutter/gemcutter_dependencies_key.cc
+++ b/paludis/repositories/gemcutter/gemcutter_dependencies_key.cc
@@ -176,8 +176,8 @@ namespace
VersionSpec ver(tokens[1], { });
return make_shared_copy(PackageDepSpec(MutablePackageDepSpecData({ pdsdo_always_use_ranged_deps })
- .constrain_package(QualifiedPackageName("gem/" + dep.name()))
- .constrain_version(vcc_and, op, ver)
+ .require_package(QualifiedPackageName("gem/" + dep.name()))
+ .require_version(vrc_and, op, ver)
));
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index f59ce46..f90a779 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -73,14 +73,14 @@ namespace paludis
spec(exact ?
std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package(v->name())
- .constrain_version(vcc_and, vo_equal, v->version())
- .constrain_exact_slot(v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN"), false)
- .constrain_in_repository(v->repository_name()))
+ .require_package(v->name())
+ .require_version(vrc_and, vo_equal, v->version())
+ .require_exact_slot(v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN"), false)
+ .require_in_repository(v->repository_name()))
:
std::make_shared<PackageDepSpec>(
MutablePackageDepSpecData({ })
- .constrain_package(v->name())
+ .require_package(v->name())
)
),
raw_name(r),
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 62288ea..6448be6 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -160,7 +160,7 @@ VirtualsRepository::need_names() const
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
_imp->names.push_back(std::make_pair((*p).virtual_name(), std::shared_ptr<const PackageDepSpec>(
- std::make_shared<PackageDepSpec>(MutablePackageDepSpecData({ }).constrain_package((*p).provided_by()->name())))));
+ std::make_shared<PackageDepSpec>(MutablePackageDepSpecData({ }).require_package((*p).provided_by()->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
diff --git a/paludis/resolver/collect_depped_upon.cc b/paludis/resolver/collect_depped_upon.cc
index f8f6a1d..3d97cdc 100644
--- a/paludis/resolver/collect_depped_upon.cc
+++ b/paludis/resolver/collect_depped_upon.cc
@@ -33,7 +33,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/match_package.hh>
#include <paludis/version_spec.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <algorithm>
@@ -111,7 +111,7 @@ namespace
{
auto spec(s.spec());
- if (s.spec()->any_slot_constraint() && ! s.spec()->any_slot_constraint()->locking())
+ if (s.spec()->any_slot_requirement() && ! s.spec()->any_slot_requirement()->locking())
{
auto best_eventual_id(best_eventual(env, *s.spec(), id_for_specs, newly_available));
if (! best_eventual_id)
@@ -120,8 +120,8 @@ namespace
{
MutablePackageDepSpecData part_spec(*s.spec()->data());
part_spec
- .unconstrain_exact_slot()
- .constrain_exact_slot(best_eventual_id->slot_key()->value(), false);
+ .unrequire_exact_slot()
+ .require_exact_slot(best_eventual_id->slot_key()->value(), false);
spec = std::make_shared<PackageDepSpec>(part_spec);
}
}
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 374039e..3d51481 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -69,7 +69,7 @@
#include <paludis/package_id.hh>
#include <paludis/changed_choices.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/version_operator.hh>
#include <paludis/dep_spec_data.hh>
@@ -1071,11 +1071,11 @@ Decider::_make_spec_for_preloading(const PackageDepSpec & spec,
/* we don't want to copy use deps from the constraint, since things like
* [foo?] start to get weird when there's no longer an associated ID. */
- result.unconstrain_choices();
+ result.unrequire_choices();
/* but we do want to impose our own ChangedChoices if necessary. */
if (changed_choices)
- changed_choices->add_constraints_to(result);
+ changed_choices->add_requirements_to(result);
return result;
}
@@ -1270,10 +1270,10 @@ Decider::find_any_score(
// AnyDepSpecChildHandler::commit in satitised_dependencies.cc
// matches this logic
OperatorScore operator_bias(os_worse_than_worst);
- if (spec.all_version_constraints() && ! spec.all_version_constraints()->empty())
+ if (spec.all_version_requirements() && ! spec.all_version_requirements()->empty())
{
OperatorScore score(os_worse_than_worst);
- for (auto v(spec.all_version_constraints()->begin()), v_end(spec.all_version_constraints()->end()) ;
+ for (auto v(spec.all_version_requirements()->begin()), v_end(spec.all_version_requirements()->end()) ;
v != v_end ; ++v)
{
OperatorScore local_score(os_worse_than_worst);
@@ -1308,15 +1308,15 @@ Decider::find_any_score(
else
switch ((*v)->combiner())
{
- case vcc_and:
+ case vrc_and:
score = is_block ? std::max(score, local_score) : std::min(score, local_score);
break;
- case vcc_or:
+ case vrc_or:
score = is_block ? std::min(score, local_score) : std::max(score, local_score);
break;
- case last_vcc:
+ case last_vrc:
break;
}
}
@@ -1330,9 +1330,9 @@ Decider::find_any_score(
}
/* explicit preferences come first */
- if (spec.package_name_constraint())
+ if (spec.package_name_requirement())
{
- Tribool prefer_or_avoid(_imp->fns.prefer_or_avoid_fn()(spec.package_name_constraint()->name()));
+ Tribool prefer_or_avoid(_imp->fns.prefer_or_avoid_fn()(spec.package_name_requirement()->name()));
if (prefer_or_avoid.is_true())
return std::make_pair(is_block ? acs_avoid : acs_prefer, operator_bias);
else if (prefer_or_avoid.is_false())
@@ -1345,7 +1345,7 @@ Decider::find_any_score(
Context sub_context("When working out whether it's acs_vacuous_blocker:");
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, our_id, { mpo_ignore_choice_constraints })
+ generator::Matches(spec, our_id, { mpo_ignore_choice_requirements })
| filter::SupportsAction<InstallAction>() | filter::NotMasked()
)]);
if (ids->empty())
@@ -1437,8 +1437,8 @@ Decider::_get_resolvents_for_blocker(const BlockDepSpec & spec,
Context context("When finding slots for '" + stringify(spec) + "':");
std::shared_ptr<SlotName> exact_slot;
- if (spec.blocking().exact_slot_constraint())
- exact_slot = make_shared_copy(spec.blocking().exact_slot_constraint()->name());
+ if (spec.blocking().exact_slot_requirement())
+ exact_slot = make_shared_copy(spec.blocking().exact_slot_requirement()->name());
DestinationTypes destination_types(_get_destination_types_for_blocker(spec, reason));
std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
@@ -1451,7 +1451,7 @@ Decider::_get_resolvents_for_blocker(const BlockDepSpec & spec,
else
{
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionInEachSlot(
- generator::Package(spec.blocking().package_name_constraint()->name())
+ generator::Package(spec.blocking().package_name_requirement()->name())
)]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
@@ -1479,8 +1479,8 @@ Decider::_get_resolvents_for(
std::shared_ptr<SlotName> exact_slot;
- if (spec.exact_slot_constraint())
- exact_slot = make_shared_copy(spec.exact_slot_constraint()->name());
+ if (spec.exact_slot_requirement())
+ exact_slot = make_shared_copy(spec.exact_slot_requirement()->name());
return _imp->fns.get_resolvents_for_fn()(spec, maybe_from_package_id_from_reason(reason), exact_slot, reason);
}
@@ -1511,7 +1511,7 @@ Decider::_get_error_resolvents_for(
),
*t);
- auto ids(_find_installable_id_candidates_for(spec.package_name_constraint()->name(), filter::All(), true, true));
+ auto ids(_find_installable_id_candidates_for(spec.package_name_requirement()->name(), filter::All(), true, true));
if (! ids->empty())
resolvent.slot() = make_named_values<SlotNameOrNull>(
n::name_or_null() = (*ids->rbegin())->slot_key() ?
@@ -1852,7 +1852,7 @@ Decider::_find_id_for_from(
{
MatchPackageOptions opts;
if (trying_changing_choices)
- opts += mpo_ignore_choice_constraints;
+ opts += mpo_ignore_choice_requirements;
std::shared_ptr<const PackageID> best_version;
for (PackageIDSequence::ReverseConstIterator i(ids->rbegin()), i_end(ids->rend()) ;
@@ -1892,8 +1892,8 @@ Decider::_find_id_for_from(
if (! (*c)->spec().if_package())
{
- if ((*c)->spec().if_block()->blocking().all_choice_constraints() &&
- ! (*c)->spec().if_block()->blocking().all_choice_constraints()->empty())
+ if ((*c)->spec().if_block()->blocking().all_choice_requirements() &&
+ ! (*c)->spec().if_block()->blocking().all_choice_requirements()->empty())
{
/* too complicated for now */
ok = false;
@@ -1901,14 +1901,14 @@ Decider::_find_id_for_from(
break;
}
- if (! (*c)->spec().if_package()->all_choice_constraints())
+ if (! (*c)->spec().if_package()->all_choice_requirements())
{
/* no additional requirements, so no tinkering required */
continue;
}
- for (auto a((*c)->spec().if_package()->all_choice_constraints()->begin()),
- a_end((*c)->spec().if_package()->all_choice_constraints()->end()) ;
+ for (auto a((*c)->spec().if_package()->all_choice_requirements()->begin()),
+ a_end((*c)->spec().if_package()->all_choice_requirements()->end()) ;
a != a_end ; ++a)
{
auto b((*a)->accumulate_changes_to_make_met(_imp->env,
diff --git a/paludis/resolver/get_constraints_for_dependent_helper.cc b/paludis/resolver/get_constraints_for_dependent_helper.cc
index 825d287..ea12ac5 100644
--- a/paludis/resolver/get_constraints_for_dependent_helper.cc
+++ b/paludis/resolver/get_constraints_for_dependent_helper.cc
@@ -84,9 +84,9 @@ GetConstraintsForDependentHelper::operator() (
else
{
MutablePackageDepSpecData partial_spec({ });
- partial_spec.constrain_package(id->name());
+ partial_spec.require_package(id->name());
if (id->slot_key())
- partial_spec.constrain_exact_slot(id->slot_key()->value(), false);
+ partial_spec.require_exact_slot(id->slot_key()->value(), false);
spec = std::make_shared<PackageDepSpec>(partial_spec);
}
diff --git a/paludis/resolver/get_constraints_for_purge_helper.cc b/paludis/resolver/get_constraints_for_purge_helper.cc
index 805ffbe..1234ce9 100644
--- a/paludis/resolver/get_constraints_for_purge_helper.cc
+++ b/paludis/resolver/get_constraints_for_purge_helper.cc
@@ -79,9 +79,9 @@ GetConstraintsForPurgeHelper::operator() (
const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
MutablePackageDepSpecData partial_spec({ });
- partial_spec.constrain_package(id->name());
+ partial_spec.require_package(id->name());
if (id->slot_key())
- partial_spec.constrain_exact_slot(id->slot_key()->value(), false);
+ partial_spec.require_exact_slot(id->slot_key()->value(), false);
PackageDepSpec spec(partial_spec);
const std::shared_ptr<WasUsedByReason> reason(std::make_shared<WasUsedByReason>(was_used_by_ids));
diff --git a/paludis/resolver/get_constraints_for_via_binary_helper.cc b/paludis/resolver/get_constraints_for_via_binary_helper.cc
index 48edbd1..7cf8e29 100644
--- a/paludis/resolver/get_constraints_for_via_binary_helper.cc
+++ b/paludis/resolver/get_constraints_for_via_binary_helper.cc
@@ -66,7 +66,7 @@ GetConstraintsForViaBinaryHelper::operator() (
auto result(std::make_shared<ConstraintSequence>());
MutablePackageDepSpecData partial_spec({ });
- partial_spec.constrain_package(resolution->resolvent().package());
+ partial_spec.require_package(resolution->resolvent().package());
PackageDepSpec spec(partial_spec);
auto reason(std::make_shared<ViaBinaryReason>(other_resolution->resolvent()));
diff --git a/paludis/resolver/get_initial_constraints_for_helper.cc b/paludis/resolver/get_initial_constraints_for_helper.cc
index 7c288b2..ef1fa0c 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.cc
+++ b/paludis/resolver/get_initial_constraints_for_helper.cc
@@ -243,7 +243,7 @@ GetInitialConstraintsForHelper::_make_initial_constraints_for(
n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = true,
n::reason() = std::make_shared<PresetReason>("is scm", make_null_shared_ptr()),
- n::spec() = MutablePackageDepSpecData({ }).constrain_package(resolvent.package()),
+ n::spec() = MutablePackageDepSpecData({ }).require_package(resolvent.package()),
n::untaken() = false,
n::use_existing() = ue_only_if_transient
)));
diff --git a/paludis/resolver/get_resolvents_for_helper.cc b/paludis/resolver/get_resolvents_for_helper.cc
index 64026dd..2288b92 100644
--- a/paludis/resolver/get_resolvents_for_helper.cc
+++ b/paludis/resolver/get_resolvents_for_helper.cc
@@ -274,7 +274,7 @@ GetResolventsForHelper::operator() (
std::shared_ptr<const PackageID> best;
auto ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, from_id, { mpo_ignore_choice_constraints }) |
+ generator::Matches(spec, from_id, { mpo_ignore_choice_requirements }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked() |
(maybe_slot ? Filter(filter::Slot(*maybe_slot)) : Filter(filter::All())))]);
diff --git a/paludis/resolver/get_use_existing_nothing_helper.cc b/paludis/resolver/get_use_existing_nothing_helper.cc
index a07421a..6644e88 100644
--- a/paludis/resolver/get_use_existing_nothing_helper.cc
+++ b/paludis/resolver/get_use_existing_nothing_helper.cc
@@ -34,7 +34,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/environment.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <list>
using namespace paludis;
@@ -217,11 +217,11 @@ GetUseExistingNothingHelper::operator() (
{
Context context("When determining use existing for '" + stringify(spec) + "':");
- if (spec.package_name_constraint())
+ if (spec.package_name_requirement())
{
- if (use_existing_from_withish(_imp->env, spec.package_name_constraint()->name(), _imp->without_specs))
+ if (use_existing_from_withish(_imp->env, spec.package_name_requirement()->name(), _imp->without_specs))
return std::make_pair(ue_if_possible, true);
- if (use_existing_from_withish(_imp->env, spec.package_name_constraint()->name(), _imp->with_specs))
+ if (use_existing_from_withish(_imp->env, spec.package_name_requirement()->name(), _imp->with_specs))
return std::make_pair(ue_never, false);
}
diff --git a/paludis/resolver/interest_in_spec_helper.cc b/paludis/resolver/interest_in_spec_helper.cc
index 92d4aee..ab0436c 100644
--- a/paludis/resolver/interest_in_spec_helper.cc
+++ b/paludis/resolver/interest_in_spec_helper.cc
@@ -39,7 +39,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/match_package.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <list>
#include <set>
@@ -270,7 +270,7 @@ InterestInSpecHelper::operator() (
{
for (auto l(_imp->take_specs.begin()), l_end(_imp->take_specs.end()) ;
l != l_end ; ++l)
- if (match_qpns(*_imp->env, *l, dep.spec().if_package()->package_name_constraint()->name()))
+ if (match_qpns(*_imp->env, *l, dep.spec().if_package()->package_name_requirement()->name()))
return si_take;
}
@@ -299,7 +299,7 @@ InterestInSpecHelper::operator() (
{
for (auto l(_imp->ignore_specs.begin()), l_end(_imp->ignore_specs.end()) ;
l != l_end ; ++l)
- if (match_qpns(*_imp->env, *l, dep.spec().if_package()->package_name_constraint()->name()))
+ if (match_qpns(*_imp->env, *l, dep.spec().if_package()->package_name_requirement()->name()))
return si_ignore;
}
diff --git a/paludis/resolver/match_qpns.cc b/paludis/resolver/match_qpns.cc
index e277e84..5366e29 100644
--- a/paludis/resolver/match_qpns.cc
+++ b/paludis/resolver/match_qpns.cc
@@ -25,7 +25,7 @@
#include <paludis/environment.hh>
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/name.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
using namespace paludis;
using namespace paludis::resolver;
@@ -41,28 +41,28 @@ paludis::resolver::match_qpns(
* either can be wildcards (we could work for :slot too,
* but we're lazy) */
if (! package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_constraint() = false,
+ n::has_any_slot_requirement() = false,
n::has_category_name_part() = indeterminate,
- n::has_choice_constraints() = false,
- n::has_exact_slot_constraint() = false,
+ n::has_choice_requirements() = false,
+ n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
n::has_installable_to_repository() = false,
n::has_installed_at_path() = false,
- n::has_key_constraints() = false,
+ n::has_key_requirements() = false,
n::has_package() = indeterminate,
n::has_package_name_part() = indeterminate,
n::has_tag() = false,
- n::has_version_constraints() = false
+ n::has_version_requirements() = false
)))
return false;
- if (spec.package_name_constraint() && spec.package_name_constraint()->name() != package)
+ if (spec.package_name_requirement() && spec.package_name_requirement()->name() != package)
return false;
- if (spec.package_name_part_constraint() && spec.package_name_part_constraint()->name_part() != package.package())
+ if (spec.package_name_part_requirement() && spec.package_name_part_requirement()->name_part() != package.package())
return false;
- if (spec.category_name_part_constraint() && spec.category_name_part_constraint()->name_part() != package.category())
+ if (spec.category_name_part_requirement() && spec.category_name_part_requirement()->name_part() != package.category())
return false;
return true;
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 38f3592..7c600e7 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -823,8 +823,8 @@ namespace
if (changes_to_make_decision.if_via_new_binary_in())
result
- .unconstrain_in_repository()
- .constrain_in_repository(*changes_to_make_decision.if_via_new_binary_in());
+ .unrequire_in_repository()
+ .require_in_repository(*changes_to_make_decision.if_via_new_binary_in());
return result;
}
diff --git a/paludis/resolver/resolvent.cc b/paludis/resolver/resolvent.cc
index 46d3408..7582648 100644
--- a/paludis/resolver/resolvent.cc
+++ b/paludis/resolver/resolvent.cc
@@ -29,7 +29,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/serialise-impl.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
using namespace paludis;
using namespace paludis::resolver;
@@ -84,7 +84,7 @@ Resolvent::Resolvent(
const SlotName & s,
const DestinationType t) :
destination_type(n::destination_type() = t),
- package(n::package() = spec.package_name_constraint()->name()),
+ package(n::package() = spec.package_name_requirement()->name()),
slot(make_named_values<SlotNameOrNull>(
n::name_or_null() = std::make_shared<SlotName>(s),
n::null_means_unknown() = false
@@ -97,7 +97,7 @@ Resolvent::Resolvent(
const SlotNameOrNull & s,
const DestinationType t) :
destination_type(n::destination_type() = t),
- package(n::package() = spec.package_name_constraint()->name()),
+ package(n::package() = spec.package_name_requirement()->name()),
slot(s)
{
}
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index d283ab5..c24a151 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -168,7 +168,7 @@ namespace
void visit_package_spec(const PackageDepSpec & spec)
{
- if (spec.package_name_constraint())
+ if (spec.package_name_requirement())
visit_package_or_block_spec(PackageOrBlockDepSpec(spec));
else
super_complicated = true;
@@ -176,7 +176,7 @@ namespace
void visit_block_spec(const BlockDepSpec & spec)
{
- if (spec.blocking().package_name_constraint())
+ if (spec.blocking().package_name_requirement())
visit_package_or_block_spec(PackageOrBlockDepSpec(spec));
else
super_complicated = true;
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index 0d8202b..a6c637e 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -38,7 +38,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/elike_blocker.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <map>
@@ -95,13 +95,13 @@ SpecRewriter::~SpecRewriter() = default;
const std::shared_ptr<const RewrittenSpec>
SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::shared_ptr<const Resolvent> & maybe_our_resolvent) const
{
- if (s.if_package() && s.if_package()->package_name_constraint())
+ if (s.if_package() && s.if_package()->package_name_requirement())
{
- if (s.if_package()->package_name_constraint()->name().category() != CategoryNamePart("virtual"))
+ if (s.if_package()->package_name_requirement()->name().category() != CategoryNamePart("virtual"))
return make_null_shared_ptr();
_need_rewrites();
- Rewrites::const_iterator r(_imp->rewrites.find(s.if_package()->package_name_constraint()->name()));
+ Rewrites::const_iterator r(_imp->rewrites.find(s.if_package()->package_name_requirement()->name()));
if (r == _imp->rewrites.end())
return make_null_shared_ptr();
@@ -112,18 +112,18 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
n != n_end ; ++n)
result->specs()->push_back(PackageOrBlockDepSpec(MutablePackageDepSpecData(*s.if_package()->data())
- .unconstrain_package()
- .constrain_package(*n)));
+ .unrequire_package()
+ .require_package(*n)));
return result;
}
- else if (s.if_block() && s.if_block()->blocking().package_name_constraint())
+ else if (s.if_block() && s.if_block()->blocking().package_name_requirement())
{
- if (s.if_block()->blocking().package_name_constraint()->name().category() != CategoryNamePart("virtual"))
+ if (s.if_block()->blocking().package_name_requirement()->name().category() != CategoryNamePart("virtual"))
return make_null_shared_ptr();
_need_rewrites();
- Rewrites::const_iterator r(_imp->rewrites.find(s.if_block()->blocking().package_name_constraint()->name()));
+ Rewrites::const_iterator r(_imp->rewrites.find(s.if_block()->blocking().package_name_requirement()->name()));
if (r == _imp->rewrites.end())
return make_null_shared_ptr();
@@ -138,8 +138,8 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
continue;
PackageDepSpec spec(MutablePackageDepSpecData(*s.if_block()->blocking().data())
- .unconstrain_package()
- .constrain_package(*n));
+ .unrequire_package()
+ .require_package(*n));
auto p(split_elike_blocker(s.if_block()->text()));
BlockDepSpec b(std::get<1>(p) + stringify(spec), spec);
b.set_annotations(s.if_block()->maybe_annotations());
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 39afe44..ec86695 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -38,7 +38,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <list>
@@ -171,14 +171,14 @@ namespace
PackageDepSpec name_and_slot(const PackageDepSpec & spec)
{
- if (spec.exact_slot_constraint())
+ if (spec.exact_slot_requirement())
return MutablePackageDepSpecData({ })
- .constrain_package(spec.package_name_constraint()->name())
- .constrain_exact_slot(spec.exact_slot_constraint()->name(), spec.exact_slot_constraint()->locked())
+ .require_package(spec.package_name_requirement()->name())
+ .require_exact_slot(spec.exact_slot_requirement()->name(), spec.exact_slot_requirement()->locked())
;
else
return MutablePackageDepSpecData({ })
- .constrain_package(spec.package_name_constraint()->name());
+ .require_package(spec.package_name_requirement()->name());
}
void
@@ -251,13 +251,13 @@ namespace
}
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(params.parser()(tokens.at(1))));
- if (spec->package_name_constraint())
+ if (spec->package_name_requirement())
{
if (! params.environment())
Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
<< "Line '" << line << "' uses ? operator but no environment is available";
else if (! (*params.environment())[selection::SomeArbitraryVersion(
- generator::Package(spec->package_name_constraint()->name()) |
+ generator::Package(spec->package_name_requirement()->name()) |
filter::InstalledAtRoot(params.environment()->preferred_root_key()->value()))]->empty())
result->top()->append(spec);
}
@@ -275,7 +275,7 @@ namespace
}
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(params.parser()(tokens.at(1))));
- if (spec->package_name_constraint())
+ if (spec->package_name_requirement())
{
if (! params.environment())
Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 399e965..0cbd015 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -63,24 +63,24 @@ namespace
throw PackageDepSpecError("Wildcard '*' not allowed");
if (0 != s.compare(s.length() - 2, 2, "/*"))
- result.constrain_package_name_part(PackageNamePart(s.substr(2)));
+ result.require_package_name_part(PackageNamePart(s.substr(2)));
}
else if (s.length() >= 3 && (0 == s.compare(s.length() - 2, 2, "/*")))
{
if (! options[updso_allow_wildcards])
throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(s) + "'");
- result.constrain_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
+ result.require_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
}
else if (s == "*")
throw PackageDepSpecError("Use '*/*' not '*' to match everything");
else if (std::string::npos != s.find('/'))
- result.constrain_package(QualifiedPackageName(s));
+ result.require_package(QualifiedPackageName(s));
else
{
if (options[updso_no_disambiguation])
throw PackageDepSpecError("Need an explicit category specified");
- result.constrain_package(env->fetch_unique_qualified_package_name(PackageNamePart(s),
+ result.require_package(env->fetch_unique_qualified_package_name(PackageNamePart(s),
filter::And(filter, filter::Matches(result, make_null_shared_ptr(), { }))));
}
}
@@ -90,16 +90,16 @@ namespace
if (s.length() >= 3 && (0 == s.compare(0, 2, "*/")))
{
if (0 != s.compare(s.length() - 2, 2, "/*"))
- result.constrain_package_name_part(PackageNamePart(s.substr(2)));
+ result.require_package_name_part(PackageNamePart(s.substr(2)));
}
else if (s.length() >= 3 && (0 == s.compare(s.length() - 2, 2, "/*")))
{
- result.constrain_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
+ result.require_category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
}
else if (s == "*")
throw PackageDepSpecError("Use '*/*' not '*' to match everything");
else if (std::string::npos != s.find('/'))
- result.constrain_package(QualifiedPackageName(s));
+ result.require_package(QualifiedPackageName(s));
else
{
throw PackageDepSpecError("Need an explicit category specified");
@@ -160,13 +160,13 @@ namespace
case '.':
{
- auto k(parse_user_key_constraint(flag.substr(1)));
- result.constrain_key(std::get<0>(k), std::get<1>(k), std::get<2>(k), std::get<3>(k));
+ auto k(parse_user_key_requirement(flag.substr(1)));
+ result.require_key(std::get<0>(k), std::get<1>(k), std::get<2>(k), std::get<3>(k));
}
break;
default:
- result.constrain_choice(parse_elike_use_requirement(flag, { }));
+ result.require_choice(parse_elike_use_requirement(flag, { }));
break;
};
@@ -181,7 +181,7 @@ namespace
std::string::size_type slot_p(s.rfind(':'));
if (std::string::npos != slot_p)
{
- result.constrain_exact_slot(SlotName(s.substr(slot_p + 1)), false);
+ result.require_exact_slot(SlotName(s.substr(slot_p + 1)), false);
s.erase(slot_p);
}
}
@@ -197,24 +197,24 @@ namespace
if ('?' == req.at(req.length() - 1))
{
if (req.length() >= 2 && '?' == req.at(req.length() - 2))
- reqs.constrain_installable_to_path(FSPath(req.substr(0, req.length() - 2)), true);
+ reqs.require_installable_to_path(FSPath(req.substr(0, req.length() - 2)), true);
else
- reqs.constrain_installable_to_path(FSPath(req.substr(0, req.length() - 1)), false);
+ reqs.require_installable_to_path(FSPath(req.substr(0, req.length() - 1)), false);
}
else
- reqs.constrain_installed_at_path(FSPath(req));
+ reqs.require_installed_at_path(FSPath(req));
}
else
{
if ('?' == req.at(req.length() - 1))
{
if (req.length() >= 3 && '?' == req.at(req.length() - 2))
- reqs.constrain_installable_to_repository(RepositoryName(req.substr(0, req.length() - 2)), true);
+ reqs.require_installable_to_repository(RepositoryName(req.substr(0, req.length() - 2)), true);
else
- reqs.constrain_installable_to_repository(RepositoryName(req.substr(0, req.length() - 1)), false);
+ reqs.require_installable_to_repository(RepositoryName(req.substr(0, req.length() - 1)), false);
}
else
- reqs.constrain_in_repository(RepositoryName(req));
+ reqs.require_in_repository(RepositoryName(req));
}
}
@@ -245,7 +245,7 @@ namespace
parse_rhs(result, right);
if (! left.empty())
- result.constrain_from_repository(RepositoryName(left));
+ result.require_from_repository(RepositoryName(left));
}
}
}
@@ -317,15 +317,15 @@ paludis::user_version_spec_options()
vso_ignore_case, vso_letters_anywhere, vso_dotted_suffixes };
}
-std::tuple<KeyConstraintKeyType, std::string, KeyConstraintOperation, std::string>
-paludis::parse_user_key_constraint(const std::string & s)
+std::tuple<KeyRequirementKeyType, std::string, KeyRequirementOperation, std::string>
+paludis::parse_user_key_requirement(const std::string & s)
{
std::string::size_type p(s.find_first_of("=<>?~"));
if (std::string::npos == p)
throw PackageDepSpecError("[." + s + "] contains no operator");
std::string key, value;
- KeyConstraintOperation op(last_kco);
+ KeyRequirementOperation op(last_kro);
if (s.at(p) == '?')
{
@@ -334,17 +334,17 @@ paludis::parse_user_key_constraint(const std::string & s)
else
{
key = s.substr(0, p);
- op = kco_question;
+ op = kro_question;
}
}
else
{
switch (s.at(p))
{
- case '=': op = kco_equals; break;
- case '~': op = kco_tilde; break;
- case '<': op = kco_less_than; break;
- case '>': op = kco_greater_than; break;
+ case '=': op = kro_equals; break;
+ case '~': op = kro_tilde; break;
+ case '<': op = kro_less_than; break;
+ case '>': op = kro_greater_than; break;
default:
throw PackageDepSpecError("[." + s + "] unknown operator");
}
@@ -352,25 +352,25 @@ paludis::parse_user_key_constraint(const std::string & s)
value = s.substr(p + 1);
}
- KeyConstraintKeyType type(kckt_id);
+ KeyRequirementKeyType type(krkt_id);
if (0 == key.compare(0, 3, "::$", 0, 3))
{
- type = kckt_repo_role;
+ type = krkt_repo_role;
key.erase(0, 3);
}
else if (0 == key.compare(0, 2, "::2", 0, 2))
{
- type = kckt_repo;
+ type = krkt_repo;
key.erase(0, 2);
}
else if (0 == key.compare(0, 1, "$", 0, 1))
{
- type = kckt_id_role;
+ type = krkt_id_role;
key.erase(0, 1);
}
else if (0 == key.compare(0, 1, "(", 0, 1) && ')' == key.at(key.length() - 1))
{
- type = kckt_id_mask;
+ type = krkt_id_mask;
key.erase(0, 1);
key.erase(key.length() - 1);
}
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index b96479a..aacacdd 100644
--- a/paludis/user_dep_spec.hh
+++ b/paludis/user_dep_spec.hh
@@ -23,7 +23,7 @@
#include <paludis/user_dep_spec-fwd.hh>
#include <paludis/dep_spec.hh>
#include <paludis/filter.hh>
-#include <paludis/package_dep_spec_constraint-fwd.hh>
+#include <paludis/package_dep_spec_requirement-fwd.hh>
#include <paludis/util/pimp.hh>
@@ -61,7 +61,7 @@ namespace paludis
* \ingroup g_dep_spec
* \since 0.61
*/
- std::tuple<KeyConstraintKeyType, std::string, KeyConstraintOperation, std::string> parse_user_key_constraint(
+ std::tuple<KeyRequirementKeyType, std::string, KeyRequirementOperation, std::string> parse_user_key_requirement(
const std::string &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
}
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index d4ed519..2a88bf4 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -20,7 +20,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/version_operator.hh>
#include <paludis/util/clone-impl.hh>
@@ -46,17 +46,17 @@ using namespace paludis;
namespace
{
- std::string dump_version_requirement(const VersionConstraint & v)
+ std::string dump_version_requirement(const VersionRequirement & v)
{
return stringify(v.version_operator()) + stringify(v.version_spec());
}
- std::string stringify_key_constraint(const KeyConstraint & k)
+ std::string stringify_key_requirement(const KeyRequirement & k)
{
return k.as_raw_string();
}
- std::string stringify_choice_constraint(const ChoiceConstraint & k)
+ std::string stringify_choice_requirement(const ChoiceRequirement & k)
{
return k.as_raw_string();
}
@@ -101,104 +101,104 @@ UserDepSpecTest::check_spec(
{
if (package.empty())
- EXPECT_TRUE(! spec.package_name_constraint());
+ EXPECT_TRUE(! spec.package_name_requirement());
else
{
- ASSERT_TRUE(bool(spec.package_name_constraint()));
- EXPECT_EQ(package, stringify(spec.package_name_constraint()->name()));
+ ASSERT_TRUE(bool(spec.package_name_requirement()));
+ EXPECT_EQ(package, stringify(spec.package_name_requirement()->name()));
}
if (category_name_part.empty())
- EXPECT_TRUE(! spec.category_name_part_constraint());
+ EXPECT_TRUE(! spec.category_name_part_requirement());
else
{
- ASSERT_TRUE(bool(spec.category_name_part_constraint()));
- EXPECT_EQ(category_name_part, stringify(spec.category_name_part_constraint()->name_part()));
+ ASSERT_TRUE(bool(spec.category_name_part_requirement()));
+ EXPECT_EQ(category_name_part, stringify(spec.category_name_part_requirement()->name_part()));
}
if (package_name_part.empty())
- EXPECT_TRUE(! spec.package_name_part_constraint());
+ EXPECT_TRUE(! spec.package_name_part_requirement());
else
{
- ASSERT_TRUE(bool(spec.package_name_part_constraint()));
- EXPECT_EQ(package_name_part, stringify(spec.package_name_part_constraint()->name_part()));
+ ASSERT_TRUE(bool(spec.package_name_part_requirement()));
+ EXPECT_EQ(package_name_part, stringify(spec.package_name_part_requirement()->name_part()));
}
if (! version_requirement_mode.empty())
{
- ASSERT_TRUE(bool(spec.all_version_constraints()));
- ASSERT_TRUE(! spec.all_version_constraints()->empty());
- for (auto v(next(spec.all_version_constraints()->begin())), v_end(spec.all_version_constraints()->end()) ;
+ ASSERT_TRUE(bool(spec.all_version_requirements()));
+ ASSERT_TRUE(! spec.all_version_requirements()->empty());
+ for (auto v(next(spec.all_version_requirements()->begin())), v_end(spec.all_version_requirements()->end()) ;
v != v_end ; ++v)
EXPECT_EQ(version_requirement_mode, stringify((*v)->combiner()));
}
if (version_requirements.empty())
- EXPECT_TRUE((! spec.all_version_constraints()) || spec.all_version_constraints()->empty());
+ EXPECT_TRUE((! spec.all_version_requirements()) || spec.all_version_requirements()->empty());
else
{
- ASSERT_TRUE(bool(spec.all_version_constraints()));
+ ASSERT_TRUE(bool(spec.all_version_requirements()));
EXPECT_EQ(version_requirements, stringify(join(
- indirect_iterator(spec.all_version_constraints()->begin()),
- indirect_iterator(spec.all_version_constraints()->end()), ", ", &dump_version_requirement)));
+ indirect_iterator(spec.all_version_requirements()->begin()),
+ indirect_iterator(spec.all_version_requirements()->end()), ", ", &dump_version_requirement)));
}
if (slot_requirement.empty())
- EXPECT_TRUE(! spec.exact_slot_constraint());
+ EXPECT_TRUE(! spec.exact_slot_requirement());
else
{
- ASSERT_TRUE(bool(spec.exact_slot_constraint()));
- EXPECT_EQ(slot_requirement, ":" + stringify(spec.exact_slot_constraint()->name()));
+ ASSERT_TRUE(bool(spec.exact_slot_requirement()));
+ EXPECT_EQ(slot_requirement, ":" + stringify(spec.exact_slot_requirement()->name()));
}
if (from_repository.empty())
- EXPECT_TRUE(! spec.from_repository_constraint());
+ EXPECT_TRUE(! spec.from_repository_requirement());
else
{
- ASSERT_TRUE(bool(spec.from_repository_constraint()));
- EXPECT_EQ(from_repository, stringify(spec.from_repository_constraint()->name()));
+ ASSERT_TRUE(bool(spec.from_repository_requirement()));
+ EXPECT_EQ(from_repository, stringify(spec.from_repository_requirement()->name()));
}
if (in_repository.empty())
- EXPECT_TRUE(! spec.in_repository_constraint());
+ EXPECT_TRUE(! spec.in_repository_requirement());
else
{
- ASSERT_TRUE(bool(spec.in_repository_constraint()));
- EXPECT_EQ(in_repository, stringify(spec.in_repository_constraint()->name()));
+ ASSERT_TRUE(bool(spec.in_repository_requirement()));
+ EXPECT_EQ(in_repository, stringify(spec.in_repository_requirement()->name()));
}
if (additional_requirement.empty())
- EXPECT_TRUE((! spec.all_choice_constraints()) || spec.all_choice_constraints()->empty());
+ EXPECT_TRUE((! spec.all_choice_requirements()) || spec.all_choice_requirements()->empty());
else
{
- ASSERT_TRUE(bool(spec.all_choice_constraints()) || bool(spec.all_key_constraints()));
+ ASSERT_TRUE(bool(spec.all_choice_requirements()) || bool(spec.all_key_requirements()));
std::string x;
- if (spec.all_choice_constraints())
+ if (spec.all_choice_requirements())
x.append(stringify(join(
- indirect_iterator(spec.all_choice_constraints()->begin()),
- indirect_iterator(spec.all_choice_constraints()->end()), ", ", &stringify_choice_constraint)));
- if (spec.all_key_constraints())
+ indirect_iterator(spec.all_choice_requirements()->begin()),
+ indirect_iterator(spec.all_choice_requirements()->end()), ", ", &stringify_choice_requirement)));
+ if (spec.all_key_requirements())
x.append(stringify(join(
- indirect_iterator(spec.all_key_constraints()->begin()),
- indirect_iterator(spec.all_key_constraints()->end()), ", ", &stringify_key_constraint)));
+ indirect_iterator(spec.all_key_requirements()->begin()),
+ indirect_iterator(spec.all_key_requirements()->end()), ", ", &stringify_key_requirement)));
EXPECT_EQ(additional_requirement, x);
}
if (installed_at_path.empty())
- EXPECT_TRUE(! spec.installed_at_path_constraint());
+ EXPECT_TRUE(! spec.installed_at_path_requirement());
else
{
- ASSERT_TRUE(bool(spec.installed_at_path_constraint()));
- EXPECT_EQ(installed_at_path, stringify(spec.installed_at_path_constraint()->path()));
+ ASSERT_TRUE(bool(spec.installed_at_path_requirement()));
+ EXPECT_EQ(installed_at_path, stringify(spec.installed_at_path_requirement()->path()));
}
if (installable_to_path_f.empty())
- EXPECT_TRUE(! spec.installable_to_path_constraint());
+ EXPECT_TRUE(! spec.installable_to_path_requirement());
else
{
- ASSERT_TRUE(bool(spec.installable_to_path_constraint()));
- EXPECT_EQ(installable_to_path_f, stringify(spec.installable_to_path_constraint()->path()));
- EXPECT_EQ(installable_to_path_s, spec.installable_to_path_constraint()->include_masked());
+ ASSERT_TRUE(bool(spec.installable_to_path_requirement()));
+ EXPECT_EQ(installable_to_path_f, stringify(spec.installable_to_path_requirement()->path()));
+ EXPECT_EQ(installable_to_path_s, spec.installable_to_path_requirement()->include_masked());
}
}
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 4898d54..318fa91 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -27,7 +27,7 @@
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/dep_spec_data.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/version_spec.hh>
#include <paludis/version_operator.hh>
@@ -73,33 +73,33 @@ namespace paludis
template<>
struct Imp<PythonPackageDepSpec>
{
- std::shared_ptr<const NameConstraint> package_name_constraint;
- std::shared_ptr<const CategoryNamePartConstraint> category_name_part_constraint;
- std::shared_ptr<const PackageNamePartConstraint> package_name_part_constraint;
- std::shared_ptr<const VersionConstraintSequence> all_versions;
- std::shared_ptr<const AnySlotConstraint> any_slot;
- std::shared_ptr<const ExactSlotConstraint> exact_slot;
- std::shared_ptr<const InRepositoryConstraint> in_repository;
- std::shared_ptr<const FromRepositoryConstraint> from_repository;
- std::shared_ptr<const KeyConstraintSequence> all_keys;
- std::shared_ptr<const ChoiceConstraintSequence> all_choices;
+ std::shared_ptr<const NameRequirement> package_name_requirement;
+ std::shared_ptr<const CategoryNamePartRequirement> category_name_part_requirement;
+ std::shared_ptr<const PackageNamePartRequirement> package_name_part_requirement;
+ std::shared_ptr<const VersionRequirementSequence> all_versions;
+ std::shared_ptr<const AnySlotRequirement> any_slot;
+ std::shared_ptr<const ExactSlotRequirement> exact_slot;
+ std::shared_ptr<const InRepositoryRequirement> in_repository;
+ std::shared_ptr<const FromRepositoryRequirement> from_repository;
+ std::shared_ptr<const KeyRequirementSequence> all_keys;
+ std::shared_ptr<const ChoiceRequirementSequence> all_choices;
const std::string str;
Imp(
- const std::shared_ptr<const NameConstraint> & q,
- const std::shared_ptr<const CategoryNamePartConstraint> & c,
- const std::shared_ptr<const PackageNamePartConstraint> & p,
- const std::shared_ptr<const VersionConstraintSequence> & v,
- const std::shared_ptr<const AnySlotConstraint> & s,
- const std::shared_ptr<const ExactSlotConstraint> & xs,
- const std::shared_ptr<const InRepositoryConstraint> & ri,
- const std::shared_ptr<const FromRepositoryConstraint> & rf,
- const std::shared_ptr<const KeyConstraintSequence> & k,
- const std::shared_ptr<const ChoiceConstraintSequence> & a,
+ const std::shared_ptr<const NameRequirement> & q,
+ const std::shared_ptr<const CategoryNamePartRequirement> & c,
+ const std::shared_ptr<const PackageNamePartRequirement> & p,
+ const std::shared_ptr<const VersionRequirementSequence> & v,
+ const std::shared_ptr<const AnySlotRequirement> & s,
+ const std::shared_ptr<const ExactSlotRequirement> & xs,
+ const std::shared_ptr<const InRepositoryRequirement> & ri,
+ const std::shared_ptr<const FromRepositoryRequirement> & rf,
+ const std::shared_ptr<const KeyRequirementSequence> & k,
+ const std::shared_ptr<const ChoiceRequirementSequence> & a,
const std::string & st) :
- package_name_constraint(q),
- category_name_part_constraint(c),
- package_name_part_constraint(p),
+ package_name_requirement(q),
+ category_name_part_requirement(c),
+ package_name_part_requirement(p),
all_versions(v),
any_slot(s),
exact_slot(xs),
@@ -226,16 +226,16 @@ deep_copy(const std::shared_ptr<const T_> & x)
PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
PythonStringDepSpec(p.text()),
_imp(
- p.package_name_constraint(),
- p.category_name_part_constraint(),
- p.package_name_part_constraint(),
- p.all_version_constraints(),
- p.any_slot_constraint(),
- p.exact_slot_constraint(),
- p.in_repository_constraint(),
- p.from_repository_constraint(),
- p.all_key_constraints(),
- p.all_choice_constraints(),
+ p.package_name_requirement(),
+ p.category_name_part_requirement(),
+ p.package_name_part_requirement(),
+ p.all_version_requirements(),
+ p.any_slot_requirement(),
+ p.exact_slot_requirement(),
+ p.in_repository_requirement(),
+ p.from_repository_requirement(),
+ p.all_key_requirements(),
+ p.all_choice_requirements(),
stringify(p))
{
}
@@ -243,16 +243,16 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
PythonPackageDepSpec::PythonPackageDepSpec(const PythonPackageDepSpec & p) :
PythonStringDepSpec(p.text()),
_imp(
- p.package_name_constraint(),
- p.category_name_part_constraint(),
- p.package_name_part_constraint(),
- p.all_version_constraints(),
- p.any_slot_constraint(),
- p.exact_slot_constraint(),
- p.in_repository_constraint(),
- p.from_repository_constraint(),
- p.all_key_constraints(),
- p.all_choice_constraints(),
+ p.package_name_requirement(),
+ p.category_name_part_requirement(),
+ p.package_name_part_requirement(),
+ p.all_version_requirements(),
+ p.any_slot_requirement(),
+ p.exact_slot_requirement(),
+ p.in_repository_requirement(),
+ p.from_repository_requirement(),
+ p.all_key_requirements(),
+ p.all_choice_requirements(),
p.py_str())
{
}
@@ -265,46 +265,46 @@ PythonPackageDepSpec::operator PackageDepSpec() const
{
MutablePackageDepSpecData p({ });
- if (package_name_constraint())
- p.constrain_package(package_name_constraint()->name());
+ if (package_name_requirement())
+ p.require_package(package_name_requirement()->name());
- if (category_name_part_constraint())
- p.constrain_category_name_part(category_name_part_constraint()->name_part());
+ if (category_name_part_requirement())
+ p.require_category_name_part(category_name_part_requirement()->name_part());
- if (package_name_part_constraint())
- p.constrain_package_name_part(package_name_part_constraint()->name_part());
+ if (package_name_part_requirement())
+ p.require_package_name_part(package_name_part_requirement()->name_part());
- if (all_version_constraints())
+ if (all_version_requirements())
{
- for (auto i(all_version_constraints()->begin()), i_end(all_version_constraints()->end()) ;
+ for (auto i(all_version_requirements()->begin()), i_end(all_version_requirements()->end()) ;
i != i_end ; ++i)
- p.constrain_version((*i)->combiner(), (*i)->version_operator(), (*i)->version_spec());
+ p.require_version((*i)->combiner(), (*i)->version_operator(), (*i)->version_spec());
}
- if (any_slot_constraint())
- p.constrain_any_slot(any_slot_constraint()->locking());
+ if (any_slot_requirement())
+ p.require_any_slot(any_slot_requirement()->locking());
- if (exact_slot_constraint())
- p.constrain_exact_slot(exact_slot_constraint()->name(), exact_slot_constraint()->locked());
+ if (exact_slot_requirement())
+ p.require_exact_slot(exact_slot_requirement()->name(), exact_slot_requirement()->locked());
- if (in_repository_constraint())
- p.constrain_in_repository(in_repository_constraint()->name());
+ if (in_repository_requirement())
+ p.require_in_repository(in_repository_requirement()->name());
- if (from_repository_constraint())
- p.constrain_from_repository(from_repository_constraint()->name());
+ if (from_repository_requirement())
+ p.require_from_repository(from_repository_requirement()->name());
- if (all_choice_constraints())
+ if (all_choice_requirements())
{
- for (ChoiceConstraintSequence::ConstIterator i(all_choice_constraints()->begin()),
- i_end(all_choice_constraints()->end()) ; i != i_end ; ++i)
- p.constrain_choice(*i);
+ for (ChoiceRequirementSequence::ConstIterator i(all_choice_requirements()->begin()),
+ i_end(all_choice_requirements()->end()) ; i != i_end ; ++i)
+ p.require_choice(*i);
}
- if (all_key_constraints())
+ if (all_key_requirements())
{
- for (auto i(all_key_constraints()->begin()), i_end(all_key_constraints()->end()) ;
+ for (auto i(all_key_requirements()->begin()), i_end(all_key_requirements()->end()) ;
i != i_end ; ++i)
- p.constrain_key((*i)->key_type(), (*i)->key(), (*i)->operation(), (*i)->pattern());
+ p.require_key((*i)->key_type(), (*i)->key(), (*i)->operation(), (*i)->pattern());
}
return PackageDepSpec(p);
@@ -316,62 +316,62 @@ PythonPackageDepSpec::operator std::shared_ptr<PackageDepSpec>() const
return std::make_shared<PackageDepSpec>(*this);
}
-const std::shared_ptr<const NameConstraint>
-PythonPackageDepSpec::package_name_constraint() const
+const std::shared_ptr<const NameRequirement>
+PythonPackageDepSpec::package_name_requirement() const
{
- return _imp->package_name_constraint;
+ return _imp->package_name_requirement;
}
-const std::shared_ptr<const PackageNamePartConstraint>
-PythonPackageDepSpec::package_name_part_constraint() const
+const std::shared_ptr<const PackageNamePartRequirement>
+PythonPackageDepSpec::package_name_part_requirement() const
{
- return _imp->package_name_part_constraint;
+ return _imp->package_name_part_requirement;
}
-const std::shared_ptr<const CategoryNamePartConstraint>
-PythonPackageDepSpec::category_name_part_constraint() const
+const std::shared_ptr<const CategoryNamePartRequirement>
+PythonPackageDepSpec::category_name_part_requirement() const
{
- return _imp->category_name_part_constraint;
+ return _imp->category_name_part_requirement;
}
-const std::shared_ptr<const VersionConstraintSequence>
-PythonPackageDepSpec::all_version_constraints() const
+const std::shared_ptr<const VersionRequirementSequence>
+PythonPackageDepSpec::all_version_requirements() const
{
return _imp->all_versions;
}
-const std::shared_ptr<const AnySlotConstraint>
-PythonPackageDepSpec::any_slot_constraint() const
+const std::shared_ptr<const AnySlotRequirement>
+PythonPackageDepSpec::any_slot_requirement() const
{
return _imp->any_slot;
}
-const std::shared_ptr<const ExactSlotConstraint>
-PythonPackageDepSpec::exact_slot_constraint() const
+const std::shared_ptr<const ExactSlotRequirement>
+PythonPackageDepSpec::exact_slot_requirement() const
{
return _imp->exact_slot;
}
-const std::shared_ptr<const InRepositoryConstraint>
-PythonPackageDepSpec::in_repository_constraint() const
+const std::shared_ptr<const InRepositoryRequirement>
+PythonPackageDepSpec::in_repository_requirement() const
{
return _imp->in_repository;
}
-const std::shared_ptr<const FromRepositoryConstraint>
-PythonPackageDepSpec::from_repository_constraint() const
+const std::shared_ptr<const FromRepositoryRequirement>
+PythonPackageDepSpec::from_repository_requirement() const
{
return _imp->from_repository;
}
-const std::shared_ptr<const ChoiceConstraintSequence>
-PythonPackageDepSpec::all_choice_constraints() const
+const std::shared_ptr<const ChoiceRequirementSequence>
+PythonPackageDepSpec::all_choice_requirements() const
{
return _imp->all_choices;
}
-const std::shared_ptr<const KeyConstraintSequence>
-PythonPackageDepSpec::all_key_constraints() const
+const std::shared_ptr<const KeyRequirementSequence>
+PythonPackageDepSpec::all_key_requirements() const
{
return _imp->all_keys;
}
@@ -1207,40 +1207,40 @@ void expose_dep_spec()
bp::no_init
)
- .add_property("package_name_constraint", &PythonPackageDepSpec::package_name_constraint,
- "[ro] NameConstraint\n"
- "Qualified package name constraint (may be None)."
+ .add_property("package_name_requirement", &PythonPackageDepSpec::package_name_requirement,
+ "[ro] NameRequirement\n"
+ "Qualified package name requirement (may be None)."
)
- .add_property("package_name_part_constraint", &PythonPackageDepSpec::package_name_part_constraint,
- "[ro] CategoryNamePartConstraint\n"
- "Package name part constraint (may be None)"
+ .add_property("package_name_part_requirement", &PythonPackageDepSpec::package_name_part_requirement,
+ "[ro] CategoryNamePartRequirement\n"
+ "Package name part requirement (may be None)"
)
- .add_property("category_name_part_constraint", &PythonPackageDepSpec::category_name_part_constraint,
- "[ro] CategoryNamePartConstraint\n"
- "Category name part constraint (may be None)."
+ .add_property("category_name_part_requirement", &PythonPackageDepSpec::category_name_part_requirement,
+ "[ro] CategoryNamePartRequirement\n"
+ "Category name part requirement (may be None)."
)
- .add_property("exact_slot", &PythonPackageDepSpec::exact_slot_constraint,
- "[ro] ExactSlotConstraint\n"
- "Exact slot constraint (may be None)."
+ .add_property("exact_slot", &PythonPackageDepSpec::exact_slot_requirement,
+ "[ro] ExactSlotRequirement\n"
+ "Exact slot requirement (may be None)."
)
- .add_property("any_slot", &PythonPackageDepSpec::any_slot_constraint,
- "[ro] AnySlotConstraint\n"
- "Any slot constraint (may be None)."
+ .add_property("any_slot", &PythonPackageDepSpec::any_slot_requirement,
+ "[ro] AnySlotRequirement\n"
+ "Any slot requirement (may be None)."
)
- .add_property("in_repository_constraint", &PythonPackageDepSpec::in_repository_constraint,
- "[ro] InRepositoryConstraint\n"
- "In repository constraint (may be None)."
+ .add_property("in_repository_requirement", &PythonPackageDepSpec::in_repository_requirement,
+ "[ro] InRepositoryRequirement\n"
+ "In repository requirement (may be None)."
)
- .add_property("from_repository_constraint", &PythonPackageDepSpec::from_repository_constraint,
- "[ro] FromRepositoryConstraint\n"
- "From repository constraint (may be None)."
+ .add_property("from_repository_requirement", &PythonPackageDepSpec::from_repository_requirement,
+ "[ro] FromRepositoryRequirement\n"
+ "From repository requirement (may be None)."
)
#if 0
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index ab1b30e..a6e407f 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -172,16 +172,16 @@ namespace paludis
operator PackageDepSpec() const;
operator std::shared_ptr<PackageDepSpec>() const;
- const std::shared_ptr<const NameConstraint> package_name_constraint() const;
- const std::shared_ptr<const PackageNamePartConstraint> package_name_part_constraint() const;
- const std::shared_ptr<const CategoryNamePartConstraint> category_name_part_constraint() const;
- const std::shared_ptr<const VersionConstraintSequence> all_version_constraints() const;
- const std::shared_ptr<const InRepositoryConstraint> in_repository_constraint() const;
- const std::shared_ptr<const FromRepositoryConstraint> from_repository_constraint() const;
- const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const;
- const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const;
- const std::shared_ptr<const KeyConstraintSequence> all_key_constraints() const;
- const std::shared_ptr<const ChoiceConstraintSequence> all_choice_constraints() const;
+ const std::shared_ptr<const NameRequirement> package_name_requirement() const;
+ const std::shared_ptr<const PackageNamePartRequirement> package_name_part_requirement() const;
+ const std::shared_ptr<const CategoryNamePartRequirement> category_name_part_requirement() const;
+ const std::shared_ptr<const VersionRequirementSequence> all_version_requirements() const;
+ const std::shared_ptr<const InRepositoryRequirement> in_repository_requirement() const;
+ const std::shared_ptr<const FromRepositoryRequirement> from_repository_requirement() const;
+ const std::shared_ptr<const ExactSlotRequirement> exact_slot_requirement() const;
+ const std::shared_ptr<const AnySlotRequirement> any_slot_requirement() const;
+ const std::shared_ptr<const KeyRequirementSequence> all_key_requirements() const;
+ const std::shared_ptr<const ChoiceRequirementSequence> all_choice_requirements() const;
std::string py_str() const;
};
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 476d717..da992cf 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -64,12 +64,12 @@ class TestCase_1_DepSpecs(unittest.TestCase):
def test_05_package(self):
self.get_depspecs()
- self.assertEqual(str(self.pds.package_name_constraint.name), "foo/bar")
+ self.assertEqual(str(self.pds.package_name_requirement.name), "foo/bar")
def test_06_in_from_repository(self):
self.get_depspecs()
- self.assertEqual(str(self.pds.in_repository_constraint.name), "testrepo")
- self.assertEqual(self.pds.from_repository_constraint, None)
+ self.assertEqual(str(self.pds.in_repository_requirement.name), "testrepo")
+ self.assertEqual(self.pds.from_repository_requirement, None)
### def test_09_additional_requirements(self):
### spec = parse_user_package_dep_spec("foo/monkey[foo]", UserPackageDepSpecOptions())
diff --git a/python/generator_TEST.py b/python/generator_TEST.py
index c1b690c..a35833b 100644
--- a/python/generator_TEST.py
+++ b/python/generator_TEST.py
@@ -35,8 +35,8 @@ class TestCase_01_Generator(unittest.TestCase):
self.assertEquals(str(Generator.Matches(parse_user_package_dep_spec("foo/bar",
env, []), MatchPackageOptions())), "packages matching foo/bar")
self.assertEquals(str(Generator.Matches(parse_user_package_dep_spec("foo/bar",
- env, []), [MatchPackageOption.IGNORE_CHOICE_CONSTRAINTS])),
- "packages matching foo/bar (ignoring choice constraints)")
+ env, []), [MatchPackageOption.IGNORE_CHOICE_REQUIREMENTS])),
+ "packages matching foo/bar (ignoring choice requirements)")
if __name__ == "__main__":
diff --git a/python/mask_TEST.py b/python/mask_TEST.py
index 40262ff..5190afd 100755
--- a/python/mask_TEST.py
+++ b/python/mask_TEST.py
@@ -98,7 +98,7 @@ class TestCase_01_Masks(unittest.TestCase):
self.assertEquals(m.key(), "A")
self.assertEquals(m.description(), "by association")
- self.assertEquals(m.associated_package_spec().package_name_constraint.name, "masked/repo")
+ self.assertEquals(m.associated_package_spec().package_name_requirement.name, "masked/repo")
elif os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") != "no":
raise "oops"
diff --git a/python/package_dep_spec_constraint.cc b/python/package_dep_spec_constraint.cc
index 7385ec2..d794a39 100644
--- a/python/package_dep_spec_constraint.cc
+++ b/python/package_dep_spec_constraint.cc
@@ -21,231 +21,231 @@
#include <python/paludis_python.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/fs_path.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
-// For classes derived from PackageDepSpecConstraint
+// For classes derived from PackageDepSpecRequirement
template <typename C_>
-class class_package_dep_spec_constraint :
- public bp::class_<C_, std::shared_ptr<C_>, bp::bases<PackageDepSpecConstraint>, boost::noncopyable>
+class class_package_dep_spec_requirement :
+ public bp::class_<C_, std::shared_ptr<C_>, bp::bases<PackageDepSpecRequirement>, boost::noncopyable>
{
public:
template <class Init_>
- class_package_dep_spec_constraint(const std::string & name, const std::string & class_doc, Init_ initspec) :
- bp::class_<C_, std::shared_ptr<C_>, bp::bases<PackageDepSpecConstraint>, boost::noncopyable>(
+ class_package_dep_spec_requirement(const std::string & name, const std::string & class_doc, Init_ initspec) :
+ bp::class_<C_, std::shared_ptr<C_>, bp::bases<PackageDepSpecRequirement>, boost::noncopyable>(
name.c_str(), class_doc.c_str(), initspec)
{
bp::register_ptr_to_python<std::shared_ptr<const C_> >();
- bp::implicitly_convertible<std::shared_ptr<C_>, std::shared_ptr<PackageDepSpecConstraint> >();
+ bp::implicitly_convertible<std::shared_ptr<C_>, std::shared_ptr<PackageDepSpecRequirement> >();
}
};
-void expose_package_dep_spec_constraint()
+void expose_package_dep_spec_requirement()
{
/**
* Enums
*/
- enum_auto("KeyConstraintOperation", last_kco,
- "The operation for a KeyConstraint");
+ enum_auto("KeyRequirementOperation", last_kro,
+ "The operation for a KeyRequirement");
/**
- * PackageDepSpecConstraint
+ * PackageDepSpecRequirement
*/
- bp::register_ptr_to_python<std::shared_ptr<const PackageDepSpecConstraint> >();
- bp::implicitly_convertible<std::shared_ptr<PackageDepSpecConstraint>,
- std::shared_ptr<const PackageDepSpecConstraint> >();
- bp::class_<PackageDepSpecConstraint, boost::noncopyable>
+ bp::register_ptr_to_python<std::shared_ptr<const PackageDepSpecRequirement> >();
+ bp::implicitly_convertible<std::shared_ptr<PackageDepSpecRequirement>,
+ std::shared_ptr<const PackageDepSpecRequirement> >();
+ bp::class_<PackageDepSpecRequirement, boost::noncopyable>
(
- "PackageDepSpecConstraint",
- "Base class for a constraint for a PackageDepSpec.",
+ "PackageDepSpecRequirement",
+ "Base class for a requirement for a PackageDepSpec.",
bp::no_init
)
;
/**
- * NameConstraint
+ * NameRequirement
*/
- class_package_dep_spec_constraint<NameConstraint>
+ class_package_dep_spec_requirement<NameRequirement>
(
- "NameConstraint",
- "A cat/pkg constraint for a PackageDepSpec.",
+ "NameRequirement",
+ "A cat/pkg requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name", &NameConstraint::name,
+ .add_property("name", &NameRequirement::name,
"[RO] The cat/pkg in question"
)
;
/**
- * PackageNamePartConstraint
+ * PackageNamePartRequirement
*/
- class_package_dep_spec_constraint<PackageNamePartConstraint>
+ class_package_dep_spec_requirement<PackageNamePartRequirement>
(
- "PackageNamePartConstraint",
- "A /pkg constraint for a PackageDepSpec.",
+ "PackageNamePartRequirement",
+ "A /pkg requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name_part", &PackageNamePartConstraint::name_part,
+ .add_property("name_part", &PackageNamePartRequirement::name_part,
"[RO] The /pkg in question"
)
;
/**
- * CategoryNamePartConstraint
+ * CategoryNamePartRequirement
*/
- class_package_dep_spec_constraint<CategoryNamePartConstraint>
+ class_package_dep_spec_requirement<CategoryNamePartRequirement>
(
- "CategoryNamePartConstraint",
- "A cat/ constraint for a PackageDepSpec.",
+ "CategoryNamePartRequirement",
+ "A cat/ requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name_part", &CategoryNamePartConstraint::name_part,
+ .add_property("name_part", &CategoryNamePartRequirement::name_part,
"[RO] The cat/ in question"
)
;
/**
- * InRepositoryConstraint
+ * InRepositoryRequirement
*/
- class_package_dep_spec_constraint<InRepositoryConstraint>
+ class_package_dep_spec_requirement<InRepositoryRequirement>
(
- "InRepositoryConstraint",
- "A ::repo constraint for a PackageDepSpec.",
+ "InRepositoryRequirement",
+ "A ::repo requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name", &InRepositoryConstraint::name,
+ .add_property("name", &InRepositoryRequirement::name,
"[RO] The ::repo name in question"
)
;
/**
- * FromRepositoryConstraint
+ * FromRepositoryRequirement
*/
- class_package_dep_spec_constraint<FromRepositoryConstraint>
+ class_package_dep_spec_requirement<FromRepositoryRequirement>
(
- "FromRepositoryConstraint",
- "A ::repo-> constraint for a PackageDepSpec.",
+ "FromRepositoryRequirement",
+ "A ::repo-> requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name", &FromRepositoryConstraint::name,
+ .add_property("name", &FromRepositoryRequirement::name,
"[RO] The ::repo-> name in question"
)
;
/**
- * InstalledAtPathConstraint
+ * InstalledAtPathRequirement
*/
- class_package_dep_spec_constraint<InstalledAtPathConstraint>
+ class_package_dep_spec_requirement<InstalledAtPathRequirement>
(
- "InstalledAtPathConstraint",
- "A ::/ constraint for a PackageDepSpec.",
+ "InstalledAtPathRequirement",
+ "A ::/ requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("path", &InstalledAtPathConstraint::path,
+ .add_property("path", &InstalledAtPathRequirement::path,
"[RO] The ::/ path in question"
)
;
/**
- * InstallableToPathConstraint
+ * InstallableToPathRequirement
*/
- class_package_dep_spec_constraint<InstallableToPathConstraint>
+ class_package_dep_spec_requirement<InstallableToPathRequirement>
(
- "InstalledableToPathConstraint",
- "A ::/? constraint for a PackageDepSpec.",
+ "InstalledableToPathRequirement",
+ "A ::/? requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("path", &InstallableToPathConstraint::path,
+ .add_property("path", &InstallableToPathRequirement::path,
"[RO] The ::/? path in question"
)
- .add_property("include_masked", &InstallableToPathConstraint::include_masked,
+ .add_property("include_masked", &InstallableToPathRequirement::include_masked,
"[RO] Whether to include masked, as per ::/??"
)
;
/**
- * InstallableToRepositoryConstraint
+ * InstallableToRepositoryRequirement
*/
- class_package_dep_spec_constraint<InstallableToRepositoryConstraint>
+ class_package_dep_spec_requirement<InstallableToRepositoryRequirement>
(
- "InstalledableToPathConstraint",
- "A ::/? constraint for a PackageDepSpec.",
+ "InstalledableToPathRequirement",
+ "A ::/? requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("name", &InstallableToRepositoryConstraint::name,
+ .add_property("name", &InstallableToRepositoryRequirement::name,
"[RO] The ::repo? in question"
)
- .add_property("include_masked", &InstallableToRepositoryConstraint::include_masked,
+ .add_property("include_masked", &InstallableToRepositoryRequirement::include_masked,
"[RO] Whether to include masked, as per ::repo??"
)
;
/**
- * AnySlotConstraint
+ * AnySlotRequirement
*/
- class_package_dep_spec_constraint<AnySlotConstraint>
+ class_package_dep_spec_requirement<AnySlotRequirement>
(
- "AnySlotConstraint",
- "A :* or := constraint for a PackageDepSpec.",
+ "AnySlotRequirement",
+ "A :* or := requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("locking", &AnySlotConstraint::locking,
+ .add_property("locking", &AnySlotRequirement::locking,
"[RO] Are we locking (:= rather than :*)?"
)
;
/**
- * ExactSlotConstraint
+ * ExactSlotRequirement
*/
- class_package_dep_spec_constraint<ExactSlotConstraint>
+ class_package_dep_spec_requirement<ExactSlotRequirement>
(
- "ExactSlotConstraint",
- "A :slot or :=slot constraint for a PackageDepSpec.",
+ "ExactSlotRequirement",
+ "A :slot or :=slot requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("locked", &ExactSlotConstraint::locked,
+ .add_property("locked", &ExactSlotRequirement::locked,
"[RO] Are we locked (:=blah)?"
)
- .add_property("name", &ExactSlotConstraint::name,
+ .add_property("name", &ExactSlotRequirement::name,
"[RO] The slot name"
)
;
/**
- * KeyConstraint
+ * KeyRequirement
*/
- class_package_dep_spec_constraint<KeyConstraint>
+ class_package_dep_spec_requirement<KeyRequirement>
(
- "KeyConstraint",
- "A [.key=value] constraint for a PackageDepSpec.",
+ "KeyRequirement",
+ "A [.key=value] requirement for a PackageDepSpec.",
bp::no_init
)
- .add_property("key", &KeyConstraint::key,
+ .add_property("key", &KeyRequirement::key,
"[RO] The key"
)
- .add_property("pattern", &KeyConstraint::pattern,
+ .add_property("pattern", &KeyRequirement::pattern,
"[RO] The pattern"
)
- .add_property("operation", &KeyConstraint::operation,
+ .add_property("operation", &KeyRequirement::operation,
"[RO] The operation"
)
;
diff --git a/python/paludis_python.hh b/python/paludis_python.hh
index da8dcdd..5df4800 100644
--- a/python/paludis_python.hh
+++ b/python/paludis_python.hh
@@ -188,7 +188,7 @@ void expose_mask() PALUDIS_VISIBLE;
void expose_match_package() PALUDIS_VISIBLE;
void expose_metadata_key() PALUDIS_VISIBLE;
void expose_name() PALUDIS_VISIBLE;
-void expose_package_dep_spec_constraint() PALUDIS_VISIBLE;
+void expose_package_dep_spec_requirement() PALUDIS_VISIBLE;
void expose_package_id() PALUDIS_VISIBLE;
void expose_repository() PALUDIS_VISIBLE;
void expose_selection() PALUDIS_VISIBLE;
diff --git a/python/paludis_python_so.cc b/python/paludis_python_so.cc
index dad35d9..179a119 100644
--- a/python/paludis_python_so.cc
+++ b/python/paludis_python_so.cc
@@ -36,7 +36,7 @@ BOOST_PYTHON_MODULE(paludis)
expose_fs_path();
expose_contents();
expose_filter(); /* must be before dep_spec */
- expose_package_dep_spec_constraint();
+ expose_package_dep_spec_requirement();
expose_dep_spec();
expose_dep_label();
expose_name();
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 7952976..09518dd 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -23,7 +23,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_operator.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
@@ -527,82 +527,82 @@ namespace
/*
* call-seq:
- * package_name_constraint -> NameConstraint or Nil
+ * package_name_requirement -> NameRequirement or Nil
*
- * Fetch the package name constraint (may be Nil).
+ * Fetch the package name requirement (may be Nil).
*/
VALUE
- package_dep_spec_package_name_constraint(VALUE self)
+ package_dep_spec_package_name_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_requirement());
}
/*
* call-seq:
- * package_name_part_constraint -> PackageNamePartConstraint or Nil
+ * package_name_part_requirement -> PackageNamePartRequirement or Nil
*
- * Fetch the package name part constraint (may be Nil).
+ * Fetch the package name part requirement (may be Nil).
*/
VALUE
- package_dep_spec_package_name_part_constraint(VALUE self)
+ package_dep_spec_package_name_part_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_requirement());
}
/*
* call-seq:
- * category_name_part_constraint -> CategoryNamePartConstraint or Nil
+ * category_name_part_requirement -> CategoryNamePartRequirement or Nil
*
- * Fetch the category name part constraint (may be Nil).
+ * Fetch the category name part requirement (may be Nil).
*/
VALUE
- package_dep_spec_category_name_part_constraint(VALUE self)
+ package_dep_spec_category_name_part_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_requirement());
}
/*
* call-seq:
- * any_slot_constraint -> AnySlotConstraint or Nil
+ * any_slot_requirement -> AnySlotRequirement or Nil
*
- * Fetch the any-slot constraint (may be Nil).
+ * Fetch the any-slot requirement (may be Nil).
*/
VALUE
- package_dep_spec_any_slot_constraint(VALUE self)
+ package_dep_spec_any_slot_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_requirement());
}
/*
* call-seq:
- * exact_slot_constraint -> ExactSlotConstraint or Nil
+ * exact_slot_requirement -> ExactSlotRequirement or Nil
*
- * Fetch the exact-slot constraint (may be Nil).
+ * Fetch the exact-slot requirement (may be Nil).
*/
VALUE
- package_dep_spec_exact_slot_constraint(VALUE self)
+ package_dep_spec_exact_slot_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_requirement());
}
/*
@@ -635,85 +635,85 @@ namespace
/*
* call-seq:
- * in_repository_constraint -> InRepositoryConstraint or Nil
+ * in_repository_requirement -> InRepositoryRequirement or Nil
*
* Fetch the in-repository name.
*/
VALUE
- package_dep_spec_in_repository_constraint(VALUE self)
+ package_dep_spec_in_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_requirement());
}
/*
* call-seq:
- * from_repository_constraint -> FromRepositoryConstraint or Nil
+ * from_repository_requirement -> FromRepositoryRequirement or Nil
*
- * Fetch the from-repository constraint.
+ * Fetch the from-repository requirement.
*/
VALUE
- package_dep_spec_from_repository_constraint(VALUE self)
+ package_dep_spec_from_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_requirement());
}
/*
* call-seq:
- * installed_at_path_constraint ->
- * InstalledAtPathConstraint or Nil
+ * installed_at_path_requirement ->
+ * InstalledAtPathRequirement or Nil
*
* Fetch the installed-at-path requirement.
*/
VALUE
- package_dep_spec_installed_at_path_constraint(VALUE self)
+ package_dep_spec_installed_at_path_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_requirement());
}
/*
* call-seq:
- * installable_to_path_constraint -> InstallableToPathConstraint or Nil
+ * installable_to_path_requirement -> InstallableToPathRequirement or Nil
*
- * Fetch the installable-to-path constraint.
+ * Fetch the installable-to-path requirement.
*/
VALUE
- package_dep_spec_installable_to_path_constraint(VALUE self)
+ package_dep_spec_installable_to_path_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(
- std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_constraint());
+ return package_dep_spec_requirement_to_value(
+ std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_requirement());
}
/*
* call-seq:
- * installable_to_path_constraint -> InstallableToRepositoryConstraint or Nil
+ * installable_to_path_requirement -> InstallableToRepositoryRequirement or Nil
*
- * Fetch the installable-to-path constraint.
+ * Fetch the installable-to-path requirement.
*/
VALUE
- package_dep_spec_installable_to_repository_constraint(VALUE self)
+ package_dep_spec_installable_to_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(
- std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_constraint());
+ return package_dep_spec_requirement_to_value(
+ std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_requirement());
}
#ifdef CIARANM_REMOVED_THIS
@@ -1018,16 +1018,16 @@ namespace
* use Paludis::parse_user_package_dep_spec.
*/
c_package_dep_spec = rb_define_class_under(paludis_module(), "PackageDepSpec", c_string_dep_spec);
- rb_define_method(c_package_dep_spec, "package_name_constraint", RUBY_FUNC_CAST(&package_dep_spec_package_name_constraint), 0);
- rb_define_method(c_package_dep_spec, "package_name_part_constraint", RUBY_FUNC_CAST(&package_dep_spec_package_name_part_constraint), 0);
- rb_define_method(c_package_dep_spec, "category_name_part_constraint", RUBY_FUNC_CAST(&package_dep_spec_category_name_part_constraint), 0);
- rb_define_method(c_package_dep_spec, "in_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_in_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "from_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_from_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "installable_to_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_installable_to_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "installed_at_path_constraint", RUBY_FUNC_CAST(&package_dep_spec_installed_at_path_constraint), 0);
- rb_define_method(c_package_dep_spec, "installable_to_path_constraint", RUBY_FUNC_CAST(&package_dep_spec_installable_to_path_constraint), 0);
- rb_define_method(c_package_dep_spec, "any_slot_constraint", RUBY_FUNC_CAST(&package_dep_spec_any_slot_constraint), 0);
- rb_define_method(c_package_dep_spec, "exact_slot_constraint", RUBY_FUNC_CAST(&package_dep_spec_exact_slot_constraint), 0);
+ rb_define_method(c_package_dep_spec, "package_name_requirement", RUBY_FUNC_CAST(&package_dep_spec_package_name_requirement), 0);
+ rb_define_method(c_package_dep_spec, "package_name_part_requirement", RUBY_FUNC_CAST(&package_dep_spec_package_name_part_requirement), 0);
+ rb_define_method(c_package_dep_spec, "category_name_part_requirement", RUBY_FUNC_CAST(&package_dep_spec_category_name_part_requirement), 0);
+ rb_define_method(c_package_dep_spec, "in_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_in_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "from_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_from_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installable_to_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_installable_to_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installed_at_path_requirement", RUBY_FUNC_CAST(&package_dep_spec_installed_at_path_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installable_to_path_requirement", RUBY_FUNC_CAST(&package_dep_spec_installable_to_path_requirement), 0);
+ rb_define_method(c_package_dep_spec, "any_slot_requirement", RUBY_FUNC_CAST(&package_dep_spec_any_slot_requirement), 0);
+ rb_define_method(c_package_dep_spec, "exact_slot_requirement", RUBY_FUNC_CAST(&package_dep_spec_exact_slot_requirement), 0);
#ifdef CIARANM_REMOVED_THIS
rb_define_method(c_package_dep_spec, "use_requirements", RUBY_FUNC_CAST(&package_dep_spec_use_requirements), 0);
#endif
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index d8bb892..21fc519 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -130,77 +130,77 @@ module Paludis
end
def test_slot
- assert_equal "100", pda.exact_slot_constraint.name
- assert_nil pdb.exact_slot_constraint
- assert_nil pdc.exact_slot_constraint
- assert_nil pdd.exact_slot_constraint
- assert_nil pde.exact_slot_constraint
+ assert_equal "100", pda.exact_slot_requirement.name
+ assert_nil pdb.exact_slot_requirement
+ assert_nil pdc.exact_slot_requirement
+ assert_nil pdd.exact_slot_requirement
+ assert_nil pde.exact_slot_requirement
end
def test_package
- assert_equal QualifiedPackageName.new("foo/bar"), pda.package_name_constraint.name
- assert_nil pdb.package_name_constraint
- assert_equal QualifiedPackageName.new("foo/bar"), pdc.package_name_constraint.name
- assert_nil pdd.package_name_constraint
- assert_equal QualifiedPackageName.new("foo/bar"), pde.package_name_constraint.name
+ assert_equal QualifiedPackageName.new("foo/bar"), pda.package_name_requirement.name
+ assert_nil pdb.package_name_requirement
+ assert_equal QualifiedPackageName.new("foo/bar"), pdc.package_name_requirement.name
+ assert_nil pdd.package_name_requirement
+ assert_equal QualifiedPackageName.new("foo/bar"), pde.package_name_requirement.name
end
def test_from_repository
- assert_nil pda.from_repository_constraint
- assert_nil pdb.from_repository_constraint
- assert_nil pdc.from_repository_constraint
- assert_nil pdd.from_repository_constraint
- assert_equal "testrepo", pde.from_repository_constraint.name
+ assert_nil pda.from_repository_requirement
+ assert_nil pdb.from_repository_requirement
+ assert_nil pdc.from_repository_requirement
+ assert_nil pdd.from_repository_requirement
+ assert_equal "testrepo", pde.from_repository_requirement.name
end
def test_in_repository
- assert_equal "testrepo", pda.in_repository_constraint.name
- assert_nil pdb.in_repository_constraint
- assert_nil pdc.in_repository_constraint
- assert_nil pdd.in_repository_constraint
- assert_nil pde.in_repository_constraint
+ assert_equal "testrepo", pda.in_repository_requirement.name
+ assert_nil pdb.in_repository_requirement
+ assert_nil pdc.in_repository_requirement
+ assert_nil pdd.in_repository_requirement
+ assert_nil pde.in_repository_requirement
end
def test_installable_to_repository
- assert_nil pda.installable_to_repository_constraint
- assert_nil pdb.installable_to_repository_constraint
- assert_equal "installed", pdc.installable_to_repository_constraint.name
- assert ! pdc.installable_to_repository_constraint.include_masked?
- assert_nil pdd.installable_to_repository_constraint
- assert_nil pde.installable_to_repository_constraint
+ assert_nil pda.installable_to_repository_requirement
+ assert_nil pdb.installable_to_repository_requirement
+ assert_equal "installed", pdc.installable_to_repository_requirement.name
+ assert ! pdc.installable_to_repository_requirement.include_masked?
+ assert_nil pdd.installable_to_repository_requirement
+ assert_nil pde.installable_to_repository_requirement
end
def test_installed_at_path
- assert_nil pda.installed_at_path_constraint
- assert_nil pdb.installed_at_path_constraint
- assert_nil pdc.installed_at_path_constraint
- assert_nil pdd.installed_at_path_constraint
- assert_equal "/mychroot", pde.installed_at_path_constraint.path
+ assert_nil pda.installed_at_path_requirement
+ assert_nil pdb.installed_at_path_requirement
+ assert_nil pdc.installed_at_path_requirement
+ assert_nil pdd.installed_at_path_requirement
+ assert_equal "/mychroot", pde.installed_at_path_requirement.path
end
def test_installable_to_path
- assert_nil pda.installable_to_path_constraint
- assert_nil pdb.installable_to_path_constraint
- assert_nil pdc.installable_to_path_constraint
- assert_equal "/", pdd.installable_to_path_constraint.path
- assert pdd.installable_to_path_constraint.include_masked?
- assert_nil pde.installable_to_path_constraint
+ assert_nil pda.installable_to_path_requirement
+ assert_nil pdb.installable_to_path_requirement
+ assert_nil pdc.installable_to_path_requirement
+ assert_equal "/", pdd.installable_to_path_requirement.path
+ assert pdd.installable_to_path_requirement.include_masked?
+ assert_nil pde.installable_to_path_requirement
end
def test_package_name_part
- assert_nil pda.package_name_part_constraint
- assert_equal "bar", pdb.package_name_part_constraint.name_part
- assert_nil pdc.package_name_part_constraint
- assert_nil pdd.package_name_part_constraint
- assert_nil pde.package_name_part_constraint
+ assert_nil pda.package_name_part_requirement
+ assert_equal "bar", pdb.package_name_part_requirement.name_part
+ assert_nil pdc.package_name_part_requirement
+ assert_nil pdd.package_name_part_requirement
+ assert_nil pde.package_name_part_requirement
end
def test_category_name_part
- assert_nil pda.category_name_part_constraint
- assert_nil pdb.category_name_part_constraint
- assert_nil pdc.category_name_part_constraint
- assert_equal "foo", pdd.category_name_part_constraint.name_part
- assert_nil pde.category_name_part_constraint
+ assert_nil pda.category_name_part_requirement
+ assert_nil pdb.category_name_part_requirement
+ assert_nil pdc.category_name_part_requirement
+ assert_equal "foo", pdd.category_name_part_requirement.name_part
+ assert_nil pde.category_name_part_requirement
end
### def test_use_requirements
diff --git a/ruby/generator_TEST.rb b/ruby/generator_TEST.rb
index ffef5d0..9359a14 100644
--- a/ruby/generator_TEST.rb
+++ b/ruby/generator_TEST.rb
@@ -59,8 +59,8 @@ module Paludis
assert_equal Generator::Matches.new(Paludis::parse_user_package_dep_spec("a/b", env, []), nil, []).to_s,
"packages matching a/b"
assert_equal Generator::Matches.new(Paludis::parse_user_package_dep_spec("a/b", env, []),
- nil, [:ignore_choice_constraints]).to_s,
- "packages matching a/b (ignoring choice constraints)"
+ nil, [:ignore_choice_requirements]).to_s,
+ "packages matching a/b (ignoring choice requirements)"
end
end
diff --git a/ruby/package_dep_spec_constraint.cc b/ruby/package_dep_spec_constraint.cc
index e06e957..4d18e57 100644
--- a/ruby/package_dep_spec_constraint.cc
+++ b/ruby/package_dep_spec_constraint.cc
@@ -19,7 +19,7 @@
#include <paludis_ruby.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <algorithm>
#include <list>
@@ -30,485 +30,485 @@ using namespace paludis::ruby;
namespace
{
- static VALUE c_package_dep_spec_constraint;
- static VALUE c_name_constraint;
- static VALUE c_package_name_part_constraint;
- static VALUE c_category_name_part_constraint;
- static VALUE c_version_constraint;
- static VALUE c_in_repository_constraint;
- static VALUE c_from_repository_constraint;
- static VALUE c_installed_at_path_constraint;
- static VALUE c_installable_to_path_constraint;
- static VALUE c_installable_to_repository_constraint;
- static VALUE c_any_slot_constraint;
- static VALUE c_exact_slot_constraint;
- static VALUE c_key_constraint;
- static VALUE c_choice_constraint;
-
- static VALUE c_key_constraint_operation;
+ static VALUE c_package_dep_spec_requirement;
+ static VALUE c_name_requirement;
+ static VALUE c_package_name_part_requirement;
+ static VALUE c_category_name_part_requirement;
+ static VALUE c_version_requirement;
+ static VALUE c_in_repository_requirement;
+ static VALUE c_from_repository_requirement;
+ static VALUE c_installed_at_path_requirement;
+ static VALUE c_installable_to_path_requirement;
+ static VALUE c_installable_to_repository_requirement;
+ static VALUE c_any_slot_requirement;
+ static VALUE c_exact_slot_requirement;
+ static VALUE c_key_requirement;
+ static VALUE c_choice_requirement;
+
+ static VALUE c_key_requirement_operation;
struct V
{
VALUE value;
- std::shared_ptr<const PackageDepSpecConstraint> mm;
+ std::shared_ptr<const PackageDepSpecRequirement> mm;
- V(const std::shared_ptr<const PackageDepSpecConstraint> & m) :
+ V(const std::shared_ptr<const PackageDepSpecRequirement> & m) :
mm(m)
{
}
- void visit(const NameConstraint &)
+ void visit(const NameRequirement &)
{
- value = Data_Wrap_Struct(c_name_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_name_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const CategoryNamePartConstraint &)
+ void visit(const CategoryNamePartRequirement &)
{
- value = Data_Wrap_Struct(c_category_name_part_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_category_name_part_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const PackageNamePartConstraint &)
+ void visit(const PackageNamePartRequirement &)
{
- value = Data_Wrap_Struct(c_package_name_part_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_package_name_part_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const VersionConstraint &)
+ void visit(const VersionRequirement &)
{
- value = Data_Wrap_Struct(c_version_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_version_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InRepositoryConstraint &)
+ void visit(const InRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_in_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_in_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const FromRepositoryConstraint &)
+ void visit(const FromRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_from_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_from_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstalledAtPathConstraint &)
+ void visit(const InstalledAtPathRequirement &)
{
- value = Data_Wrap_Struct(c_installed_at_path_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installed_at_path_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstallableToPathConstraint &)
+ void visit(const InstallableToPathRequirement &)
{
- value = Data_Wrap_Struct(c_installable_to_path_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installable_to_path_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstallableToRepositoryConstraint &)
+ void visit(const InstallableToRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_installable_to_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installable_to_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const AnySlotConstraint &)
+ void visit(const AnySlotRequirement &)
{
- value = Data_Wrap_Struct(c_any_slot_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_any_slot_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const ExactSlotConstraint &)
+ void visit(const ExactSlotRequirement &)
{
- value = Data_Wrap_Struct(c_exact_slot_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_exact_slot_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const KeyConstraint &)
+ void visit(const KeyRequirement &)
{
- value = Data_Wrap_Struct(c_key_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_key_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const ChoiceConstraint &)
+ void visit(const ChoiceRequirement &)
{
- value = Data_Wrap_Struct(c_choice_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_choice_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
};
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- name_constraint_name(VALUE self)
+ name_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return qualified_package_name_to_value((std::static_pointer_cast<const NameConstraint>(*ptr))->name());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return qualified_package_name_to_value((std::static_pointer_cast<const NameRequirement>(*ptr))->name());
}
/*
* Document-method: name_part
*
- * The name part constraint.
+ * The name part requirement.
*/
static VALUE
- package_name_part_constraint_name_part(VALUE self)
+ package_name_part_requirement_name_part(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const PackageNamePartConstraint>(*ptr))->name_part()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const PackageNamePartRequirement>(*ptr))->name_part()).c_str());
}
/*
* Document-method: name_part
*
- * The name part constraint.
+ * The name part requirement.
*/
static VALUE
- category_name_part_constraint_name_part(VALUE self)
+ category_name_part_requirement_name_part(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const CategoryNamePartConstraint>(*ptr))->name_part()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const CategoryNamePartRequirement>(*ptr))->name_part()).c_str());
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- in_repository_constraint_name(VALUE self)
+ in_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- from_repository_constraint_name(VALUE self)
+ from_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const FromRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const FromRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: path
*
- * The path constraint.
+ * The path requirement.
*/
static VALUE
- installed_at_path_constraint_path(VALUE self)
+ installed_at_path_requirement_path(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstalledAtPathConstraint>(*ptr))->path()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstalledAtPathRequirement>(*ptr))->path()).c_str());
}
/*
* Document-method: path
*
- * The path constraint.
+ * The path requirement.
*/
static VALUE
- installable_to_path_constraint_path(VALUE self)
+ installable_to_path_requirement_path(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToPathConstraint>(*ptr))->path()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToPathRequirement>(*ptr))->path()).c_str());
}
/*
* Document-method: include_masked?
*
- * The include-masked constraint.
+ * The include-masked requirement.
*/
static VALUE
- installable_to_path_constraint_include_masked(VALUE self)
+ installable_to_path_requirement_include_masked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const InstallableToPathConstraint>(*ptr))->include_masked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const InstallableToPathRequirement>(*ptr))->include_masked() ? Qtrue : Qfalse;
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- installable_to_repository_constraint_name(VALUE self)
+ installable_to_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: include_masked?
*
- * The include-masked constraint.
+ * The include-masked requirement.
*/
static VALUE
- installable_to_repository_constraint_include_masked(VALUE self)
+ installable_to_repository_requirement_include_masked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const InstallableToRepositoryConstraint>(*ptr))->include_masked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const InstallableToRepositoryRequirement>(*ptr))->include_masked() ? Qtrue : Qfalse;
}
/*
* Document-method: locking?
*
- * The locking constraint.
+ * The locking requirement.
*/
static VALUE
- any_slot_constraint_locking(VALUE self)
+ any_slot_requirement_locking(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const AnySlotConstraint>(*ptr))->locking() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const AnySlotRequirement>(*ptr))->locking() ? Qtrue : Qfalse;
}
/*
* Document-method: locked?
*
- * The locked constraint.
+ * The locked requirement.
*/
static VALUE
- exact_slot_constraint_locked(VALUE self)
+ exact_slot_requirement_locked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const ExactSlotConstraint>(*ptr))->locked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const ExactSlotRequirement>(*ptr))->locked() ? Qtrue : Qfalse;
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- exact_slot_constraint_name(VALUE self)
+ exact_slot_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const ExactSlotConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const ExactSlotRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: key
*
- * The key constraint.
+ * The key requirement.
*/
static VALUE
- key_constraint_key(VALUE self)
+ key_requirement_key(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const KeyConstraint>(*ptr))->key()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const KeyRequirement>(*ptr))->key()).c_str());
}
/*
* Document-method: pattern
*
- * The pattern constraint.
+ * The pattern requirement.
*/
static VALUE
- key_constraint_pattern(VALUE self)
+ key_requirement_pattern(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const KeyConstraint>(*ptr))->pattern()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const KeyRequirement>(*ptr))->pattern()).c_str());
}
/*
* Document-method: operation
*
- * The operation constraint.
+ * The operation requirement.
*/
static VALUE
- key_constraint_operation(VALUE self)
+ key_requirement_operation(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return INT2FIX((std::static_pointer_cast<const KeyConstraint>(*ptr))->operation());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return INT2FIX((std::static_pointer_cast<const KeyRequirement>(*ptr))->operation());
}
- void do_register_package_dep_spec_constraint()
+ void do_register_package_dep_spec_requirement()
{
/*
- * Document-class: Paludis::PackageDepSpecConstraint
+ * Document-class: Paludis::PackageDepSpecRequirement
*
- * Represents a constraint in a PackageDepSpec.
+ * Represents a requirement in a PackageDepSpec.
*/
- c_package_dep_spec_constraint = rb_define_class_under(paludis_module(), "PackageDepSpecConstraint", rb_cObject);
- rb_funcall(c_package_dep_spec_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ c_package_dep_spec_requirement = rb_define_class_under(paludis_module(), "PackageDepSpecRequirement", rb_cObject);
+ rb_funcall(c_package_dep_spec_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
/*
- * Document-class: Paludis::NameConstraint
+ * Document-class: Paludis::NameRequirement
*
- * Represents a cat/pkg name constraint in a PackageDepSpec.
+ * Represents a cat/pkg name requirement in a PackageDepSpec.
*/
- c_name_constraint = rb_define_class_under(
- paludis_module(), "NameConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_name_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_package_dep_spec_constraint, "name", RUBY_FUNC_CAST(&name_constraint_name), 0);
+ c_name_requirement = rb_define_class_under(
+ paludis_module(), "NameRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_name_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_package_dep_spec_requirement, "name", RUBY_FUNC_CAST(&name_requirement_name), 0);
/*
- * Document-class: Paludis::PackageNamePartConstraint
+ * Document-class: Paludis::PackageNamePartRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_package_name_part_constraint = rb_define_class_under(
- paludis_module(), "PackageNamePartConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_package_name_part_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_package_name_part_constraint, "name_part", RUBY_FUNC_CAST(
- &package_name_part_constraint_name_part), 0);
+ c_package_name_part_requirement = rb_define_class_under(
+ paludis_module(), "PackageNamePartRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_package_name_part_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_package_name_part_requirement, "name_part", RUBY_FUNC_CAST(
+ &package_name_part_requirement_name_part), 0);
/*
- * Document-class: Paludis::CategoryNamePartConstraint
+ * Document-class: Paludis::CategoryNamePartRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_category_name_part_constraint = rb_define_class_under(
- paludis_module(), "CategoryNamePartConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_category_name_part_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_category_name_part_constraint, "name_part", RUBY_FUNC_CAST(
- &category_name_part_constraint_name_part), 0);
+ c_category_name_part_requirement = rb_define_class_under(
+ paludis_module(), "CategoryNamePartRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_category_name_part_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_category_name_part_requirement, "name_part", RUBY_FUNC_CAST(
+ &category_name_part_requirement_name_part), 0);
/*
- * Document-class: Paludis::InRepositoryConstraint
+ * Document-class: Paludis::InRepositoryRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_in_repository_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_in_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_in_repository_constraint, "name", RUBY_FUNC_CAST(
- &in_repository_constraint_name), 0);
+ c_in_repository_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_in_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_in_repository_requirement, "name", RUBY_FUNC_CAST(
+ &in_repository_requirement_name), 0);
/*
- * Document-class: Paludis::FromRepositoryConstraint
+ * Document-class: Paludis::FromRepositoryRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_from_repository_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_from_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_from_repository_constraint, "name", RUBY_FUNC_CAST(
- &from_repository_constraint_name), 0);
+ c_from_repository_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_from_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_from_repository_requirement, "name", RUBY_FUNC_CAST(
+ &from_repository_requirement_name), 0);
/*
- * Document-class: Paludis::InstalledAtPathConstraint
+ * Document-class: Paludis::InstalledAtPathRequirement
*
- * Represents a ::/ path constraint in a PackageDepSpec.
+ * Represents a ::/ path requirement in a PackageDepSpec.
*/
- c_installed_at_path_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installed_at_path_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installed_at_path_constraint, "path", RUBY_FUNC_CAST(
- &installed_at_path_constraint_path), 0);
+ c_installed_at_path_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installed_at_path_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installed_at_path_requirement, "path", RUBY_FUNC_CAST(
+ &installed_at_path_requirement_path), 0);
/*
- * Document-class: Paludis::InstallableToPathConstraint
+ * Document-class: Paludis::InstallableToPathRequirement
*
- * Represents a ::/? path constraint in a PackageDepSpec.
+ * Represents a ::/? path requirement in a PackageDepSpec.
*/
- c_installable_to_path_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installable_to_path_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installable_to_path_constraint, "path", RUBY_FUNC_CAST(
- &installable_to_path_constraint_path), 0);
- rb_define_method(c_installable_to_path_constraint, "include_masked?", RUBY_FUNC_CAST(
- &installable_to_path_constraint_include_masked), 0);
+ c_installable_to_path_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installable_to_path_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installable_to_path_requirement, "path", RUBY_FUNC_CAST(
+ &installable_to_path_requirement_path), 0);
+ rb_define_method(c_installable_to_path_requirement, "include_masked?", RUBY_FUNC_CAST(
+ &installable_to_path_requirement_include_masked), 0);
/*
- * Document-class: Paludis::InstallableToRepositoryConstraint
+ * Document-class: Paludis::InstallableToRepositoryRequirement
*
- * Represents a ::repo? repository constraint in a PackageDepSpec.
+ * Represents a ::repo? repository requirement in a PackageDepSpec.
*/
- c_installable_to_repository_constraint = rb_define_class_under(
- paludis_module(), "InstallableToRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installable_to_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installable_to_repository_constraint, "name", RUBY_FUNC_CAST(
- &installable_to_repository_constraint_name), 0);
- rb_define_method(c_installable_to_repository_constraint, "include_masked?", RUBY_FUNC_CAST(
- &installable_to_repository_constraint_include_masked), 0);
+ c_installable_to_repository_requirement = rb_define_class_under(
+ paludis_module(), "InstallableToRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installable_to_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installable_to_repository_requirement, "name", RUBY_FUNC_CAST(
+ &installable_to_repository_requirement_name), 0);
+ rb_define_method(c_installable_to_repository_requirement, "include_masked?", RUBY_FUNC_CAST(
+ &installable_to_repository_requirement_include_masked), 0);
/*
- * Document-class: Paludis::AnySlotConstraint
+ * Document-class: Paludis::AnySlotRequirement
*
- * Represents a :* or := constraint in a PackageDepSpec.
+ * Represents a :* or := requirement in a PackageDepSpec.
*/
- c_any_slot_constraint = rb_define_class_under(
- paludis_module(), "AnySlotConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_any_slot_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_any_slot_constraint, "locking?", RUBY_FUNC_CAST(
- &any_slot_constraint_locking), 0);
+ c_any_slot_requirement = rb_define_class_under(
+ paludis_module(), "AnySlotRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_any_slot_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_any_slot_requirement, "locking?", RUBY_FUNC_CAST(
+ &any_slot_requirement_locking), 0);
/*
- * Document-class: Paludis::ExactSlotConstraint
+ * Document-class: Paludis::ExactSlotRequirement
*
- * Represents a :slot or :=slot constraint in a PackageDepSpec.
+ * Represents a :slot or :=slot requirement in a PackageDepSpec.
*/
- c_exact_slot_constraint = rb_define_class_under(
- paludis_module(), "ExactSlotConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_exact_slot_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_exact_slot_constraint, "locked?", RUBY_FUNC_CAST(
- &exact_slot_constraint_locked), 0);
- rb_define_method(c_exact_slot_constraint, "name", RUBY_FUNC_CAST(
- &exact_slot_constraint_name), 0);
+ c_exact_slot_requirement = rb_define_class_under(
+ paludis_module(), "ExactSlotRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_exact_slot_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_exact_slot_requirement, "locked?", RUBY_FUNC_CAST(
+ &exact_slot_requirement_locked), 0);
+ rb_define_method(c_exact_slot_requirement, "name", RUBY_FUNC_CAST(
+ &exact_slot_requirement_name), 0);
/*
- * Document-class: Paludis::KeyConstraint
+ * Document-class: Paludis::KeyRequirement
*
- * Represents a [.key=value] constraint in a PackageDepSpec.
+ * Represents a [.key=value] requirement in a PackageDepSpec.
*/
- c_key_constraint = rb_define_class_under(
- paludis_module(), "KeyConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_key_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_key_constraint, "key", RUBY_FUNC_CAST(
- &key_constraint_key), 0);
- rb_define_method(c_key_constraint, "pattern", RUBY_FUNC_CAST(
- &key_constraint_pattern), 0);
- rb_define_method(c_key_constraint, "operation", RUBY_FUNC_CAST(
- &key_constraint_operation), 0);
+ c_key_requirement = rb_define_class_under(
+ paludis_module(), "KeyRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_key_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_key_requirement, "key", RUBY_FUNC_CAST(
+ &key_requirement_key), 0);
+ rb_define_method(c_key_requirement, "pattern", RUBY_FUNC_CAST(
+ &key_requirement_pattern), 0);
+ rb_define_method(c_key_requirement, "operation", RUBY_FUNC_CAST(
+ &key_requirement_operation), 0);
/*
- * Document-module: Paludis::KeyConstraintOperation
+ * Document-module: Paludis::KeyRequirementOperation
*
- * The operation for a KeyConstraint.
+ * The operation for a KeyRequirement.
*/
- c_key_constraint_operation = rb_define_module_under(paludis_module(), "KeyConstraintOperation");
- for (KeyConstraintOperation l(static_cast<KeyConstraintOperation>(0)), l_end(last_kco) ; l != l_end ;
- l = static_cast<KeyConstraintOperation>(static_cast<int>(l) + 1))
- rb_define_const(c_key_constraint_operation, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
+ c_key_requirement_operation = rb_define_module_under(paludis_module(), "KeyRequirementOperation");
+ for (KeyRequirementOperation l(static_cast<KeyRequirementOperation>(0)), l_end(last_kro) ; l != l_end ;
+ l = static_cast<KeyRequirementOperation>(static_cast<int>(l) + 1))
+ rb_define_const(c_key_requirement_operation, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
- // cc_enum_special<paludis/package_dep_spec_constraint-se.hh, KeyConstraint, c_key_constraint_operation>
+ // cc_enum_special<paludis/package_dep_spec_requirement-se.hh, KeyRequirement, c_key_requirement_operation>
/*
- * Document-class: Paludis::ChoiceConstraint
+ * Document-class: Paludis::ChoiceRequirement
*
- * Represents a [flag] constraint in a PackageDepSpec.
+ * Represents a [flag] requirement in a PackageDepSpec.
*/
- c_choice_constraint = rb_define_class_under(
- paludis_module(), "KeyConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_choice_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ c_choice_requirement = rb_define_class_under(
+ paludis_module(), "KeyRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_choice_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
}
}
VALUE
-paludis::ruby::package_dep_spec_constraint_to_value(const std::shared_ptr<const PackageDepSpecConstraint> & m)
+paludis::ruby::package_dep_spec_requirement_to_value(const std::shared_ptr<const PackageDepSpecRequirement> & m)
{
try
{
@@ -522,6 +522,6 @@ paludis::ruby::package_dep_spec_constraint_to_value(const std::shared_ptr<const
}
}
-RegisterRubyClass::Register paludis_ruby_register_package_dep_spec_constraint PALUDIS_ATTRIBUTE((used))
- (&do_register_package_dep_spec_constraint);
+RegisterRubyClass::Register paludis_ruby_register_package_dep_spec_requirement PALUDIS_ATTRIBUTE((used))
+ (&do_register_package_dep_spec_requirement);
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 7ce44f2..4900726 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -384,8 +384,8 @@ paludis::ruby::value_to_match_package_options(VALUE v)
{
VALUE entry(rb_ary_entry(v, i));
Check_Type(entry, T_SYMBOL);
- if (SYM2ID(entry) == rb_intern("ignore_choice_constraints"))
- o += mpo_ignore_choice_constraints;
+ if (SYM2ID(entry) == rb_intern("ignore_choice_requirements"))
+ o += mpo_ignore_choice_requirements;
else
rb_raise(rb_eArgError, "Unknown MatchPackageOptions option '%s'", rb_obj_as_string(entry));
}
@@ -396,8 +396,8 @@ VALUE
paludis::ruby::match_package_options_to_value(const MatchPackageOptions & o)
{
VALUE a(rb_ary_new());
- if (o[mpo_ignore_choice_constraints])
- rb_ary_push(a, ID2SYM(rb_intern("ignore_choice_constraints")));
+ if (o[mpo_ignore_choice_requirements])
+ rb_ary_push(a, ID2SYM(rb_intern("ignore_choice_requirements")));
return a;
}
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 53d98b4..0e2eb46 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -105,7 +105,7 @@ namespace paludis
VALUE choice_value_to_value(const std::shared_ptr<const ChoiceValue> & c);
VALUE match_package_options_to_value(const MatchPackageOptions & c);
VALUE bool_to_value(bool b);
- VALUE package_dep_spec_constraint_to_value(const std::shared_ptr<const PackageDepSpecConstraint> &);
+ VALUE package_dep_spec_requirement_to_value(const std::shared_ptr<const PackageDepSpecRequirement> &);
VersionSpec value_to_version_spec(VALUE v);
std::shared_ptr<const PackageID> value_to_package_id(VALUE, bool nil_ok = false);
diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc
index dbfcd0f..c78379f 100644
--- a/src/clients/cave/cmd_digest.cc
+++ b/src/clients/cave/cmd_digest.cc
@@ -116,7 +116,7 @@ DigestCommand::run(
throw args::DoHelp("digest takes exactly two parameters");
RepositoryName repo(*next(cmdline.begin_parameters()));
- Filter repo_filter(filter::Matches(MutablePackageDepSpecData({ }).constrain_in_repository(repo), make_null_shared_ptr(), { }));
+ Filter repo_filter(filter::Matches(MutablePackageDepSpecData({ }).require_in_repository(repo), make_null_shared_ptr(), { }));
QualifiedPackageName pkg(std::string::npos == cmdline.begin_parameters()->find('/') ?
env->fetch_unique_qualified_package_name(PackageNamePart(*cmdline.begin_parameters()), repo_filter) :
QualifiedPackageName(*cmdline.begin_parameters()));
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 6f1ba4d..cf007d7 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -79,7 +79,7 @@
#include <paludis/changed_choices.hh>
#include <paludis/mask_utils.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <set>
#include <iterator>
@@ -1421,12 +1421,12 @@ namespace
cout << fuc(fs_unable_unsuitable_did_not_meet(), fv<'s'>(s));
- if ((*c)->spec().if_package() && (*c)->spec().if_package()->all_choice_constraints() &&
+ if ((*c)->spec().if_package() && (*c)->spec().if_package()->all_choice_requirements() &&
(! match_package(*env, *(*c)->spec().if_package(), u->package_id(), (*c)->from_id(), { })) &&
- match_package(*env, *(*c)->spec().if_package(), u->package_id(), (*c)->from_id(), { mpo_ignore_choice_constraints }))
+ match_package(*env, *(*c)->spec().if_package(), u->package_id(), (*c)->from_id(), { mpo_ignore_choice_requirements }))
{
- for (auto a((*c)->spec().if_package()->all_choice_constraints()->begin()),
- a_end((*c)->spec().if_package()->all_choice_constraints()->end()) ;
+ for (auto a((*c)->spec().if_package()->all_choice_requirements()->begin()),
+ a_end((*c)->spec().if_package()->all_choice_requirements()->end()) ;
a != a_end ; ++a)
{
const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), 0, u->package_id(), (*c)->from_id(), 0));
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index bcf30bc..ac530c1 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -84,7 +84,7 @@
#include <paludis/filter.hh>
#include <paludis/elike_blocker.hh>
#include <paludis/repository.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <set>
#include <iterator>
@@ -328,7 +328,7 @@ namespace
const auto replacing_ids((*env)[selection::BestVersionOnly(generator::Matches(*i, make_null_shared_ptr(), { }))]);
if (replacing_ids->empty())
r.append(stringify(*i));
- else if (id_specs->empty() || id_specs->begin()->package_name_constraint()->name() != (*replacing_ids->begin())->name())
+ else if (id_specs->empty() || id_specs->begin()->package_name_requirement()->name() != (*replacing_ids->begin())->name())
r.append(stringify(**replacing_ids->begin()));
else
r.append((*replacing_ids->begin())->canonical_form(idcf_no_name));
@@ -685,20 +685,20 @@ namespace
PackageDepSpec spec(parse_user_package_dep_spec(std::get<2>(p), env.get(), { updso_no_disambiguation }));
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_constraint() = false,
+ n::has_any_slot_requirement() = false,
n::has_category_name_part() = false,
- n::has_choice_constraints() = false,
- n::has_exact_slot_constraint() = false,
+ n::has_choice_requirements() = false,
+ n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
n::has_installable_to_repository() = false,
n::has_installed_at_path() = false,
- n::has_key_constraints() = false,
+ n::has_key_requirements() = false,
n::has_package() = true,
n::has_package_name_part() = false,
n::has_tag() = indeterminate,
- n::has_version_constraints() = false
+ n::has_version_requirements() = false
)))
{
any = true;
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index dc340c5..b95eb43 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -209,12 +209,12 @@ FixLinkageCommand::run(
}
MutablePackageDepSpecData part_spec({ });
- part_spec.constrain_package((*pkg_it)->name());
+ part_spec.require_package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.constrain_exact_slot((*pkg_it)->slot_key()->value(), false);
+ part_spec.require_exact_slot((*pkg_it)->slot_key()->value(), false);
if (cmdline.a_exact.specified())
- part_spec.constrain_version(vcc_and, vo_equal, (*pkg_it)->version());
+ part_spec.require_version(vrc_and, vo_equal, (*pkg_it)->version());
targets->push_back(std::make_pair(stringify(PackageDepSpec(part_spec)), join(broken_files.begin(), broken_files.end(), ", ")));
}
diff --git a/src/clients/cave/cmd_graph_jobs.cc b/src/clients/cave/cmd_graph_jobs.cc
index ff47d99..34ba7d7 100644
--- a/src/clients/cave/cmd_graph_jobs.cc
+++ b/src/clients/cave/cmd_graph_jobs.cc
@@ -42,7 +42,7 @@
#include <paludis/serialise-impl.hh>
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <iostream>
#include <cstdlib>
@@ -91,15 +91,15 @@ namespace
std::string short_spec(const PackageDepSpec & p, bool full)
{
- if (full || ! p.package_name_constraint())
+ if (full || ! p.package_name_requirement())
return stringify(p);
else
{
- std::string result(stringify(p.package_name_constraint()->name().package()));
- if (p.exact_slot_constraint())
- result = result + ":" + stringify(p.exact_slot_constraint()->name());
- if (p.in_repository_constraint())
- result = result + "::" + stringify(p.in_repository_constraint()->name());
+ std::string result(stringify(p.package_name_requirement()->name().package()));
+ if (p.exact_slot_requirement())
+ result = result + ":" + stringify(p.exact_slot_requirement()->name());
+ if (p.in_repository_requirement())
+ result = result + "::" + stringify(p.in_repository_requirement()->name());
return result;
}
}
diff --git a/src/clients/cave/cmd_print_spec.cc b/src/clients/cave/cmd_print_spec.cc
index 03df202..b984ad0 100644
--- a/src/clients/cave/cmd_print_spec.cc
+++ b/src/clients/cave/cmd_print_spec.cc
@@ -126,38 +126,38 @@ namespace
if (cmdline.a_package.specified())
{
- s.unconstrain_package();
- s.unconstrain_package_name_part();
- s.unconstrain_category_name_part();
+ s.unrequire_package();
+ s.unrequire_package_name_part();
+ s.unrequire_category_name_part();
if (! cmdline.a_package.argument().empty())
- s.constrain_package(QualifiedPackageName(cmdline.a_package.argument()));
+ s.require_package(QualifiedPackageName(cmdline.a_package.argument()));
}
if (cmdline.a_slot_requirement.specified())
{
- s.unconstrain_exact_slot();
- s.unconstrain_any_slot();
+ s.unrequire_exact_slot();
+ s.unrequire_any_slot();
if (! cmdline.a_slot_requirement.argument().empty())
- s.constrain_exact_slot(SlotName(cmdline.a_slot_requirement.argument()), false);
+ s.require_exact_slot(SlotName(cmdline.a_slot_requirement.argument()), false);
}
if (cmdline.a_in_repository.specified())
{
- s.unconstrain_in_repository();
+ s.unrequire_in_repository();
if (! cmdline.a_in_repository.argument().empty())
- s.constrain_in_repository(RepositoryName(cmdline.a_in_repository.argument()));
+ s.require_in_repository(RepositoryName(cmdline.a_in_repository.argument()));
}
if (cmdline.a_from_repository.specified())
{
- s.unconstrain_from_repository();
+ s.unrequire_from_repository();
if (! cmdline.a_from_repository.argument().empty())
- s.constrain_from_repository(RepositoryName(cmdline.a_from_repository.argument()));
+ s.require_from_repository(RepositoryName(cmdline.a_from_repository.argument()));
}
if (cmdline.a_installable_to_repository.specified())
{
- s.unconstrain_installable_to_repository();
+ s.unrequire_installable_to_repository();
if (! cmdline.a_installable_to_repository.argument().empty())
{
std::string repo(cmdline.a_installable_to_repository.argument());
@@ -168,20 +168,20 @@ namespace
include_masked = true;
}
- s.constrain_installable_to_repository(RepositoryName(repo), include_masked);
+ s.require_installable_to_repository(RepositoryName(repo), include_masked);
}
}
if (cmdline.a_installed_at_path.specified())
{
- s.unconstrain_installed_at_path();
+ s.unrequire_installed_at_path();
if (! cmdline.a_installed_at_path.argument().empty())
- s.constrain_installed_at_path(FSPath(cmdline.a_installed_at_path.argument()));
+ s.require_installed_at_path(FSPath(cmdline.a_installed_at_path.argument()));
}
if (cmdline.a_installable_to_path.specified())
{
- s.unconstrain_installable_to_path();
+ s.unrequire_installable_to_path();
if (! cmdline.a_installable_to_path.argument().empty())
{
std::string path(cmdline.a_installable_to_path.argument());
@@ -192,43 +192,43 @@ namespace
include_masked = true;
}
- s.constrain_installable_to_path(FSPath(path), include_masked);
+ s.require_installable_to_path(FSPath(path), include_masked);
}
}
if (cmdline.a_package_part.specified() || cmdline.a_category_part.specified())
{
- s.unconstrain_package();
- s.unconstrain_package_name_part();
- s.unconstrain_category_name_part();
+ s.unrequire_package();
+ s.unrequire_package_name_part();
+ s.unrequire_category_name_part();
}
if (cmdline.a_package_part.specified())
{
if (! cmdline.a_package_part.argument().empty())
- s.constrain_package_name_part(PackageNamePart(cmdline.a_package_part.argument()));
+ s.require_package_name_part(PackageNamePart(cmdline.a_package_part.argument()));
}
if (cmdline.a_category_part.specified())
{
if (! cmdline.a_category_part.argument().empty())
- s.constrain_category_name_part(CategoryNamePart(cmdline.a_category_part.argument()));
+ s.require_category_name_part(CategoryNamePart(cmdline.a_category_part.argument()));
}
- VersionConstraintCombiner vcc(vcc_and);
+ VersionRequirementCombiner vrc(vrc_and);
if (cmdline.a_version_requirements_mode.specified())
{
if (cmdline.a_version_requirements_mode.argument() == "and")
- vcc = vcc_and;
+ vrc = vrc_and;
else if (cmdline.a_version_requirements_mode.argument() == "or")
- vcc = vcc_or;
+ vrc = vrc_or;
else
throw args::DoHelp("Argument for --" + cmdline.a_version_requirements_mode.long_name() + " unrecognised");
}
if (cmdline.a_version_requirement.specified())
{
- s.unconstrain_versions();
+ s.unrequire_versions();
for (args::StringSetArg::ConstIterator a(cmdline.a_version_requirement.begin_args()),
a_end(cmdline.a_version_requirement.end_args()) ;
@@ -240,13 +240,13 @@ namespace
throw args::DoHelp("--" + cmdline.a_version_requirement.long_name() + " arguments should be in the form =1.23");
std::string op(a->substr(0, p)), ver(a->substr(p));
- s.constrain_version(vcc, VersionOperator(op), VersionSpec(ver, {}));
+ s.require_version(vrc, VersionOperator(op), VersionSpec(ver, {}));
}
}
if (cmdline.a_additional_requirement.specified())
{
- s.unconstrain_choices();
+ s.unrequire_choices();
for (args::StringSetArg::ConstIterator a(cmdline.a_additional_requirement.begin_args()),
a_end(cmdline.a_additional_requirement.end_args()) ;
@@ -254,7 +254,7 @@ namespace
if (! a->empty())
{
auto k(parse_elike_use_requirement(*a, { }));
- s.constrain_choice(k);
+ s.require_choice(k);
}
}
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index 78c75c7..fb34c37 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.cc
@@ -107,8 +107,8 @@ namespace
auto ids((*env)[selection::BestVersionOnly((
generator::InRepository(RepositoryName(*r)) &
generator::Matches(MutablePackageDepSpecData({ })
- .constrain_package(id->name())
- .constrain_version(vcc_and, vo_equal, id->version()),
+ .require_package(id->name())
+ .require_version(vrc_and, vo_equal, id->version()),
make_null_shared_ptr(), { })) |
filter::SupportsAction<InstallAction>())]);
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 11c1974..f3c0704 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -242,7 +242,7 @@ namespace
for (PackageIDSequence::ConstIterator i(names->begin()), i_end(names->end()) ;
i != i_end ; ++i)
{
- PackageDepSpec name_spec(MutablePackageDepSpecData({ }).constrain_package((*i)->name()));
+ PackageDepSpec name_spec(MutablePackageDepSpecData({ }).require_package((*i)->name()));
cout << fuc(select_format_for_spec(env, name_spec, make_null_shared_ptr(),
fs_wildcard_spec_installed(),
fs_wildcard_spec_installable(),
@@ -1327,8 +1327,8 @@ namespace
{
auto r_ids((*env)[selection::AllVersionsGroupedBySlot(generator::Matches(
MutablePackageDepSpecData(*s.data())
- .unconstrain_in_repository()
- .constrain_in_repository(*r), make_null_shared_ptr(), { }))]);
+ .unrequire_in_repository()
+ .require_in_repository(*r), make_null_shared_ptr(), { }))]);
if (! r_ids->empty())
do_one_package_with_ids(cmdline, env, basic_ppos, s, r_ids, cout, rest_out);
}
@@ -1356,8 +1356,8 @@ namespace
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
do_one_package(cmdline, env, basic_ppos, MutablePackageDepSpecData(*s.data())
- .unconstrain_package()
- .constrain_package((*i)->name()));
+ .unrequire_package()
+ .require_package((*i)->name()));
}
}
@@ -1399,7 +1399,7 @@ ShowCommand::run(
try
{
PackageDepSpec spec(parse_spec_with_nice_error(*p, env.get(), { updso_throw_if_set, updso_allow_wildcards }, filter::All()));
- if ((! spec.package_name_constraint()))
+ if ((! spec.package_name_requirement()))
do_one_wildcard(env, spec);
else
do_one_package(cmdline, env, basic_ppos, spec);
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 9524e0b..878b6bd 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1126,7 +1126,7 @@ paludis::cave::resolve_common(
if ('!' != t->at(0) && std::string::npos != t->find('/'))
{
PackageDepSpec ts(parse_spec_with_nice_error(*t, env.get(), { }, filter::All()));
- if (ts.all_version_constraints() && ! ts.all_version_constraints()->empty())
+ if (ts.all_version_requirements() && ! ts.all_version_requirements()->empty())
{
confirm_helper.add_permit_downgrade_spec(ts);
confirm_helper.add_permit_old_version_spec(ts);