Refactor Pacman aliases

This commit is contained in:
Sorin Ionescu 2012-06-30 17:29:30 -04:00
parent d54211832a
commit fc06e0b125
2 changed files with 52 additions and 81 deletions

View File

@ -1,5 +1,5 @@
# #
# Defines pacman aliases. # Defines Pacman aliases.
# #
# Authors: # Authors:
# Benjamin Boudreau <dreurmail@gmail.com> # Benjamin Boudreau <dreurmail@gmail.com>
@ -9,102 +9,58 @@
# https://wiki.archlinux.org/index.php/Pacman_Tips # https://wiki.archlinux.org/index.php/Pacman_Tips
# #
# Yaourt Aliases # Get the Pacman frontend.
if (( $+commands[yaourt] )); then zstyle -s ':omz:module:pacman' frontend '_pacman_frontend'
# Upgrade Arch Linux.
alias arch-upgrade='yaourt -Syu'
# Fix all configuration files with vimdiff. if (( $+commands[$_pacman_frontend] )); then
alias yaconf='yaourt -C' alias pacman="$_pacman_frontend"
# Synchronize with repositories before upgrading packages that are out of date on the local system. if [[ -s "${0:h}/${_pacman_frontend}.zsh" ]]; then
alias yaupg='yaourt -Syu' source "${0:h}/${_pacman_frontend}.zsh"
fi
fi
# Install specific package(s) from the repositories. # Installs packages from repositories.
alias yain='yaourt -S' alias paci='sudo pacman --sync'
# Install specific package(s) not from the repositories but from a file . # Installs packages from files.
alias yains='yaourt -U' alias pacI='sudo pacman --upgrade'
# Remove the specified package(s), retaining its configuration(s) and required dependencies. # Removes packages and unneeded dependencies.
alias yare='yaourt -R' alias pacx='sudo pacman --remove'
# Remove the specified package(s), its configuration(s) and unneeded dependencies. # Removes packages, their configuration, and unneeded dependencies.
alias yarem='yaourt -Rns' alias pacX='sudo pacman --remove --nosave --recursive'
# Display information about a given package in the repositories. # Displays information about a given package in the repositories.
alias yarep='yaourt -Si' alias pacq='pacman --sync --info'
# Search for package(s) in the repositories. # Displays information about a given package in the local database.
alias yareps='yaourt -Ss' alias pacQ='pacman --query --info'
# Display information about a given package in the local database. # Searches for packages in the repositories.
alias yaloc='yaourt -Qi' alias pacs='pacman --sync --recursive'
# Search for package(s) in the local database. # Searches for packages in the local database.
alias yalocs='yaourt -Qs' alias pacS='pacman --query --recursive'
# Force refresh of all package lists after updating /etc/pacman.d/mirrorlist # Lists orphan packages.
alias yamir='yaourt -Syy' alias pacman-list-orphans='sudo pacman --query --deps --unrequired'
# Install given package(s) as dependencies of another package # Removes orphan packages.
alias yainsd='yaourt -S --asdeps' alias pacman-remove-orphans='sudo pacman --remove --recursive $(pacman --quiet --query --deps --unrequired)'
# Update and refresh the local package and ABS databases against repositories. # Synchronizes the local package and Arch Build System databases against the
# repositories.
if (( $+commands[abs] )); then if (( $+commands[abs] )); then
alias yaupd='yaourt -Sy && sudo abs' alias pacu='sudo pacman --sync --refresh && sudo abs'
else else
alias yaupd='yaourt -Sy' alias pacu='sudo pacman --sync --refresh'
fi
else
# Upgrade Arch Linux.
alias arch-upgrade='sudo pacman -Syu'
fi fi
# Pacman Aliases # Synchronizes the local package database against the repositories then
# Synchronize with repositories before upgrading packages that are out of date on the local system. # upgrades outdated packages.
alias pacupg='sudo pacman -Syu' alias pacU='sudo pacman --sync --refresh --sysupgrade'
# Install specific package(s) from the repositories. unset _pacman_frontend
alias pacin='sudo pacman -S'
# Install specific package not from the repositories but from a file.
alias pacins='sudo pacman -U'
# Remove the specified package(s), retaining its configuration(s) and required dependencies.
alias pacre='sudo pacman -R'
# Remove the specified package(s), its configuration(s) and unneeded dependencies.
alias pacrem='sudo pacman -Rns'
# Display information about a given package in the repositories.
alias pacrep='pacman -Si'
# Search for package(s) in the repositories.
alias pacreps='pacman -Ss'
# Display information about a given package in the local database.
alias pacloc='pacman -Qi'
# Search for package(s) in the local database.
alias paclocs='pacman -Qs'
# Install given package(s) as dependencies of another package.
alias pacinsd='sudo pacman -S --asdeps'
# Force refresh of all package lists after updating /etc/pacman.d/mirrorlist.
alias pacmir='sudo pacman -Syy'
# List orphan packages(s).
alias paclsorphans='sudo pacman -Qdt'
# Remove orphan package(s).
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
# Update and refresh the local package and ABS databases against repositories.
if (( $+commands[abs] )); then
alias pacupd='sudo pacman -Sy && sudo abs'
else
alias pacupd='sudo pacman -Sy'
fi

15
modules/pacman/yaourt.zsh Normal file
View File

@ -0,0 +1,15 @@
#
# Defines Yaourt aliases.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Disable color.
if ! zstyle -t ':omz:module:pacman:yaourt' color; then
alias pacman='pacman --nocolor'
fi
# Manages .pac* files.
alias pacc='pacman -C'