aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 70ae44d91..bf3cd6b88 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 46cae8797..60012be32 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;