Add support for the aura helper

pull/74/head
William Turner 2022-06-09 02:10:25 -04:00
parent 9b25b11cea
commit 865e69b43d
2 changed files with 18 additions and 13 deletions

View File

@ -56,6 +56,7 @@ The following helpers are supported and automatically selected, if present, in t
- [pacaur](https://github.com/E5ten/pacaur)
- [trizen](https://github.com/trizen/trizen)
- [pikaur](https://github.com/actionless/pikaur)
- [aura](https://github.com/fosskers/aura)
- [aurman](https://github.com/polygamma/aurman) (discontinued)
*makepkg* will be used if no helper was found or if it is explicitly specified:
@ -70,12 +71,12 @@ The following helpers are supported and automatically selected, if present, in t
| 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. |
| use | **auto**, yay, paru, pacaur, trizen, pikaur, aura, 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. |
| aur_only | yes, **no** | Limit helper operation to the AUR. Ignored with the aura helper, AUR is always used. |
| local_pkgbuild | Local directory with PKGBUILD, **null** | Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files. |
| skip_pgp_check | yes, **no** | Only valid with makepkg. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured. |
| ignore_arch | yes, **no** | Only valid with makepkg. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. |
| skip_pgp_check | yes, **no** | Only valid with makepkg or aura. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured. |
| ignore_arch | yes, **no** | Only valid with makepkg or aura. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. |
#### Note
@ -91,6 +92,8 @@ The following helpers are supported and automatically selected, if present, in t
#### Create the "aur_builder" user
This is not needed if the aura helper is used since it must run as root.
While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*.
This user can be created in an Ansible task with the following actions:

View File

@ -49,7 +49,7 @@ options:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ]
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aura, aurman, makepkg ]
extra_args:
description:
@ -59,24 +59,25 @@ options:
skip_pgp_check:
description:
- Only valid with makepkg.
- Only valid with makepkg and aura.
Skip PGP signatures verification of source file.
This is useful when installing packages without GnuPG (properly) configured.
Cannot be used unless use is set to 'makepkg'.
Cannot be used unless use is set to 'makepkg' or 'aura'.
type: bool
default: no
ignore_arch:
description:
- Only valid with makepkg.
- Only valid with makepkg and aura.
Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.
Cannot be used unless use is set to 'makepkg'.
Cannot be used unless use is set to 'makepkg' or 'aura'.
type: bool
default: no
aur_only:
description:
- Limit helper operation to the AUR.
Ignored with the aura helper, AUR is always used.
type: bool
default: no
@ -114,6 +115,7 @@ use_cmd = {
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
'aura': ['aura', '-A', '--noconfirm', '--needed', '--clean', '--delmakedeps'],
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
@ -283,7 +285,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
command.append(package)
rc, out, err = module.run_command(command, check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower())
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower() or 'no valid package' in out.lower())
message = 'installed package(s)' if changed_iter else 'package(s) already installed'
@ -359,10 +361,10 @@ def make_module():
use = k
break
if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg'.")
if use not in ('makepkg', 'aura') and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg' and 'aura'.")
if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']:
if use not in use_cmd_local_pkgbuild and params['local_pkgbuild']:
module.fail_json(msg="This option is not available with '%s'" % use)
if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']):