mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
Add "changed_deps" to portage parameters (#11023)
* Add option for '--changed-deps' * Add changelog fragment * Re-add the changed_deps option * Include link to PR * Rename fragment properly, and include PR number in name * Add version string and improve doc description * Update changelogs/fragments/11023-portage_changed_deps.yml Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Refine documentation string further * Reformat with ruff * Add a correct changely fragment * Update plugins/modules/portage.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
2
changelogs/fragments/11023-portage_changed_deps.yml
Normal file
2
changelogs/fragments/11023-portage_changed_deps.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- "portage - add a ``changed_deps`` option (https://github.com/ansible-collections/community.general/pull/11023)."
|
||||
@@ -65,6 +65,14 @@ options:
|
||||
type: bool
|
||||
default: false
|
||||
|
||||
changed_deps:
|
||||
description:
|
||||
- Tells emerge to replace installed packages for which the ebuild dependencies
|
||||
have changed since the packages were built (C(--changed-deps)).
|
||||
type: bool
|
||||
default: false
|
||||
version_added: 12.0.0
|
||||
|
||||
changed_use:
|
||||
description:
|
||||
- Include installed packages where USE flags have changed, except when.
|
||||
@@ -333,10 +341,17 @@ def emerge_packages(module, packages):
|
||||
"""Run emerge command against given list of atoms."""
|
||||
p = module.params
|
||||
|
||||
if p["noreplace"] and not p["changed_use"] and not p["newuse"] and not (p["update"] or p["state"] == "latest"):
|
||||
if (
|
||||
p["noreplace"]
|
||||
and not p["changed_deps"]
|
||||
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 p["changed_deps"]
|
||||
and not p["changed_use"]
|
||||
and not p["newuse"]
|
||||
and not query_package(module, package, "emerge")
|
||||
@@ -352,6 +367,7 @@ def emerge_packages(module, packages):
|
||||
"update": "--update",
|
||||
"deep": "--deep",
|
||||
"newuse": "--newuse",
|
||||
"changed_deps": "--changed-deps",
|
||||
"changed_use": "--changed-use",
|
||||
"oneshot": "--oneshot",
|
||||
"noreplace": "--noreplace",
|
||||
@@ -542,6 +558,7 @@ def main():
|
||||
backtrack=dict(type="int"),
|
||||
deep=dict(default=False, type="bool"),
|
||||
newuse=dict(default=False, type="bool"),
|
||||
changed_deps=dict(default=False, type="bool"),
|
||||
changed_use=dict(default=False, type="bool"),
|
||||
oneshot=dict(default=False, type="bool"),
|
||||
noreplace=dict(default=True, type="bool"),
|
||||
|
||||
Reference in New Issue
Block a user