mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
modules/portage: fix usage with withbdeps: false (#6456)
Using ``withbdeps: false`` was causing the underlying emerge command to fail due to not passing an argument to the ``--with-bdeps`` flag. Fix by updating the logic for generating the emerge command arguments to ensure that ``withbdeps: false`` results in a passing an ``n`` argument with the ``--with-bdeps`` emerge flag.
This commit is contained in:
parent
27a3d6d85d
commit
fab717bb2d
2 changed files with 6 additions and 6 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "portage - update the logic for generating the emerge command arguments to ensure that ``withbdeps: false`` results in a passing an ``n`` argument with the ``--with-bdeps`` emerge flag (https://github.com/ansible-collections/community.general/issues/6451, https://github.com/ansible-collections/community.general/pull/6456)."
|
|
@ -383,14 +383,12 @@ def emerge_packages(module, packages):
|
|||
"""Fallback to default: don't use this argument at all."""
|
||||
continue
|
||||
|
||||
if not flag_val:
|
||||
"""Add the --flag=value pair."""
|
||||
if isinstance(flag_val, bool):
|
||||
args.extend((arg, to_native('y' if flag_val else 'n')))
|
||||
elif not flag_val:
|
||||
"""If the value is 0 or 0.0: add the flag, but not the value."""
|
||||
args.append(arg)
|
||||
continue
|
||||
|
||||
"""Add the --flag=value pair."""
|
||||
if isinstance(p[flag], bool):
|
||||
args.extend((arg, to_native('y' if flag_val else 'n')))
|
||||
else:
|
||||
args.extend((arg, to_native(flag_val)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue