commit:     384a35d19b894e467bfbfb2cc827eacb1d4f97f5
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 17 19:13:40 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 17 19:13:40 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=384a35d1

add-policy rule gen: merge acceptor compounds

... by default

---
 roverlay/packagerules/generators/abstract/addition_control.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/roverlay/packagerules/generators/abstract/addition_control.py 
b/roverlay/packagerules/generators/abstract/addition_control.py
index 9f12ad0..b58b666 100644
--- a/roverlay/packagerules/generators/abstract/addition_control.py
+++ b/roverlay/packagerules/generators/abstract/addition_control.py
@@ -439,7 +439,8 @@ def create_packagerule_action_map():
 def create_package_rules (
    reduced_bitmask_acceptor_chain_map,
    convert_category_token_to_acceptor,
-   convert_package_token_to_acceptor
+   convert_package_token_to_acceptor,
+   collapse_acceptor_combounds=True,
 ):
    """Converts the given "effective bitmask" -> "acceptor chain" map
    into a nested package rule.
@@ -453,6 +454,9 @@ def create_package_rules (
                                              -> category acceptor
    * convert_package_token_to_acceptor  -- function(token,priority)
                                              -> package acceptor
+   * collapse_acceptor_combounds        -- bool that controls whether acceptor
+                                           compounds should be merged or not
+                                           Defaults to True.
    """
    packagerule_actions    = create_packagerule_action_map()
    # true acceptor with priority -1
@@ -617,6 +621,9 @@ def create_package_rules (
       and_acceptor    = roverlay.packagerules.abstract.acceptors.Acceptor_AND 
(0)
       and_acceptor.add_acceptor ( actual_acceptor )
 
+      if collapse_acceptor_combounds:
+         and_acceptor.merge_sub_compounds()
+
       rule = roverlay.packagerules.abstract.rules.PackageRule (
          # top-priority action should be applied last
          priority = AdditionControlResult.get_reversed_sort_key ( emask )

Reply via email to