-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
portage: Add support for --quiet-build and --quiet-fail #36452
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,25 @@ | |
default: None | ||
version_added: 2.3 | ||
|
||
quietbuild: | ||
description: | ||
- Redirect all build output to logs alone, and do not display it | ||
- on stdout (--quiet-build) | ||
required: false | ||
default: False | ||
choices: [ "yes", "no" ] | ||
version_added: 2.6 | ||
|
||
quietfail: | ||
description: | ||
- Suppresses display of the build log on stdout (--quiet-fail) | ||
- Only the die message and the path of the build log will be | ||
- displayed on stdout. | ||
required: false | ||
default: False | ||
choices: [ "yes", "no" ] | ||
version_added: 2.6 | ||
|
||
requirements: [ gentoolkit ] | ||
author: | ||
- "William L Thomson Jr (@wltjr)" | ||
|
@@ -320,6 +339,8 @@ def emerge_packages(module, packages): | |
'usepkgonly': '--usepkgonly', | ||
'usepkg': '--usepkg', | ||
'keepgoing': '--keep-going', | ||
'quietbuild': '--quiet-build', | ||
'quietfail': '--quiet-fail', | ||
} | ||
for flag, arg in emerge_flags.items(): | ||
if p[flag]: | ||
|
@@ -490,9 +511,16 @@ def main(): | |
keepgoing=dict(default=False, type='bool'), | ||
jobs=dict(default=None, type='int'), | ||
loadavg=dict(default=None, type='float'), | ||
quietbuild=dict(default=False, type='bool'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was just being consistent. There are only 3 options that are set to None, all others False. Once merged I plan to switch some of these defaults to True. I feel like ansible should always default to quiet across the board, unless overridden. But you make a good point. It maybe worth dropping all False to None. I think its that way based on the code. Not familiar with conditionals, but I guess None is the same as False? If that is the case then its moot. Either way I believe it only adds these if set to True. If set to False they do not show up. Or should not per how I read the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, Basically,
That is why it's important to check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok based on that it seems the conditional to add any flag requires it to be set to True, per the code. for flag, arg in emerge_flags.items():
if p[flag]:
args.append(arg) If I set it to None it would not be handled correctly. Or maybe ignored since its not True. Pretty sure that will only evaluate to true, if set to True. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it will append flags with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So having None vs False is moot for that stuff. Seems only remaining change is the version. I will correct and break CI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. We'll probably need to consider redesigning defaults separately. Out of scope now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The module could likely use a few improvements. I am open to such. Not sure how many are using the module. It does not seem very popular, or its meeting alls needs/expectations no clue. Then again not sure many are interested in Gentoo these days... |
||
quietfail=dict(default=False, type='bool'), | ||
), | ||
required_one_of=[['package', 'sync', 'depclean']], | ||
mutually_exclusive=[['nodeps', 'onlydeps'], ['quiet', 'verbose']], | ||
mutually_exclusive=[ | ||
['nodeps', 'onlydeps'], | ||
['quiet', 'verbose'], | ||
['quietbuild', 'verbose'], | ||
['quietfail', 'verbose'], | ||
], | ||
supports_check_mode=True, | ||
) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid, this won't make it in 2.6, because it's a bugfix release and the next one accepting features should be 2.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I can increase to 2.7, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I may need to stick with 2.6 or something since CI is failing on 2.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be allowed to merge this branch when devel will start accepting features for 2.7. It's feature-freeze now. I'm going to guess that might happen once we get 2.6 branch separated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so 2.7 is correct, and I should just ignore the CI failure till next iteration.