From 5f968fb075cf2a150b5ea98451c54481233d103f Mon Sep 17 00:00:00 2001 From: s-hamann <10639154+s-hamann@users.noreply.github.com> Date: Sun, 21 May 2023 19:36:46 +0000 Subject: [PATCH] portage: fix changed_use and newuse not triggering rebuilds (#6008) (#6548) * portage: fix changed_use and newuse not triggering rebuilds (#6008) * Add changelog fragment * Update changelogs/fragments/6548-portage-changed_use-newuse.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- changelogs/fragments/6548-portage-changed_use-newuse.yml | 3 +++ plugins/modules/portage.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/6548-portage-changed_use-newuse.yml 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.')