summaryrefslogtreecommitdiff
path: root/.zsh/zshfunctions
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 00:32:25 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 00:32:26 +0100
commit426ba41e2560dfd75fd0017e61a38f4b7b89f4ae (patch)
tree8bcc9429064c564c68c48ccd01a639b127b31e3f /.zsh/zshfunctions
parent5388861c8edf45bbe1fd2fdedd19f73ba210daa0 (diff)
downloaddotfiles-426ba41e2560dfd75fd0017e61a38f4b7b89f4ae.tar.gz
dotfiles-426ba41e2560dfd75fd0017e61a38f4b7b89f4ae.tar.bz2
dotfiles-426ba41e2560dfd75fd0017e61a38f4b7b89f4ae.zip
Make 'unpack' use open_ebuild
Diffstat (limited to '.zsh/zshfunctions')
-rw-r--r--.zsh/zshfunctions42
1 files changed, 22 insertions, 20 deletions
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
+}