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 13:36:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 13:36:57 +0100
commit4cd184dd41cc756de430499a36972a6824b68f90 (patch)
treecb135ef5b502b97167cad2c5915fd85f74f8021e /paludis/partially_made_package_dep_spec.cc
parente1469fa5c597017a79ce62706f579aca35fd3c40 (diff)
downloadpaludis-4cd184dd41cc756de430499a36972a6824b68f90.tar.gz
paludis-4cd184dd41cc756de430499a36972a6824b68f90.tar.xz
Move around KeyConstraint logic
Diffstat (limited to 'paludis/partially_made_package_dep_spec.cc')
-rw-r--r--paludis/partially_made_package_dep_spec.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 7fad45450..2dc71ff5a 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -300,22 +300,7 @@ namespace
if (all_key_constraints())
for (auto u(all_key_constraints()->begin()), u_end(all_key_constraints()->end()) ; u != u_end ; ++u)
- {
- s << "[" << (*u)->key();
-
- switch ((*u)->operation())
- {
- case kco_equals: s << "=" << (*u)->pattern(); break;
- case kco_less_than: s << "<" << (*u)->pattern(); break;
- case kco_greater_than: s << ">" << (*u)->pattern(); break;
- case kco_question: s << "?"; break;
-
- case last_kco:
- throw InternalError(PALUDIS_HERE, "Bad KeyConstraintOperation");
- }
-
- s << "]";
- }
+ s << (*u)->as_raw_string();
return s.str();
}
@@ -614,11 +599,11 @@ PartiallyMadePackageDepSpec::clear_version()
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::key_constraint(const std::string & k, const KeyConstraintOperation o, const std::string & p)
+PartiallyMadePackageDepSpec::key_constraint(const KeyConstraintKeyType t, const std::string & k, const KeyConstraintOperation o, const std::string & p)
{
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));
+ _imp->data->all_keys->push_back(KeyConstraintPool::get_instance()->create(t, k, o, p));
return *this;
}