diff --git a/changelogs/fragments/4312-pacman-groups.yml b/changelogs/fragments/4312-pacman-groups.yml new file mode 100644 index 0000000000..7160dca416 --- /dev/null +++ b/changelogs/fragments/4312-pacman-groups.yml @@ -0,0 +1,9 @@ +bugfixes: + - pacman - Use ``--groups`` instead of ``--group`` + (https://github.com/ansible-collections/community.general/pull/4312). + +known_issues: + - pacman - binaries specified in the ``executable`` parameter must support + ``--print-format`` in order to be used by this module. + In particular, AUR helper ``yay`` is known not to currently support it + (https://github.com/ansible-collections/community.general/pull/4312). diff --git a/plugins/modules/packaging/os/pacman.py b/plugins/modules/packaging/os/pacman.py index 116ed48e6d..324c9ebccc 100644 --- a/plugins/modules/packaging/os/pacman.py +++ b/plugins/modules/packaging/os/pacman.py @@ -52,7 +52,10 @@ options: executable: description: - - Name of binary to use. This can either be C(pacman) or a pacman compatible AUR helper. + - Path of the binary to use. This can either be C(pacman) or a pacman compatible AUR helper. + - Pacman compatibility is unfortunately ill defined, in particular, this modules makes + extensive use of the C(--print-format) directive which is known not to be implemented by + some AUR helpers (notably, C(yay)). - Beware that AUR helpers might behave unexpectedly and are therefore not recommended. default: pacman type: str @@ -575,7 +578,7 @@ class Pacman(object): installed_groups = defaultdict(set) dummy, stdout, dummy = self.m.run_command( - [self.pacman_path, "--query", "--group"], check_rc=True + [self.pacman_path, "--query", "--groups"], check_rc=True ) # Format of lines: # base-devel file @@ -600,7 +603,7 @@ class Pacman(object): available_groups = defaultdict(set) dummy, stdout, dummy = self.m.run_command( - [self.pacman_path, "--sync", "--group", "--group"], check_rc=True + [self.pacman_path, "--sync", "--groups", "--groups"], check_rc=True ) # Format of lines: # vim-plugins vim-airline