aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-08 16:26:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-08 20:33:47 +0000
commita28909960fd86c8107041e3784fbbfd160bcae42 (patch)
treef4bb92c9a091c8622e91d5da6b0b69e66dbb7780
parent55e1dfd80ba17b9e992e5f4687e353f42f67517a (diff)
downloadpaludis-a28909960fd86c8107041e3784fbbfd160bcae42.tar.gz
paludis-a28909960fd86c8107041e3784fbbfd160bcae42.tar.xz
FindReplacingHelper::one_binary_per_slot
-rw-r--r--paludis/resolver/find_replacing_helper.cc12
-rw-r--r--paludis/resolver/find_replacing_helper.hh2
2 files changed, 12 insertions, 2 deletions
diff --git a/paludis/resolver/find_replacing_helper.cc b/paludis/resolver/find_replacing_helper.cc
index 70ae44d..bf3cd6b 100644
--- a/paludis/resolver/find_replacing_helper.cc
+++ b/paludis/resolver/find_replacing_helper.cc
@@ -45,9 +45,11 @@ namespace paludis
struct Imp<FindReplacingHelper>
{
const Environment * const env;
+ bool one_binary_per_slot;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ one_binary_per_slot(false)
{
}
};
@@ -60,6 +62,12 @@ FindReplacingHelper::FindReplacingHelper(const Environment * const e) :
FindReplacingHelper::~FindReplacingHelper() = default;
+void
+FindReplacingHelper::set_one_binary_per_slot(bool value)
+{
+ _imp->one_binary_per_slot = value;
+}
+
const std::shared_ptr<const PackageIDSequence>
FindReplacingHelper::operator() (
const std::shared_ptr<const PackageID> & id,
@@ -92,7 +100,7 @@ FindReplacingHelper::operator() (
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
- if ((*i)->version() == id->version() || (same_slot(*i, id) && repo->installed_root_key()))
+ if ((*i)->version() == id->version() || (same_slot(*i, id) && (_imp->one_binary_per_slot || repo->installed_root_key())))
result->push_back(*i);
}
}
diff --git a/paludis/resolver/find_replacing_helper.hh b/paludis/resolver/find_replacing_helper.hh
index 46cae87..60012be 100644
--- a/paludis/resolver/find_replacing_helper.hh
+++ b/paludis/resolver/find_replacing_helper.hh
@@ -40,6 +40,8 @@ namespace paludis
explicit FindReplacingHelper(const Environment * const);
~FindReplacingHelper();
+ void set_one_binary_per_slot(bool value);
+
const std::shared_ptr<const PackageIDSequence> operator() (
const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const Repository> &) const;