diff --git a/changelogs/fragments/6548-portage-changed_use-newuse.yml b/changelogs/fragments/6548-portage-changed_use-newuse.yml new file mode 100644 index 0000000000..0d1ba55e09 --- /dev/null +++ b/changelogs/fragments/6548-portage-changed_use-newuse.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - portage - fix ``changed_use`` and ``newuse`` not triggering rebuilds (https://github.com/ansible-collections/community.general/issues/6008, https://github.com/ansible-collections/community.general/pull/6548). diff --git a/plugins/modules/portage.py b/plugins/modules/portage.py index c732e7f56f..1c6b365376 100644 --- a/plugins/modules/portage.py +++ b/plugins/modules/portage.py @@ -333,9 +333,9 @@ def emerge_packages(module, packages): """Run emerge command against given list of atoms.""" p = module.params - if p['noreplace'] and not (p['update'] or p['state'] == 'latest'): + if p['noreplace'] and not p['changed_use'] and not p['newuse'] and not (p['update'] or p['state'] == 'latest'): for package in packages: - if p['noreplace'] and not query_package(module, package, 'emerge'): + if p['noreplace'] and not p['changed_use'] and not p['newuse'] and not query_package(module, package, 'emerge'): break else: module.exit_json(changed=False, msg='Packages already present.')