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:
Daniel Harding 2023-05-03 23:44:28 +03:00 committed by GitHub
commit fab717bb2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -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)))