From cdd9ced44178563dd5ab4469bb98dc924994c445 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 21 May 2023 22:02:37 +0200 Subject: [PATCH] [PR #6548/5f968fb0 backport][stable-6] portage: fix changed_use and newuse not triggering rebuilds (#6008) (#6557) 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 (cherry picked from commit 5f968fb075cf2a150b5ea98451c54481233d103f) Co-authored-by: s-hamann <10639154+s-hamann@users.noreply.github.com> --- 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.')