From c3e09c0cec51503b68e03a2910e16237f79356dc Mon Sep 17 00:00:00 2001 From: Ciaran McCreesh Date: Sat, 4 Dec 2010 17:00:27 +0000 Subject: Use binary rather than unbinaryable for filtering origins Fixes: ticket:1051 --- paludis/resolver/destination_utils-fwd.hh | 1 + paludis/resolver/destination_utils.cc | 8 ++++++++ paludis/resolver/make_origin_filtered_generator_helper.cc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'paludis') diff --git a/paludis/resolver/destination_utils-fwd.hh b/paludis/resolver/destination_utils-fwd.hh index 250083aee..3770f51d8 100644 --- a/paludis/resolver/destination_utils-fwd.hh +++ b/paludis/resolver/destination_utils-fwd.hh @@ -32,6 +32,7 @@ namespace paludis namespace resolver { bool can_make_binary_for(const std::shared_ptr & id) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE; + bool is_already_binary(const std::shared_ptr & id) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE; bool can_chroot(const std::shared_ptr & id) PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE; FilteredGenerator destination_filtered_generator( diff --git a/paludis/resolver/destination_utils.cc b/paludis/resolver/destination_utils.cc index 7097e8784..1c16d63aa 100644 --- a/paludis/resolver/destination_utils.cc +++ b/paludis/resolver/destination_utils.cc @@ -38,6 +38,14 @@ paludis::resolver::can_make_binary_for(const std::shared_ptr & return id->behaviours_key()->value()->end() == id->behaviours_key()->value()->find("unbinaryable"); } +bool +paludis::resolver::is_already_binary(const std::shared_ptr & id) +{ + if (! id->behaviours_key()) + return false; + return id->behaviours_key()->value()->end() != id->behaviours_key()->value()->find("binary"); +} + bool paludis::resolver::can_chroot(const std::shared_ptr & id) { diff --git a/paludis/resolver/make_origin_filtered_generator_helper.cc b/paludis/resolver/make_origin_filtered_generator_helper.cc index a397f87c7..adddb3e90 100644 --- a/paludis/resolver/make_origin_filtered_generator_helper.cc +++ b/paludis/resolver/make_origin_filtered_generator_helper.cc @@ -73,7 +73,7 @@ namespace for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ; i != i_end ; ++i) - if (can_make_binary_for(*i)) + if (! is_already_binary(*i)) result->insert(*i); return result; -- cgit v1.2.3