Adding yay AUR manager to Arch Linux's commands since yaourt is unmaintained and has some security issues. (#907)
This commit is contained in:
committed by
Vladimir Iakovlev
parent
78ef9eec88
commit
201c01fc74
@@ -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)
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user