change for aurman fixed

pull/4/head
kewl fft 2018-04-14 11:37:11 +01:00
parent 31d042edea
commit 9b9d2c15a5
1 changed files with 4 additions and 3 deletions

7
aur.py
View File

@ -12,6 +12,7 @@ import tempfile
def_lang = ['env', 'LC_ALL=C'] def_lang = ['env', 'LC_ALL=C']
use_cmd = { use_cmd = {
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--aur'],
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed', '--aur'], 'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed', '--aur'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed', '--aur'], 'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed', '--aur'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'], 'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
@ -54,7 +55,7 @@ def upgrade(module, use):
rc, out, err = module.run_command(def_lang + use_cmd[use] + ['-u'], check_rc=True) rc, out, err = module.run_command(def_lang + use_cmd[use] + ['-u'], check_rc=True)
module.exit_json( module.exit_json(
changed=not (out == '' or 'there is nothing to do' in out or 'No AUR updates found' in out), changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
msg='upgraded system', msg='upgraded system',
helper_used=use, helper_used=use,
) )
@ -74,7 +75,7 @@ def install_packages(module, packages, use, skip_installed):
rc, out, err = install_internal(module, package) rc, out, err = install_internal(module, package)
else: else:
rc, out, err = module.run_command(def_lang + use_cmd[use] + [package], check_rc=True) rc, out, err = module.run_command(def_lang + use_cmd[use] + [package], check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'there is nothing to do' in out) changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out)
module.exit_json( module.exit_json(
changed=changed_iter, changed=changed_iter,
@ -96,7 +97,7 @@ def main():
}, },
'use': { 'use': {
'default': 'auto', 'default': 'auto',
'choices': ['auto', 'pacaur', 'trizen', 'pikaur', 'yaourt', 'yay', 'internal'], 'choices': ['auto', 'aurman', 'pacaur', 'trizen', 'pikaur', 'yaourt', 'yay', 'internal'],
}, },
'skip_installed': { 'skip_installed': {
'default': 'no', 'default': 'no',