From e32a96be72a2a6708c90e91f17036cfbc3ef270d Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Wed, 24 Jan 2018 13:47:20 -0800 Subject: [PATCH] pacman: Simplify support for AUR helpers There are a number of things happening here. - Extra support for yaourt has been removed - Docs have been updated to explicitly call out that AUR helpers are not officially supported - aurutils has been suggested to make common operations easier - A utility function called aurget (similar to aurfetch from aurutils) has been added to make cloning AUR repos easier. Fixes #1531 --- modules/pacman/README.md | 40 ++++++++++++++++----------------------- modules/pacman/init.zsh | 12 ++++++++---- modules/pacman/yaourt.zsh | 18 ------------------ 3 files changed, 24 insertions(+), 46 deletions(-) delete mode 100644 modules/pacman/yaourt.zsh diff --git a/modules/pacman/README.md b/modules/pacman/README.md index 855c8ef..86929b4 100644 --- a/modules/pacman/README.md +++ b/modules/pacman/README.md @@ -8,23 +8,20 @@ Settings -------- It is possible to use a Pacman frontend with the pacman aliases provided by this -package as long as that frontend supports the same command line options (Such as -[Pacaur][2] or [Yaourt][3]). +package as long as that frontend supports the same command line options (The +[AUR Helpers][2] page has a good comparison which lists if the command line +options are pacman compatible). -To enable a Pacman frontend, for example, [Pacaur][2], add the following line to -*zpreztorc*: +Please note that installing packages with an AUR Helper is not officially +supported by Archlinux. It is currently recommended to manually build AUR +packages using the [provided instructions][3]. The [aurtools][4] project has a +set of small utilities to make this easier. -```sh -zstyle ':prezto:module:pacman' frontend 'pacaur' -``` - -If you have enabled color globally in *zpreztorc*, you may disable it for certain -commands. - -To disable `yaourt` highlighting, add the following line to *zpreztorc*: +To enable a Pacman frontend, add the following line to *zpreztorc*, substituting +`pacman_frontend` with the name of the frontent: ```sh -zstyle ':prezto:module:pacman:yaourt' color 'no' +zstyle ':prezto:module:pacman' frontend 'pacman_frontend' ``` Aliases @@ -50,28 +47,23 @@ Aliases ### Frontends -#### Yaourt - -Note that there are currently potential security concerns relating to yaourt, so -other frontends are recommended. - - - `pacc` manages *.pac\** files. - Functions --------- + - `aurget` clone an aur package - `pacman-list-explicit` lists explicitly installed pacman packages. - `pacman-list-disowned` lists pacman disowned files. Authors ------- -*The authors of this module should be contacted via the [issue tracker][4].* +*The authors of this module should be contacted via the [issue tracker][5].* - [Benjamin Boudreau](https://github.com/dreur) - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: http://www.archlinux.org/pacman/ -[2]: https://github.com/rmarquis/pacaur -[3]: http://archlinux.fr/yaourt-en -[4]: https://github.com/sorin-ionescu/prezto/issues +[2]: https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table +[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages +[4]: https://github.com/AladW/aurutils +[5]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/pacman/init.zsh b/modules/pacman/init.zsh index a5cacf2..88c977f 100644 --- a/modules/pacman/init.zsh +++ b/modules/pacman/init.zsh @@ -23,10 +23,6 @@ zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend' if (( $+commands[$_pacman_frontend] )); then alias pacman="$_pacman_frontend" - - if [[ -s "${0:h}/${_pacman_frontend}.zsh" ]]; then - source "${0:h}/${_pacman_frontend}.zsh" - fi else _pacman_frontend='pacman' _pacman_sudo='sudo ' @@ -81,4 +77,12 @@ fi # upgrades outdated packages. alias pacU="${_pacman_sudo}${_pacman_frontend} --sync --refresh --sysupgrade" +function aurget { + local target_dir="$1" + if [[ -n "$2" ]]; then + target_dir="$2" + fi + git clone "https://aur.archlinux.org/$1" "$target_dir" +} + unset _pacman_{frontend,sudo} diff --git a/modules/pacman/yaourt.zsh b/modules/pacman/yaourt.zsh deleted file mode 100644 index 819fad1..0000000 --- a/modules/pacman/yaourt.zsh +++ /dev/null @@ -1,18 +0,0 @@ -# -# Defines Yaourt aliases. -# -# Authors: -# Sorin Ionescu -# - -# -# Aliases -# - -# Disable color. -if ! zstyle -t ':prezto:module:pacman:yaourt' color; then - alias pacman='yaourt --nocolor' -fi - -# Manages .pac* files. -alias pacc='yaourt -C'