aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2014-07-14 21:19:36 +0200
committerAndré Erdmann <dywi@mailerd.de>2014-07-14 21:21:17 +0200
commitc2532248e43506eb9988c2fb6c7413da250e8a3d (patch)
tree2b2b97856e3dc2b9397b97c149831d017c428543
parentaddition control: packagedir.add_package() (diff)
downloadR_overlay-c2532248e43506eb9988c2fb6c7413da250e8a3d.tar.gz
R_overlay-c2532248e43506eb9988c2fb6c7413da250e8a3d.tar.bz2
R_overlay-c2532248e43506eb9988c2fb6c7413da250e8a3d.zip
addition control: rename force-add=>force-replace
There's no real "force-add".
-rw-r--r--doc/rst/usage.rst2
-rw-r--r--roverlay/overlay/abccontrol.py10
-rw-r--r--roverlay/overlay/pkgdir/packagedir_base.py6
-rw-r--r--roverlay/packagerules/actions/addition_control.py8
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 (