Compare commits

..

No commits in common. "c8bf68a91b790493d83f8c21023381d4bdff2843" and "47fbee75b99fd7125244c16463bd1a429394b344" have entirely different histories.

3 changed files with 9 additions and 22 deletions

View File

@ -69,7 +69,6 @@ The following helpers are supported and automatically selected, if present, in t
| name | | Name or list of names of the package(s) to install or upgrade. |
| state | **present**, latest | Desired state of the package, 'present' skips operations if the package is already installed. |
| upgrade | yes, **no** | Whether or not to upgrade whole system. |
| update_cache | yes, **no** | Whether or not to refresh the packages cache |
| use | **auto**, yay, paru, pacaur, trizen, pikaur, aurman, makepkg | The tool to use, 'auto' uses the first known helper found and makepkg as a fallback. |
| extra_args | **null** | A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode. |
| aur_only | yes, **no** | Limit helper operation to the AUR. |

View File

@ -8,7 +8,7 @@ namespace: kewlfft
name: aur
# The version of the collection. Must be compatible with semantic versioning
version: 0.10.0
version: 0.9.1
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
@ -66,3 +66,4 @@ issues: https://github.com/kewlfft/ansible-aur/issues
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore: []

View File

@ -39,12 +39,6 @@ options:
default: no
type: bool
update_cache:
description:
- Whether or not to update_cache the package cache.
default: no
type: bool
use:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
@ -166,7 +160,7 @@ def check_packages(module, packages):
module.exit_json(changed=status, msg=message, diff=diff)
def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None, update_cache=False):
def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None):
"""
Create the prefix of a command that can be used by the install and upgrade functions.
"""
@ -182,8 +176,6 @@ def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=Fals
command.append('--aur')
if local_pkgbuild and use != 'makepkg':
command.append(local_pkgbuild)
if update_cache:
command.append('-y')
if extra_args:
command += shlex.split(extra_args)
return command
@ -240,13 +232,13 @@ def check_upgrade(module, use):
)
def upgrade(module, use, extra_args, aur_only, update_cache):
def upgrade(module, use, extra_args, aur_only):
"""
Upgrade the whole system
"""
assert use in use_cmd
command = build_command_prefix(use, extra_args, aur_only=aur_only, update_cache=update_cache)
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append('-u')
rc, out, err = module.run_command(command, check_rc=True)
@ -258,7 +250,7 @@ def upgrade(module, use, extra_args, aur_only, update_cache):
)
def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild, update_cache):
def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild):
"""
Install the specified packages
"""
@ -279,7 +271,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
elif local_pkgbuild:
rc, out, err = install_local_package(module, package, use, extra_args, local_pkgbuild)
else:
command = build_command_prefix(use, extra_args, aur_only=aur_only, update_cache=update_cache)
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append(package)
rc, out, err = module.run_command(command, check_rc=True)
@ -308,10 +300,6 @@ def make_module():
'upgrade': {
'type': 'bool',
},
'update_cache': {
'default': False,
'type': 'bool',
},
'use': {
'default': 'auto',
'choices': ['auto'] + list(use_cmd.keys()),
@ -384,7 +372,7 @@ def apply_module(module, use):
if module.check_mode:
check_upgrade(module, use)
else:
upgrade(module, use, params['extra_args'], params['aur_only'], params['update_cache'])
upgrade(module, use, params['extra_args'], params['aur_only'])
else:
if module.check_mode:
check_packages(module, params['name'])
@ -397,8 +385,7 @@ def apply_module(module, use):
params['skip_pgp_check'],
params['ignore_arch'],
params['aur_only'],
params['local_pkgbuild'],
params['update_cache'])
params['local_pkgbuild'])
def main():