aboutsummaryrefslogtreecommitdiff
path: root/paludis/partially_made_package_dep_spec.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-03 16:12:09 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:33:00 +0100
commitde5f08b35621fd4a790885b2707468203b2df379 (patch)
treee7f98a614dfdcb0c4070fbc573ef9e453eeabfc1 /paludis/partially_made_package_dep_spec.cc
parent1a8319191a0c4a585fab173199a2c898c76f30c3 (diff)
downloadpaludis-de5f08b35621fd4a790885b2707468203b2df379.tar.gz
paludis-de5f08b35621fd4a790885b2707468203b2df379.tar.xz
Normalise cat/pkg parts
Diffstat (limited to 'paludis/partially_made_package_dep_spec.cc')
-rw-r--r--paludis/partially_made_package_dep_spec.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 9d67d9cc0..262456436 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -440,6 +440,8 @@ PartiallyMadePackageDepSpec::~PartiallyMadePackageDepSpec()
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::package(const QualifiedPackageName & name)
{
+ _imp->data->package_name_part.reset();
+ _imp->data->category_name_part.reset();
_imp->data->package = NameConstraintPool::get_instance()->create(name);
return *this;
}
@@ -552,7 +554,15 @@ PartiallyMadePackageDepSpec::clear_installable_to_path()
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::package_name_part(const PackageNamePart & part)
{
- _imp->data->package_name_part = PackageNamePartConstraintPool::get_instance()->create(part);
+ _imp->data->package.reset();
+ if (_imp->data->category_name_part)
+ {
+ _imp->data->package = NameConstraintPool::get_instance()->create(_imp->data->category_name_part->name_part() + part);
+ _imp->data->category_name_part.reset();
+ }
+ else
+ _imp->data->package_name_part = PackageNamePartConstraintPool::get_instance()->create(part);
+
return *this;
}
@@ -566,7 +576,15 @@ PartiallyMadePackageDepSpec::clear_package_name_part()
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::category_name_part(const CategoryNamePart & part)
{
- _imp->data->category_name_part = CategoryNamePartConstraintPool::get_instance()->create(part);
+ _imp->data->category_name_part.reset();
+ if (_imp->data->package_name_part)
+ {
+ _imp->data->package = NameConstraintPool::get_instance()->create(part + _imp->data->package_name_part->name_part());
+ _imp->data->package_name_part.reset();
+ }
+ else
+ _imp->data->category_name_part = CategoryNamePartConstraintPool::get_instance()->create(part);
+
return *this;
}