Adding yay AUR manager to Arch Linux's commands since yaourt is unmaintained and has some security issues. (#907)

This commit is contained in:
Jesus Cuesta
2019-05-21 18:49:04 +00:00
committed by Vladimir Iakovlev
parent 78ef9eec88
commit 201c01fc74
4 changed files with 12 additions and 6 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
""" Fixes wrong package names with pacman or yaourt.
For example the `llc` program is in package `llvm` so this:
yaourt -S llc
yay -S llc
should be:
yaourt -S llvm
yay -S llvm
"""
from thefuck.utils import replace_command
@@ -12,7 +12,7 @@ from thefuck.specific.archlinux import get_pkgfile, archlinux_env
def match(command):
return (command.script_parts
and (command.script_parts[0] in ('pacman', 'yaourt')
and (command.script_parts[0] in ('pacman', 'yay', 'yaourt')
or command.script_parts[0:2] == ['sudo', 'pacman'])
and 'error: target not found:' in command.output)
+3 -1
View File
@@ -32,7 +32,9 @@ def get_pkgfile(command):
def archlinux_env():
if utils.which('yaourt'):
if utils.which('yay'):
pacman = 'yay'
elif utils.which('yaourt'):
pacman = 'yaourt'
elif utils.which('pacman'):
pacman = 'sudo pacman'