From c2532248e43506eb9988c2fb6c7413da250e8a3d Mon Sep 17 00:00:00 2001 From: André Erdmann Date: Mon, 14 Jul 2014 21:19:36 +0200 Subject: addition control: rename force-add=>force-replace There's no real "force-add". --- doc/rst/usage.rst | 2 +- roverlay/overlay/abccontrol.py | 10 +++++----- roverlay/overlay/pkgdir/packagedir_base.py | 6 ++---- roverlay/packagerules/actions/addition_control.py | 8 ++++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/rst/usage.rst b/doc/rst/usage.rst index 5ef6289..c1185e2 100644 --- a/doc/rst/usage.rst +++ b/doc/rst/usage.rst @@ -2036,8 +2036,8 @@ control *where*) and the number of values they accept: | | | | | | | | | Possible values are | | | | | *force-deny*, | - | | | | *force-add*, | | | | | *deny-replace*, | + | | | | *force-replace*, | | | | | *revbump-on-\ | | | | | collision*, | | | | | and *default* | diff --git a/roverlay/overlay/abccontrol.py b/roverlay/overlay/abccontrol.py index 65c2bf7..e351909 100644 --- a/roverlay/overlay/abccontrol.py +++ b/roverlay/overlay/abccontrol.py @@ -42,12 +42,13 @@ class AdditionControlResult ( object ): # # force-deny -- always deny the package - # force-add -- always (re-)add the package # deny-replace -- accept new packages only (**) + # force-replace -- always replace existing ebuilds (***) # revbump-on-collision -- forced revbump if an ebuild exists already # default-behavior -- no addition control # - # (**) in this context, "replace" includes revbump checks + # (**) in this context, "replace" includes revbump checks + # (***) does not trigger revbump logic # # force-deny should not be used in package rules, # because it is inferior to the "do-not-process" action. @@ -61,9 +62,8 @@ class AdditionControlResult ( object ): # (equal to deny-replace, but faster) # PKG_FORCE_DENY = 2**0 - PKG_FORCE_ADD = 2**1 - PKG_DENY_REPLACE = 2**2 - #PKG_FORCE_REPLACE + PKG_DENY_REPLACE = 2**1 + PKG_FORCE_REPLACE = 2**2 #PKG_REPLACE_ONLY PKG_REVBUMP_ON_COLLISION = 2**4 PKG_DEFAULT_BEHAVIOR = 0 diff --git a/roverlay/overlay/pkgdir/packagedir_base.py b/roverlay/overlay/pkgdir/packagedir_base.py index 45c3cb6..7a038ad 100644 --- a/roverlay/overlay/pkgdir/packagedir_base.py +++ b/roverlay/overlay/pkgdir/packagedir_base.py @@ -236,8 +236,8 @@ class PackageDirBase ( roverlay.overlay.base.OverlayObject ): # ref AdditionControlResult = roverlay.overlay.control.AdditionControlResult _PKG_FORCE_DENY = AdditionControlResult.PKG_FORCE_DENY - _PKG_FORCE_ADD = AdditionControlResult.PKG_FORCE_ADD _PKG_DENY_REPLACE = AdditionControlResult.PKG_DENY_REPLACE + _PKG_FORCE_REPLACE = AdditionControlResult.PKG_FORCE_REPLACE _PKG_REVBUMP_ON_COLLISION = AdditionControlResult.PKG_REVBUMP_ON_COLLISION _PKG_DEFAULT_BEHAVIOR = AdditionControlResult.PKG_DEFAULT_BEHAVIOR @@ -370,15 +370,13 @@ class PackageDirBase ( roverlay.overlay.base.OverlayObject ): return False elif existing_package: - # TODO/FIXME: rename force-add => force-replace - # -- there's no real "force-add" return package_try_replace ( addition_override = addition_override, existing_package = existing_package, shortver = shortver, package_info = package_info, add_if_physical = ( - add_if_physical or (addition_override & _PKG_FORCE_ADD) + add_if_physical or (addition_override & _PKG_FORCE_REPLACE) ), allow_postpone = allow_postpone ) diff --git a/roverlay/packagerules/actions/addition_control.py b/roverlay/packagerules/actions/addition_control.py index 30145bd..577e884 100644 --- a/roverlay/packagerules/actions/addition_control.py +++ b/roverlay/packagerules/actions/addition_control.py @@ -16,8 +16,8 @@ from roverlay.overlay.abccontrol import AdditionControlResult ACTIONS = [ 'PackageAdditionControlDefaultAction', 'PackageAdditionControlForceDenyAction', - 'PackageAdditionControlForceAddAction', 'PackageAdditionControlDenyReplaceAction', + 'PackageAdditionControlForceReplaceAction', 'PackageAdditionControlRevbumpOnCollisionAction', ] @@ -64,11 +64,11 @@ class PackageAdditionControlForceDenyAction ( CONTROL_RESULT = AdditionControlResult.PKG_FORCE_DENY -class PackageAdditionControlForceAddAction ( +class PackageAdditionControlForceReplaceAction ( PackageAdditionControlActionBase ): - CONTROL_KEYWORD = "force-add" - CONTROL_RESULT = AdditionControlResult.PKG_FORCE_ADD + CONTROL_KEYWORD = "force-replace" + CONTROL_RESULT = AdditionControlResult.PKG_FORCE_REPLACE class PackageAdditionControlDenyReplaceAction ( -- cgit v1.2.3-65-gdbad