3186b65391fa298e0e8941fe572ca1f275ad998d

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

Merge pull request #5335 from mcornella/cleanup-archlinux-plugin

Clean up Archlinux plugin

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
  2index 67595f9e9369268401856ac6a256a48d592a395b..785538a564e9a7eab20f391eb49741d51a48ad7d 100644
  3--- a/plugins/archlinux/README.md
  4+++ b/plugins/archlinux/README.md
  5@@ -1,64 +1,69 @@
  6-## ARCHLINUX PLUGIN
  7+# Archlinux plugin
  8 
  9+## Features
 10 
 11----
 12+#### YAOURT
 13+
 14+| Alias   | Command                            | Description                                                         |
 15+|---------|------------------------------------|---------------------------------------------------------------------|
 16+| yaconf  | yaourt -C                          | Fix all configuration files with vimdiff                            |
 17+| yain    | yaourt -S                          | Install packages from the repositories                              |
 18+| yains   | yaourt -U                          | Install a package from a local file                                 |
 19+| yainsd  | yaourt -S --asdeps                 | Install packages as dependencies of another package                 |
 20+| yaloc   | yaourt -Qi                         | Display information about a package in the local database           |
 21+| yalocs  | yaourt -Qs                         | Search for packages in the local database                           |
 22+| yalst   | yaourt -Qe                         | List installed packages including from AUR (tagged as "local")      |
 23+| yamir   | yaourt -Syy                        | Force refresh of all package lists after updating mirrorlist        |
 24+| yaorph  | yaourt -Qtd                        | Remove orphans using yaourt                                         |
 25+| yare    | yaourt -R                          | Remove packages, keeping its settings and dependencies              |
 26+| yarem   | yaourt -Rns                        | Remove packages, including its settings and unneeded dependencies   |
 27+| yarep   | yaourt -Si                         | Display information about a package in the repositories             |
 28+| yareps  | yaourt -Ss                         | Search for packages in the repositories                             |
 29+| yaupd   | yaourt -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases             |
 30+| yaupd   | yaourt -Sy && sudo abs             | Update and refresh the local package and ABS databases              |
 31+| yaupd   | yaourt -Sy && sudo aur             | Update and refresh the local package and AUR databases              |
 32+| yaupd   | yaourt -Sy                         | Update and refresh the local package database                       |
 33+| yaupg   | yaourt -Syua                       | Sync with repositories before upgrading all packages (from AUR too) |
 34+| yasu    | yaourt -Syua --no-confirm          | Same as `yaupg`, but without confirmation                           |
 35+| upgrade | yaourt -Syu                        | Sync with repositories before upgrading packages                    |
 36 
 37-### FEATURES
 38+#### PACMAN
 39 
 40-| Alias        | Function                                | Description                                                                                                         |
 41-|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
 42-| pacin        | sudo pacman -S                          | Install specific package(s) from the repositories                                                                   |
 43-| pacins       | sudo pacman -U                          | Install specific package not from the repositories but from a file                                                  |
 44-| pacinsd      | sudo pacman -S --asdeps                 | Install given package(s) as dependencies of another package                                                         |
 45-| pacloc       | pacman -Qi                              | Display information about a given package in the local database                                                     |
 46-| paclocs      | pacman -Qs                              | Search for package(s) in the local database                                                                         |
 47-| paclsorphans | sudo pacman -Qdt'                       | List all orphaned packages                                                                                          |
 48-| pacmir       | sudo pacman -Syy                        | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist                                          |
 49-| pacre        | sudo pacman -R                          | Remove the specified package(s), retaining its configuration(s) and required dependencies                           |
 50-| pacrem       | sudo pacman -Rns                        | Remove the specified package(s), its configuration(s) and unneeded dependencies                                     |
 51-| pacrep       | pacman -Si                              | Display information about a given package in the repositories                                                       |
 52-| pacreps      | pacman -Ss                              | Search for package(s) in the repositories                                                                           |
 53-| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)'        | Delete all orphaned packages                                                                                        |
 54-| pacupd       | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories                                    |
 55-| pacupd       | sudo pacman -Sy && sudo abs             | Update and refresh the local package and ABS databases against repositories                                         |
 56-| pacupd       | sudo pacman -Sy && sudo aur             | Update and refresh the local package and AUR databases against repositories                                         |
 57-| pacupd       | sudo pacman -Sy                         | Update and refresh the local package database against repositories                                                  |
 58-| pacupg       | sudo pacman -Syu                        | Synchronize with repositories before upgrading packages that are out of date on the local system.                   |
 59-| yaconf       | yaourt -C                               | Fix all configuration files with vimdiff                                                                            |
 60-| yain         | yaourt -S                               | Install specific package(s) from the repositories                                                                   |
 61-| yains        | yaourt -U                               | Install specific package not from the repositories but from a file                                                  |
 62-| yainsd       | yaourt -S --asdeps                      | Install given package(s) as dependencies of another package                                                         |
 63-| yaloc        | yaourt -Qi                              | Display information about a given package in the local database                                                     |
 64-| yalocs       | yaourt -Qs                              | Search for package(s) in the local database                                                                         |
 65-| yalst        | yaourt -Qe                              | List installed packages, even those installed from AUR (they're tagged as "local")                                  |
 66-| yamir        | yaourt -Syy                             | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist                                          |
 67-| yaorph       | yaourt -Qtd                             | Remove orphans using yaourt                                                                                         |
 68-| yare         | yaourt -R                               | Remove the specified package(s), retaining its configuration(s) and required dependencies                           |
 69-| yarem        | yaourt -Rns                             | Remove the specified package(s), its configuration(s) and unneeded dependencies                                     |
 70-| yarep        | yaourt -Si                              | Display information about a given package in the repositories                                                       |
 71-| yareps       | yaourt -Ss                              | Search for package(s) in the repositories                                                                           |
 72-| yasu         | yaourt -Syua --no-confirm               | Same as yaupg, but without confirmation                                                                             |
 73-| yaupd        | yaourt -Sy && sudo abs && sudo aur      | Update and refresh the local package, ABS and AUR databases against repositories                                    |
 74-| yaupd        | yaourt -Sy && sudo abs                  | Update and refresh the local package and ABS databases against repositories                                         |
 75-| yaupd        | yaourt -Sy && sudo aur                  | Update and refresh the local package and AUR databases against repositories                                         |
 76-| yaupd        | yaourt -Sy                              | Update and refresh the local package database against repositories                                                  |
 77-| yaupg        | yaourt -Syua                            | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system |
 78+| Alias        | Command                                 | Description                                                  |
 79+|--------------|-----------------------------------------|--------------------------------------------------------------|
 80+| pacin        | sudo pacman -S                          | Install packages from the repositories                       |
 81+| pacins       | sudo pacman -U                          | Install a package from a local file                          |
 82+| pacinsd      | sudo pacman -S --asdeps                 | Install packages as dependencies of another package          |
 83+| pacloc       | pacman -Qi                              | Display information about a package in the local database    |
 84+| paclocs      | pacman -Qs                              | Search for packages in the local database                    |
 85+| paclsorphans | sudo pacman -Qdt                        | List all orphaned packages                                   |
 86+| pacmir       | sudo pacman -Syy                        | Force refresh of all package lists after updating mirrorlist |
 87+| pacre        | sudo pacman -R                          | Remove packages, keeping its settings and dependencies       |
 88+| pacrem       | sudo pacman -Rns                        | Remove packages, including its settings and dependencies     |
 89+| pacrep       | pacman -Si                              | Display information about a package in the repositories      |
 90+| pacreps      | pacman -Ss                              | Search for packages in the repositories                      |
 91+| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)         | Delete all orphaned packages                                 |
 92+| pacupd       | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases  |
 93+| pacupd       | sudo pacman -Sy && sudo abs             | Update and refresh the local package and ABS databases       |
 94+| pacupd       | sudo pacman -Sy && sudo aur             | Update and refresh the local package and AUR databases       |
 95+| pacupd       | sudo pacman -Sy                         | Update and refresh the local package database                |
 96+| pacupg       | sudo pacman -Syu                        | Sync with repositories before upgrading packages             |
 97+| upgrade      | sudo pacman -Syu                        | Sync with repositories before upgrading packages             |
 98 
 99-| Function       | Description                                                                                                       |
