From 426ba41e2560dfd75fd0017e61a38f4b7b89f4ae Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 24 Mar 2011 00:32:25 +0100 Subject: Make 'unpack' use open_ebuild --- .zsh/zshfunctions | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to '.zsh/zshfunctions') diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index bd4a911..d0a5a64 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -11,12 +11,23 @@ _cdu () cd $(dirname $1) } +# unpacks a specific package +_unpack () +{ + ebuild $1 clean unpack +} + # Open the ebuild with a specified command open_ebuild () { local ebuild sel local -a elist + if [[ $# -lt 2 ]]; then + echo "No package name given." + return 4 + fi + ebuild="$(equery w $2 2>&1 )" if [[ $? -ne 0 ]]; then if [[ $ebuild == *"Ambiguous"* ]]; then @@ -154,7 +165,7 @@ menc() # based on a script by mv list_cc_flags() { - Usage() + Usage () { printf '%s\n' "Usage: ${0##*/} c|o [gcc-Flags e.g. -march=native -O2] Show which compile|optimization flags are selected when you chose gcc-Flags" @@ -175,22 +186,13 @@ PROG esac } -if [[ $UID == 0 ]]; then - - # unpack a package - unpack() - { - ebuild $(equery w -m $1) clean unpack - } - - # set job count to 1 if there is only one package to install - emerge() - { - local e=$(whence -p emerge) - if [[ $# < 3 ]]; then - $e --jobs=1 $@ - else - $e $@ - fi - } -fi +# set job count to 1 if there is only one package to install +emerge() +{ + local e=$(whence -p emerge) + if [[ $# < 3 ]]; then + $e --jobs=1 $@ + else + $e $@ + fi +} -- cgit v1.2.3-54-g00ecf