From 485dd2b73671c257571601dda44e5fd94067271f Mon Sep 17 00:00:00 2001 From: Moses Miller Date: Mon, 26 Sep 2016 23:17:18 -0700 Subject: [PATCH] Add pacaur compatibility to archlinux plugin + refactor --- plugins/archlinux/archlinux.plugin.zsh | 51 +++++++++++++++++++++----- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 1637e8561..2e55d1b8d 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,12 +1,4 @@ -if ! (( $+commands[yaourt] )); then - upgrade() { - sudo pacman -Syu - } -else - upgrade () { - yaourt -Syu - } - +if (( $+commands[yaourt] )); then alias yaconf='yaourt -C' alias yaupg='yaourt -Syua' alias yasu='yaourt -Syua --noconfirm' @@ -35,6 +27,47 @@ else fi fi +if (( $+commands[pacaur] )); then + alias paupg='pacaur -Syua' + alias pasu='pacaur -Syua --noconfirm' + alias pain='pacaur -S' + alias pains='pacaur -U' + alias pare='pacaur -R' + alias parem='pacaur -Rns' + alias parep='pacaur -Si' + alias pareps='pacaur -Ss' + alias paloc='pacaur -Qi' + alias palocs='pacaur -Qs' + alias palst='pacaur -Qe' + alias paorph='pacaur -Qtd' + alias painsd='pacaur -S --asdeps' + alias pamir='pacaur -Syy' + + if (( $+commands[abs] && $+commands[aur] )); then + alias paupd='pacaur -Sy && sudo abs && sudo aur' + elif (( $+commands[abs] )); then + alias paupd='pacaur -Sy && sudo abs' + elif (( $+commands[aur] )); then + alias paupd='pacaur -Sy && sudo aur' + else + alias paupd='pacaur -Sy' + fi +fi + +if (( $+commands[pacaur] )); then + upgrade() { + pacaur -Syu + } +elif (( $+commands[yaourt] )); then + upgrade() { + yaourt -Syu + } +else + upgrade() { + pacman -Syu + } +fi + # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias pacupg='sudo pacman -Syu' alias pacin='sudo pacman -S'