summaryrefslogtreecommitdiff
path: root/.zsh/zshfunctions
diff options
context:
space:
mode:
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
+}