diff options
author | 2016-02-18 17:18:51 +0100 | |
---|---|---|
committer | 2016-02-18 17:18:51 +0100 | |
commit | 25f6d2967ec621ecdcd65d2beab405a357e870e4 (patch) | |
tree | 3d517e862fa774535047afbeb3de86627569d919 | |
parent | config/simple-deprules.d/R: recommended packages into dev-lang/R[-minimal] (diff) | |
download | R_overlay-25f6d2967ec621ecdcd65d2beab405a357e870e4.tar.gz R_overlay-25f6d2967ec621ecdcd65d2beab405a357e870e4.tar.bz2 R_overlay-25f6d2967ec621ecdcd65d2beab405a357e870e4.zip |
pkgdir: set default add-policy (bug 574782)
In roverlay/overlay/pkgdir/packagedir_base.py,
PackageDirBase.add_package().package_try_replace():
package_info.overlay_addition_override needs to be set
to an integer value before calling package_try_replace(),
because it is used in a bitwise operation:
package_info.overlay_addition_override &= ~_PKG_REPLACE_ONLY
which raises a TypeError if overlay_addition_override is None.
When running roverlay without bytecode optimizations ("python -O"),
the bug gets catched a bit earlier due to a failing assertion,
as shown in #574782.
X-Gentoo-Bug: 574782
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=574782
-rw-r--r-- | roverlay/overlay/pkgdir/packagedir_base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/roverlay/overlay/pkgdir/packagedir_base.py b/roverlay/overlay/pkgdir/packagedir_base.py index d398914..344173e 100644 --- a/roverlay/overlay/pkgdir/packagedir_base.py +++ b/roverlay/overlay/pkgdir/packagedir_base.py @@ -435,9 +435,12 @@ class PackageDirBase ( roverlay.overlay.base.OverlayObject ): ) # -- end if - addition_override = ( - package_info.overlay_addition_override or _PKG_DEFAULT_BEHAVIOR - ) + # in absence of dynamic addition control, + # set the default mode flags if addition_override is not configured + if package_info.overlay_addition_override is None: + package_info.overlay_addition_override = _PKG_DEFAULT_BEHAVIOR + + addition_override = package_info.overlay_addition_override if addition_override & _PKG_FORCE_DENY: log_addition_control_action ( _PKG_FORCE_DENY, shortver ) |