aboutsummaryrefslogtreecommitdiff
path: root/paludis
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 /paludis
parent4eb9754117cf6d1fe9985fc1950ffbaf943fcafc (diff)
downloadpaludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.gz
paludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.xz
Constraint -> Requirement
Diffstat (limited to 'paludis')
-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
66 files changed, 1505 insertions, 1505 deletions
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index cca388524..d8a5c727e 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 580ed802a..81716485d 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 e2df52313..f6339056a 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 b2e48f865..7b221f3c2 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 a9f461606..46672f940 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 e02a69afc..a4bed5805 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 45cd81f23..e0e9edf8d 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 03cb1f834..ac5b48f2d 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 c899b85e9..aa72130a0 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 54d6478ce..7f35f73d2 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 22c0260af..52b9645d8 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 422baf11c..8808a8444 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 ddfc7dd08..184b819ce 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 cfcf7e170..f4e645570 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 dd90b2375..461807841 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 70b274801..6c4a15cf2 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 1eafbf180..4289dc62f 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 a3de07ae7..32569258a 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 0b5d5656c..d3b572ff5 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 0a86a289b..5899a7b64 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 db06a6f91..113a4e1a6 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 3a67ff251..0eda50672 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 787dd9e10..1ccf0dab1 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 ce0a19374..efcd8ae4d 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 b1e88176f..ef3932c78 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 8e92d7ca0..d15aca579 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 a98ca1d07..5c449ff50 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 f09cba5a4..c46dc21da 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 fecc8facd..000000000
--- 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 244352f86..000000000
--- 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 f224c1b1a..000000000
--- 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 5dfaa8627..0ac1b3969 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 dedd625b3..093b58428 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 000000000..40386fd52
--- /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 5a805291e..51d81c824 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 000000000..4a3e93032
--- /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 000000000..b3fc7ff6d
--- /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 5a35e9bc4..2b62a8e77 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 0d08a66b0..633768286 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 83e179c31..bae7c8022 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 5b5a0e16b..b6c6fd7ed 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 db1864d6a..8f1a90f0d 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 f969ab332..4c969ff14 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 50a26c8cb..ef501e033 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 a9515c4d9..99209e148 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 757f4ab15..deccd1357 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 f59ce46c6..f90a77995 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 62288eaac..6448be6ef 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 f8f6a1d0c..3d97cdc2b 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 374039e97..3d5148157 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 825d2875f..ea12ac55f 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 805ffbe70..1234ce9cd 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 48edbd196..7cf8e2924 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 7c288b212..ef1fa0c27 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 64026ddc4..2288b92f2 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 a07421a69..6644e8852 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 92d4aee0a..ab0436c93 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 e277e848a..5366e294e 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 38f359211..7c600e7a7 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 46d340895..758264818 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 d283ab577..c24a151b1 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 0d8202b64..a6c637e7f 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 39afe4467..ec866953b 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 399e96592..0cbd0159a 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 b96479ace..aacacddc2 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 d4ed5199a..2a88bf4f6 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());
}
}