aboutsummaryrefslogtreecommitdiff
path: root/paludis/partially_made_package_dep_spec.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:19:18 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:33:00 +0100
commit6d8fa49055b5c43117d98c020187be9bfa4fb2c6 (patch)
tree1f8d90310bbac90838dce4f082fd4c8fa4e04942 /paludis/partially_made_package_dep_spec.cc
parent508e7564e1d8d1de765d4d517bc899b7ef137716 (diff)
downloadpaludis-6d8fa49055b5c43117d98c020187be9bfa4fb2c6.tar.gz
paludis-6d8fa49055b5c43117d98c020187be9bfa4fb2c6.tar.xz
Use reqs to constraints
Diffstat (limited to 'paludis/partially_made_package_dep_spec.cc')
-rw-r--r--paludis/partially_made_package_dep_spec.cc46
1 files changed, 22 insertions, 24 deletions
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 262456436..1153a9174 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/additional_package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
#include <paludis/package_dep_spec_constraint.hh>
#include <paludis/version_operator.hh>
@@ -63,7 +62,7 @@ namespace
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<AdditionalPackageDepSpecRequirements> additional_requirements;
+ std::shared_ptr<ChoiceConstraintSequence> all_choices;
PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec_v;
PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecOptions & o) :
@@ -86,7 +85,7 @@ namespace
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),
- additional_requirements(other.additional_requirements_ptr() ? new AdditionalPackageDepSpecRequirements : 0),
+ all_choices(other.all_choice_constraints() ? new ChoiceConstraintSequence : 0),
options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec())
{
if (all_versions)
@@ -97,9 +96,9 @@ namespace
std::copy(other.all_key_constraints()->begin(), other.all_key_constraints()->end(),
all_keys->back_inserter());
- if (additional_requirements)
- std::copy(other.additional_requirements_ptr()->begin(), other.additional_requirements_ptr()->end(),
- additional_requirements->back_inserter());
+ if (all_choices)
+ std::copy(other.all_choice_constraints()->begin(), other.all_choice_constraints()->end(),
+ all_choices->back_inserter());
}
PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecData & other) :
@@ -116,7 +115,7 @@ namespace
installed_at_path(other.installed_at_path),
installable_to_path(other.installable_to_path),
all_keys(other.all_keys),
- additional_requirements(other.additional_requirements),
+ all_choices(other.all_choices),
options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec_v)
{
}
@@ -295,9 +294,8 @@ namespace
}
}
- if (additional_requirements_ptr())
- for (AdditionalPackageDepSpecRequirements::ConstIterator u(additional_requirements_ptr()->begin()),
- u_end(additional_requirements_ptr()->end()) ; u != u_end ; ++u)
+ if (all_choice_constraints())
+ for (auto u(all_choice_constraints()->begin()), u_end(all_choice_constraints()->end()) ; u != u_end ; ++u)
s << (*u)->as_raw_string();
if (all_key_constraints())
@@ -377,14 +375,14 @@ namespace
return installable_to_path;
}
- virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const
+ virtual const std::shared_ptr<const KeyConstraintSequence> all_key_constraints() const
{
- return additional_requirements;
+ return all_keys;
}
- virtual const std::shared_ptr<const KeyConstraintSequence> all_key_constraints() const
+ virtual const std::shared_ptr<const ChoiceConstraintSequence> all_choice_constraints() const
{
- return all_keys;
+ return all_choices;
}
virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const
@@ -616,27 +614,27 @@ PartiallyMadePackageDepSpec::clear_version_requirements()
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::additional_requirement(const std::shared_ptr<const AdditionalPackageDepSpecRequirement> & req)
+PartiallyMadePackageDepSpec::key_constraint(const std::string & k, const KeyConstraintOperation o, const std::string & p)
{
- if (! _imp->data->additional_requirements)
- _imp->data->additional_requirements = std::make_shared<AdditionalPackageDepSpecRequirements>();
- _imp->data->additional_requirements->push_back(req);
+ if (! _imp->data->all_keys)
+ _imp->data->all_keys = std::make_shared<KeyConstraintSequence>();
+ _imp->data->all_keys->push_back(KeyConstraintPool::get_instance()->create(k, o, p));
return *this;
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::key_constraint(const std::string & k, const KeyConstraintOperation o, const std::string & p)
+PartiallyMadePackageDepSpec::choice_constraint(const std::shared_ptr<const ChoiceConstraint> & c)
{
- if (! _imp->data->all_keys)
- _imp->data->all_keys = std::make_shared<KeyConstraintSequence>();
- _imp->data->all_keys->push_back(KeyConstraintPool::get_instance()->create(k, o, p));
+ if (! _imp->data->all_choices)
+ _imp->data->all_choices = std::make_shared<ChoiceConstraintSequence>();
+ _imp->data->all_choices->push_back(c);
return *this;
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::clear_additional_requirements()
+PartiallyMadePackageDepSpec::clear_choice_requirements()
{
- _imp->data->additional_requirements.reset();
+ _imp->data->all_choices.reset();
return *this;
}