2011-08-30 23:16:15 -04:00
|
|
|
#
|
2012-06-30 17:29:30 -04:00
|
|
|
# Defines Pacman aliases.
|
2012-01-31 23:37:51 -05:00
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Benjamin Boudreau <dreurmail@gmail.com>
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
# Tips:
|
2011-08-30 23:16:15 -04:00
|
|
|
# https://wiki.archlinux.org/index.php/Pacman_Tips
|
2012-01-31 23:37:51 -05:00
|
|
|
#
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-07-23 15:00:44 -04:00
|
|
|
# Return if requirements are not found.
|
|
|
|
if (( ! $+commands[pacman] )); then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2012-08-04 14:48:32 -04:00
|
|
|
#
|
|
|
|
# Frontend
|
|
|
|
#
|
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Get the Pacman frontend.
|
2012-09-03 16:08:39 -04:00
|
|
|
zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
if (( $+commands[$_pacman_frontend] )); then
|
|
|
|
alias pacman="$_pacman_frontend"
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
if [[ -s "${0:h}/${_pacman_frontend}.zsh" ]]; then
|
|
|
|
source "${0:h}/${_pacman_frontend}.zsh"
|
2011-08-30 23:16:15 -04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-08-04 14:48:32 -04:00
|
|
|
#
|
2012-07-03 13:58:32 -04:00
|
|
|
# Aliases
|
2012-08-04 14:48:32 -04:00
|
|
|
#
|
2012-07-03 13:58:32 -04:00
|
|
|
|
2012-08-15 07:59:25 -04:00
|
|
|
# Pacman.
|
|
|
|
alias pac='pacman'
|
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Installs packages from repositories.
|
|
|
|
alias paci='sudo pacman --sync'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Installs packages from files.
|
|
|
|
alias pacI='sudo pacman --upgrade'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Removes packages and unneeded dependencies.
|
|
|
|
alias pacx='sudo pacman --remove'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Removes packages, their configuration, and unneeded dependencies.
|
|
|
|
alias pacX='sudo pacman --remove --nosave --recursive'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-07-03 13:58:32 -04:00
|
|
|
# Displays information about a package from the repositories.
|
2012-06-30 17:29:30 -04:00
|
|
|
alias pacq='pacman --sync --info'
|
2011-10-11 23:13:58 -04:00
|
|
|
|
2012-07-03 13:58:32 -04:00
|
|
|
# Displays information about a package from the local database.
|
2012-06-30 17:29:30 -04:00
|
|
|
alias pacQ='pacman --query --info'
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Searches for packages in the repositories.
|
|
|
|
alias pacs='pacman --sync --recursive'
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Searches for packages in the local database.
|
|
|
|
alias pacS='pacman --query --recursive'
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Lists orphan packages.
|
|
|
|
alias pacman-list-orphans='sudo pacman --query --deps --unrequired'
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Removes orphan packages.
|
|
|
|
alias pacman-remove-orphans='sudo pacman --remove --recursive $(pacman --quiet --query --deps --unrequired)'
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Synchronizes the local package and Arch Build System databases against the
|
|
|
|
# repositories.
|
2011-10-11 23:13:58 -04:00
|
|
|
if (( $+commands[abs] )); then
|
2012-06-30 17:29:30 -04:00
|
|
|
alias pacu='sudo pacman --sync --refresh && sudo abs'
|
2011-10-11 23:13:58 -04:00
|
|
|
else
|
2012-06-30 17:29:30 -04:00
|
|
|
alias pacu='sudo pacman --sync --refresh'
|
2011-10-11 23:13:58 -04:00
|
|
|
fi
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2012-06-30 17:29:30 -04:00
|
|
|
# Synchronizes the local package database against the repositories then
|
|
|
|
# upgrades outdated packages.
|
|
|
|
alias pacU='sudo pacman --sync --refresh --sysupgrade'
|
|
|
|
|
|
|
|
unset _pacman_frontend
|
|
|
|
|