aboutsummaryrefslogtreecommitdiff
path: root/paludis/partially_made_package_dep_spec.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-28 23:44:02 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:32:58 +0100
commitb7f5d7dbfeff2e406ef24ca471657e1735a4db4f (patch)
treec1af04c563afeff3b8410022f1cd9079299dd6ce /paludis/partially_made_package_dep_spec.cc
parent968efa61fa4abe5349ffc453ac46087867eaa29b (diff)
downloadpaludis-b7f5d7dbfeff2e406ef24ca471657e1735a4db4f.tar.gz
paludis-b7f5d7dbfeff2e406ef24ca471657e1735a4db4f.tar.xz
Start using constraints for PackageDepSpecs
Diffstat (limited to 'paludis/partially_made_package_dep_spec.cc')
-rw-r--r--paludis/partially_made_package_dep_spec.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index e94883a88..bd000bd9c 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -28,6 +28,7 @@
#include <paludis/version_requirements.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
#include <paludis/dep_spec_data.hh>
+#include <paludis/package_dep_spec_constraint.hh>
#include <iterator>
#include <algorithm>
#include <ostream>
@@ -47,7 +48,7 @@ namespace
struct PartiallyMadePackageDepSpecData :
PackageDepSpecData
{
- std::shared_ptr<const QualifiedPackageName> package;
+ std::shared_ptr<const NameConstraint> package;
std::shared_ptr<const PackageNamePart> package_name_part;
std::shared_ptr<const CategoryNamePart> category_name_part;
std::shared_ptr<VersionRequirements> version_requirements;
@@ -70,7 +71,7 @@ namespace
PartiallyMadePackageDepSpecData(const PackageDepSpecData & other) :
PackageDepSpecData(other),
- package(other.package_ptr()),
+ package(other.package_name_constraint()),
package_name_part(other.package_name_part_ptr()),
category_name_part(other.category_name_part_ptr()),
version_requirements(other.version_requirements_ptr() ? new VersionRequirements : 0),
@@ -130,8 +131,8 @@ namespace
}
}
- if (package_ptr())
- s << *package_ptr();
+ if (package_name_constraint())
+ s << package_name_constraint()->name();
else
{
if (category_name_part_ptr())
@@ -277,7 +278,7 @@ namespace
return s.str();
}
- virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const
+ virtual const std::shared_ptr<const NameConstraint> package_name_constraint() const
{
return package;
}
@@ -390,7 +391,7 @@ PartiallyMadePackageDepSpec::~PartiallyMadePackageDepSpec()
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::package(const QualifiedPackageName & name)
{
- _imp->data->package = std::make_shared<QualifiedPackageName>(name);
+ _imp->data->package = NameConstraintPool::get_instance()->create(name);
return *this;
}