Skip to content

Commit

Permalink
portage: fix changed_use and newuse not triggering rebuilds (#6008) (#…
Browse files Browse the repository at this point in the history
…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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5f968fb)
  • Loading branch information
s-hamann authored and patchback[bot] committed May 21, 2023
1 parent 443d5a2 commit ba4b723
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/6548-portage-changed_use-newuse.yml
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 2 additions & 2 deletions plugins/modules/portage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit ba4b723

Please sign in to comment.