commit: cb4e5da33258de923cde12daab45b9f956179c33 Author: André Erdmann <dywi <AT> mailerd <DOT> de> AuthorDate: Thu Jul 17 16:32:47 2014 +0000 Commit: André Erdmann <dywi <AT> mailerd <DOT> de> CommitDate: Thu Jul 17 16:32:47 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=cb4e5da3
add-policy package rule gen: properly set rule prio --- roverlay/overlay/abccontrol.py | 10 ++++++++++ roverlay/packagerules/generators/abstract/addition_control.py | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/roverlay/overlay/abccontrol.py b/roverlay/overlay/abccontrol.py index 7611e1c..364a083 100644 --- a/roverlay/overlay/abccontrol.py +++ b/roverlay/overlay/abccontrol.py @@ -95,6 +95,16 @@ class AdditionControlResult ( object ): # @classmethod + def get_reversed_sort_key ( cls, k ): + return (-1) * ( k or cls.PKG_ALL ) + # --- end of get_reversed_sort_key (...) --- + + @classmethod + def get_sort_key ( cls, k ): + return ( k or cls.PKG_ALL ) + # --- end of get_sort_key (...) --- + + @classmethod def get_effective_package_policy ( cls, pkg_policy ): # hardcoded for now diff --git a/roverlay/packagerules/generators/abstract/addition_control.py b/roverlay/packagerules/generators/abstract/addition_control.py index 34b5a88..9f12ad0 100644 --- a/roverlay/packagerules/generators/abstract/addition_control.py +++ b/roverlay/packagerules/generators/abstract/addition_control.py @@ -617,7 +617,10 @@ def create_package_rules ( and_acceptor = roverlay.packagerules.abstract.acceptors.Acceptor_AND (0) and_acceptor.add_acceptor ( actual_acceptor ) - rule = roverlay.packagerules.abstract.rules.PackageRule ( priority=emask ) + rule = roverlay.packagerules.abstract.rules.PackageRule ( + # top-priority action should be applied last + priority = AdditionControlResult.get_reversed_sort_key ( emask ) + ) rule.set_acceptor ( and_acceptor )