From 1f1d4a29e21efb1011a4670c4225800f6907719d Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 29 Oct 2013 01:48:13 +0300 Subject: [PATCH] Update debian.plugin.zsh Added aar alias - to add repository (add-apt-repository) Added apt-fast utility support - it's built on top of aptitude and gives faster downloading capabilities. --- plugins/debian/debian.plugin.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index b51d0cd37..e984d69a4 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -1,11 +1,14 @@ # Authors: # https://github.com/AlexBio # https://github.com/dbb +# https://github.com/asm0dey # # Debian-related zsh aliases and functions for zsh -# Use aptitude if installed, or apt-get if not. +# Use apt-fast if installed, if not - aptitude, if not too - apt-get. # You can just set apt_pref='apt-get' to override it. +if [[ -e $( which -p apt-fast 2>&1 ) ]]; then + apt_pref='apt-fast' if [[ -e $( which -p aptitude 2>&1 ) ]]; then apt_pref='aptitude' else @@ -67,7 +70,7 @@ if [[ $use_sudo -eq 1 ]]; then # Remove ALL kernel images and headers EXCEPT the one in use alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ ?not(~n`uname -r`))' - + alias aar='sudo add-apt-repository -y' # commands using su ######### else @@ -83,6 +86,11 @@ else alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root' alias afu='su -lc "apt-file update"' alias ag='su -lc \'$apt_pref safe-upgrade\' root' + alias aar(){ + cmd="su -lc 'add-apt-repository -y $@' root" + print "$cmd" + eval "$cmd" + } ai() { cmd="su -lc 'aptitude -P install $@' root" print "$cmd"