Browse code

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

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

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