aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-09-14 22:46:48 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-09-14 22:46:48 +0100
commit6e1e0d048c6b6e196f6c4788a1896ae076b87019 (patch)
treedac993ec8e93f67d475ed7ce3c93807b2538f12e
parent513a9f1632cdd271e52c44ca9ae37fed3de2efc6 (diff)
downloadpaludis-6e1e0d048c6b6e196f6c4788a1896ae076b87019.tar.gz
paludis-6e1e0d048c6b6e196f6c4788a1896ae076b87019.tar.xz
Fix properly
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc29
1 files changed, 10 insertions, 19 deletions
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index 36f71ff..e92edfb 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -75,7 +75,7 @@ namespace
return make_null_shared_ptr();
}
- std::shared_ptr<const SlotRequirement> visit(const SlotAnyPartialLockedRequirement &) const
+ std::shared_ptr<const SlotRequirement> rewrite() const
{
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
generator::Matches(*spec, id, { }) | filter::InstalledAtRoot(env->system_root_key()->parse_value()))]);
@@ -85,32 +85,23 @@ namespace
if ((*matches->last())->slot_key())
{
auto ss((*matches->last())->slot_key()->parse_value());
- if (ss.match_values().first == ss.match_values().second)
- return std::make_shared<ELikeSlotExactPartialRequirement>(ss.match_values().first, spec->slot_requirement_ptr());
- else
+ if (eapi.supported()->ebuild_options()->has_subslots())
return std::make_shared<ELikeSlotExactFullRequirement>(ss.match_values(), spec->slot_requirement_ptr());
+ else
+ return std::make_shared<ELikeSlotExactPartialRequirement>(ss.match_values().first, spec->slot_requirement_ptr());
}
else
return make_null_shared_ptr();
}
- std::shared_ptr<const SlotRequirement> visit(const SlotAnyAtAllLockedRequirement &) const
+ std::shared_ptr<const SlotRequirement> visit(const SlotAnyPartialLockedRequirement &) const
{
- std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, id, { }) | filter::InstalledAtRoot(env->system_root_key()->parse_value()))]);
- if (matches->empty())
- return make_null_shared_ptr();
+ return rewrite();
+ }
- if ((*matches->last())->slot_key())
- {
- auto ss((*matches->last())->slot_key()->parse_value());
- if (eapi.supported()->ebuild_options()->has_subslots())
- return std::make_shared<ELikeSlotExactFullRequirement>(ss.match_values(), spec->slot_requirement_ptr());
- else
- return std::make_shared<ELikeSlotExactPartialRequirement>(ss.match_values().first, spec->slot_requirement_ptr());
- }
- else
- return make_null_shared_ptr();
+ std::shared_ptr<const SlotRequirement> visit(const SlotAnyAtAllLockedRequirement &) const
+ {
+ return rewrite();
}
};