aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2014-05-18 19:39:36 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2014-05-18 19:39:36 +0100
commit8ecc15db0ed72dfc9b6abd738a1d076202f95fb8 (patch)
treec9dad489272e618b7d7814460894c44846db3ab3
parent5f6a7949fac2d57643aa93017cbb9b7731a975ff (diff)
downloadpaludis-8ecc15db0ed72dfc9b6abd738a1d076202f95fb8.tar.gz
paludis-8ecc15db0ed72dfc9b6abd738a1d076202f95fb8.tar.xz
Make FakeRepository usable for testing subslot things
-rw-r--r--paludis/repositories/fake/dep_parser.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc9
-rw-r--r--paludis/repositories/fake/fake_package_id.hh1
3 files changed, 12 insertions, 0 deletions
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index ec6366a..613f03e 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -53,6 +53,7 @@ namespace
PackageDepSpec p(parse_elike_package_dep_spec(s, ELikePackageDepSpecOptions() + epdso_allow_slot_deps
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ + epdso_allow_slot_equal_deps_portage + epdso_allow_subslot_deps
+ epdso_strict_parsing,
user_version_spec_options()));
(*h.begin())->append(std::make_shared<PackageDepSpec>(p));
@@ -68,6 +69,7 @@ namespace
ELikePackageDepSpecOptions() + epdso_allow_slot_deps
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ + epdso_allow_slot_equal_deps_portage + epdso_allow_subslot_deps
+ epdso_strict_parsing,
user_version_spec_options())));
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index e2c05b7..b63f5d2 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -870,6 +870,15 @@ FakePackageID::set_slot(const SlotName & s)
n::raw_value() = stringify(s)));
}
+void
+FakePackageID::set_slot(const SlotName & s, const SlotName & t)
+{
+ _imp->slot->change_value(make_named_values<Slot>(
+ n::match_values() = std::make_pair(s, t),
+ n::parallel_value() = s,
+ n::raw_value() = stringify(s) + "/" + stringify(t)));
+}
+
bool
FakePackageID::arbitrary_less_than_comparison(const PackageID & other) const
{
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index f5b966f..e041489 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -273,6 +273,7 @@ namespace paludis
const std::shared_ptr<Set<std::string> > behaviours_set();
void set_slot(const SlotName &);
+ void set_slot(const SlotName &, const SlotName &);
///\}