1
0
Fork 0
mirror of synced 2024-11-16 04:55:35 -05:00
zimfw/modules/pacman/init.zsh

124 lines
2.3 KiB
Bash
Raw Normal View History

2015-12-15 00:12:17 -05:00
#
2015-12-20 20:41:54 -05:00
# Pacman aliases
#
# ${zpacman_frontend} is provided by either .zimrc or (if not set) init.zsh
# The zpacman_frontend is _only_ used for package installs.
#
# Setup
2015-12-15 00:12:17 -05:00
#
# ensure pacman is available
2015-12-19 09:48:29 -05:00
if (( ! ${+commands[pacman]} )); then
2015-12-15 00:12:17 -05:00
return 1
fi
2015-12-29 14:14:13 -05:00
if (( ! ${+zpacman_frontend} )); then
2015-12-15 23:09:36 -05:00
zpacman_frontend='pacman'
2015-12-19 09:48:29 -05:00
elif (( ! ${+commands[${zpacman_frontend}]} )); then
2015-12-29 14:14:13 -05:00
print "pacman frontend \"${zpacman_frontend}\" is invalid or not installed. Reverting to \"pacman\".
you can fix this error by editing the 'zpacman_frontend' variable in your .zimrc" >&2
2015-12-15 00:12:17 -05:00
zpacman_frontend='pacman'
fi
2015-12-20 20:41:54 -05:00
#
# General
#
alias pac=${zpacman_frontend}
#
# Build
#
# build package in current directory, cleanup, and install
alias pacb='makepkg -sci'
#
# Install
#
#NOTE: Installing/upgrading individual packages is NOT supported. Sync and upgrade ALL on install.
# install, sync, and upgrade packages
2015-12-29 14:14:13 -05:00
alias paci="sudo ${zpacman_frontend} -Syu"
2015-12-20 20:41:54 -05:00
# install, sync, and upgrade packages (forcibly refresh package lists)
2015-12-29 14:14:13 -05:00
alias pacu="sudo ${zpacman_frontend} -Syyu"
2015-12-20 20:41:54 -05:00
# install packages by filename
2015-12-29 14:14:13 -05:00
alias pacU="sudo ${zpacman_frontend} -U"
2015-12-20 20:41:54 -05:00
# install all packages in current directory
2015-12-29 14:14:13 -05:00
alias pacd="sudo ${zpacman_frontend} -U *.pkg.tar.xz"
2015-12-20 20:41:54 -05:00
#
# Remove
#
# remove package and unneeded dependencies
alias pacr='sudo pacman -R'
# remove package, unneeded dependencies, and configuration files
alias pacrm='sudo pacman -Rns'
#
# Query
#
# query package information from the remote repository
alias pacq='pacman -Si'
# query package information from the local repository
alias pacQ='pacman -Qi'
#
# Search
#
# search for package in the remote repository
alias pacs='pacman -Ss'
# search for the package in the local repository
alias pacS='pacman -Qs'
#
# Orphans
#
# list orphan packages
alias pacol='pacman -Qdt'
# remove orphan packages
alias pacor='sudo pacman -Rns $(pacman -Qtdq)'
#
# Ownership
#
# list all files that belong to a package
alias pacown='pacman -Ql'
# show package(s) owning the specified file
alias pacblame='pacman -Qo'
#
# Helpers
#
2015-12-15 00:12:17 -05:00
# source helper functions/aliases
for helper ( ${zpacman_helper[@]} ); do
if [[ -s ${0:h}/helper_${helper}.zsh ]]; then
source ${0:h}/helper_${helper}.zsh
else
print "no such helper script \"helper_${helper}.zsh\"" >&2
fi
done
2015-12-28 01:46:08 -05:00
unset helper