Skip to content

Commit

Permalink
portage: add knob for portage's --with-bdeps option
Browse files Browse the repository at this point in the history
Also, this option does not accept "True" like other options. Instead,
it only uses 'y' and 'n', so parse booleans properly into these chars.

Signed-off-by: John Helmert III <ajak@gentoo.org>
  • Loading branch information
ajakk committed Oct 13, 2022
1 parent 524e93f commit fdb4d40
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion plugins/modules/packaging/os/portage.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
- --load-average setting values
type: float
withbdeps:
description:
- Specifies that build time dependencies should be installed.
type: bool
version_added: 5.8.0
quietbuild:
description:
- Redirect all build output to logs alone, and do not display it
Expand Down Expand Up @@ -356,6 +362,7 @@ def emerge_packages(module, packages):
'jobs': '--jobs',
'loadavg': '--load-average',
'backtrack': '--backtrack',
'withbdeps': '--with-bdeps',
}

for flag, arg in emerge_flags.items():
Expand All @@ -371,7 +378,10 @@ def emerge_packages(module, packages):
continue

"""Add the --flag=value pair."""
args.extend((arg, to_native(flag_val)))
if type(p[flag]) == bool:
args.extend((arg, to_native('y' if flag_val else 'n')))
else:
args.extend((arg, to_native(flag_val)))

cmd, (rc, out, err) = run_emerge(module, packages, *args)
if rc != 0:
Expand Down Expand Up @@ -514,6 +524,7 @@ def main():
keepgoing=dict(default=False, type='bool'),
jobs=dict(default=None, type='int'),
loadavg=dict(default=None, type='float'),
withbdeps=dict(default=None, type='bool'),
quietbuild=dict(default=False, type='bool'),
quietfail=dict(default=False, type='bool'),
),
Expand Down

0 comments on commit fdb4d40

Please sign in to comment.