3350c2298f6e0b629c8efe9821262a093f975fd3

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #488 from dreur/upstream-archlinux-plugin

Remove sudo when using yaourt + do not rely on abs when not in path - In 

Diff

 1diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 2index 8ed291fcf04b6d1a2f250de810a58cc2d8783cde..b5e519036229b856c7a92854130d7fccaf848957 100644
 3--- a/plugins/archlinux/archlinux.plugin.zsh
 4+++ b/plugins/archlinux/archlinux.plugin.zsh
 5@@ -1,26 +1,30 @@
 6-# Archlinux zsh aliases and functions for zsh
 7-
 8-# Aliases ###################################################################
 9+# Archlinux zsh aliases and functions
10+# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
11 
12 # Look for yaourt, and add some useful functions if we have it.
13 if [[ -x `which yaourt` ]]; then
14   upgrade () {
15-    yaourt -Syu -C
16+    yaourt -Syu
17   }
18+  alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
19   # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
20-  alias yaupg='sudo yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
21-  alias yain='sudo yaourt -S'           # Install specific package(s) from the repositories
22-  alias yains='sudo yaourt -U'          # Install specific package not from the repositories but from a file 
23-  alias yare='sudo yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
24-  alias yarem='sudo yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
25-  alias yarep='yaourt -Si'              # Display information about a given package in the repositories
26-  alias yareps='yaourt -Ss'             # Search for package(s) in the repositories
27-  alias yaloc='yaourt -Qi'              # Display information about a given package in the local database
28-  alias yalocs='yaourt -Qs'             # Search for package(s) in the local database
29+  alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
30+  alias yain='yaourt -S'           # Install specific package(s) from the repositories
31+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
32+  alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
33+  alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
34+  alias yarep='yaourt -Si'         # Display information about a given package in the repositories
35+  alias yareps='yaourt -Ss'        # Search for package(s) in the repositories
36+  alias yaloc='yaourt -Qi'         # Display information about a given package in the local database
37+  alias yalocs='yaourt -Qs'        # Search for package(s) in the local database
38   # Additional yaourt alias examples
39-  alias yaupd='sudo yaourt -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
40-  alias yainsd='sudo yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
41-  alias yamir='sudo yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
42+  if [[ -x `which abs` ]]; then
43+    alias yaupd='yaourt -Sy && sudo abs'   # Update and refresh the local package and ABS databases against repositories
44+  else
45+    alias yaupd='yaourt -Sy'               # Update and refresh the local package and ABS databases against repositories
46+  fi
47+  alias yainsd='yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
48+  alias yamir='yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
49 else
50  upgrade() {
51    sudo pacman -Syu
52@@ -38,7 +42,11 @@ alias pacreps='pacman -Ss'             # Search for package(s) in the repositori
53 alias pacloc='pacman -Qi'              # Display information about a given package in the local database
54 alias paclocs='pacman -Qs'             # Search for package(s) in the local database
55 # Additional pacman alias examples
56-alias pacupd='sudo pacman -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
57+if [[ -x `which abs` ]]; then
58+  alias pacupd='sudo pacman -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
59+else
60+  alias pacupd='sudo pacman -Sy'     # Update and refresh the local package and ABS databases against repositories
61+fi
62 alias pacinsd='sudo pacman -S --asdeps'        # Install given package(s) as dependencies of another package
63 alias pacmir='sudo pacman -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
64