100-|----------------|:------------------------------------------------------------------------------------------------------------------|
101-| pacdisowned    | List all disowned files in your system                                                                            |
102-| paclist        | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) |
103-| pacmanallkeys  | Get all keys for developers and trusted users                                                                     |
104-| pacmansignkeys |                                                                                                                   |
105diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
106index f6844328570cb1c5e69f057057f45ebb0b683b05..9c8c984b1b930a4a8a90d32393438531d00280a7 100644
107--- a/plugins/archlinux/archlinux.plugin.zsh
108+++ b/plugins/archlinux/archlinux.plugin.zsh
109@@ -1,75 +1,75 @@
110-# Archlinux zsh aliases and functions
111-# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
112-
113-# Look for yaourt, and add some useful functions if we have it.
114-if (( $+commands[yaourt] )); then
115+if ! (( $+commands[yaourt] )); then
116+  upgrade() {
117+    sudo pacman -Syu
118+  }
119+else
120   upgrade () {
121     yaourt -Syu
122   }
123-  alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
124-  # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
125-  alias yaupg='yaourt -Syua'        # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system.
126-  alias yasu='yaourt --Syua --no-confirm' # Same as yaupg, but without confirmation
127-  alias yain='yaourt -S'           # Install specific package(s) from the repositories
128-  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file
129-  alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
130-  alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
131-  alias yarep='yaourt -Si'         # Display information about a given package in the repositories
132-  alias yareps='yaourt -Ss'        # Search for package(s) in the repositories
133-  alias yaloc='yaourt -Qi'         # Display information about a given package in the local database
134-  alias yalocs='yaourt -Qs'        # Search for package(s) in the local database
135-  alias yalst='yaourt -Qe'         # List installed packages, even those installed from AUR (they're tagged as "local")
136-  alias yaorph='yaourt -Qtd'       # Remove orphans using yaourt
137-  # Additional yaourt alias examples
138+
139+  alias yaconf='yaourt -C'
140+  alias yaupg='yaourt -Syua'
141+  alias yasu='yaourt --Syua --no-confirm'
142+  alias yain='yaourt -S'
143+  alias yains='yaourt -U'
144+  alias yare='yaourt -R'
145+  alias yarem='yaourt -Rns'
146+  alias yarep='yaourt -Si'
147+  alias yareps='yaourt -Ss'
148+  alias yaloc='yaourt -Qi'
149+  alias yalocs='yaourt -Qs'
150+  alias yalst='yaourt -Qe'
151+  alias yaorph='yaourt -Qtd'
152+  alias yainsd='yaourt -S --asdeps'
153+  alias yamir='yaourt -Syy'
154+
155+
156   if (( $+commands[abs] && $+commands[aur] )); then
157-    alias yaupd='yaourt -Sy && sudo abs && sudo aur'  # Update and refresh the local package, ABS and AUR databases against repositories
158+    alias yaupd='yaourt -Sy && sudo abs && sudo aur'
159   elif (( $+commands[abs] )); then
160-    alias yaupd='yaourt -Sy && sudo abs'   # Update and refresh the local package and ABS databases against repositories
161+    alias yaupd='yaourt -Sy && sudo abs'
162   elif (( $+commands[aur] )); then
163-    alias yaupd='yaourt -Sy && sudo aur'   # Update and refresh the local package and AUR databases against repositories
164+    alias yaupd='yaourt -Sy && sudo aur'
165   else
166-    alias yaupd='yaourt -Sy'               # Update and refresh the local package database against repositories
167+    alias yaupd='yaourt -Sy'
168   fi
169-  alias yainsd='yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
170-  alias yamir='yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
171-else
172- upgrade() {
173-   sudo pacman -Syu
174- }
175 fi
176 
177 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
178-alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
179-alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
180-alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file
181-alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
182-alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
183-alias pacrep='pacman -Si'              # Display information about a given package in the repositories
184-alias pacreps='pacman -Ss'             # Search for package(s) in the repositories
185-alias pacloc='pacman -Qi'              # Display information about a given package in the local database
186-alias paclocs='pacman -Qs'             # Search for package(s) in the local database
187-# Additional pacman alias examples
188+alias pacupg='sudo pacman -Syu'
189+alias pacin='sudo pacman -S'
190+alias pacins='sudo pacman -U'
191+alias pacre='sudo pacman -R'
192+alias pacrem='sudo pacman -Rns'
193+alias pacrep='pacman -Si'
194+alias pacreps='pacman -Ss'
195+alias pacloc='pacman -Qi'
196+alias paclocs='pacman -Qs'
197+alias pacinsd='sudo pacman -S --asdeps'
198+alias pacmir='sudo pacman -Syy'
199+alias paclsorphans='sudo pacman -Qdt'
200+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
201+
202+
203 if (( $+commands[abs] && $+commands[aur] )); then
204-  alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'  # Update and refresh the local package, ABS and AUR databases against repositories
205+  alias pacupd='sudo pacman -Sy && sudo abs && sudo aur'
206 elif (( $+commands[abs] )); then
207-  alias pacupd='sudo pacman -Sy && sudo abs'              # Update and refresh the local package and ABS databases against repositories
208+  alias pacupd='sudo pacman -Sy && sudo abs'