summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2013-06-25 19:00:34 +0000
committerTim Harder <radhermit@gentoo.org>2013-06-25 19:00:34 +0000
commitf99ffcdd70c36b9853b7f042ef41158c7d138d30 (patch)
treeba282c2cc721353e4f122ca53270bcd0d6ea7e80 /app-shells/zsh/files
parentBlock newer clang/llvm versions (bug #450380). (diff)
downloadhistorical-f99ffcdd70c36b9853b7f042ef41158c7d138d30.tar.gz
historical-f99ffcdd70c36b9853b7f042ef41158c7d138d30.tar.bz2
historical-f99ffcdd70c36b9853b7f042ef41158c7d138d30.zip
Revbump, install system zshenv file instead of zprofile (bug #19924) and use local variables for gentoo prompt script (bug #453584, patch by Marckus J).
Package-Manager: portage-2.2.0_alpha185/cvs/Linux x86_64 Manifest-Sign-Key: 0x4AB3E85B4F064CA3
Diffstat (limited to 'app-shells/zsh/files')
-rw-r--r--app-shells/zsh/files/prompt_gentoo_setup-120
-rw-r--r--app-shells/zsh/files/zshenv-142
2 files changed, 52 insertions, 10 deletions
diff --git a/app-shells/zsh/files/prompt_gentoo_setup-1 b/app-shells/zsh/files/prompt_gentoo_setup-1
index 0d071e9864be..046e2d87f53a 100644
--- a/app-shells/zsh/files/prompt_gentoo_setup-1
+++ b/app-shells/zsh/files/prompt_gentoo_setup-1
@@ -10,24 +10,24 @@ EOF
}
prompt_gentoo_setup () {
- prompt_gentoo_prompt=${1:-'blue'}
- prompt_gentoo_user=${2:-'green'}
- prompt_gentoo_root=${3:-'red'}
+ local prompt_gentoo_prompt=${1:-'blue'}
+ local prompt_gentoo_user=${2:-'green'}
+ local prompt_gentoo_root=${3:-'red'}
if [ "$USER" = 'root' ]
then
- base_prompt="%B%F{$prompt_gentoo_root}%m%k "
+ local base_prompt="%B%F{$prompt_gentoo_root}%m%k "
else
- base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k "
+ local base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k "
fi
- post_prompt="%b%f%k"
+ local post_prompt="%b%f%k"
#setopt noxtrace localoptions
- path_prompt="%B%F{$prompt_gentoo_prompt}%1~"
- PS1="$base_prompt$path_prompt %# $post_prompt"
- PS2="$base_prompt$path_prompt %_> $post_prompt"
- PS3="$base_prompt$path_prompt ?# $post_prompt"
+ local path_prompt="%B%F{$prompt_gentoo_prompt}%1~"
+ typeset -g PS1="$base_prompt$path_prompt %# $post_prompt"
+ typeset -g PS2="$base_prompt$path_prompt %_> $post_prompt"
+ typeset -g PS3="$base_prompt$path_prompt ?# $post_prompt"
}
prompt_gentoo_setup "$@"
diff --git a/app-shells/zsh/files/zshenv-1 b/app-shells/zsh/files/zshenv-1
new file mode 100644
index 000000000000..8bafafeed859
--- /dev/null
+++ b/app-shells/zsh/files/zshenv-1
@@ -0,0 +1,42 @@
+# @GENTOO_PORTAGE_EPREFIX@/etc/zsh/zshenv
+
+# Load environment settings from profile.env, which is created by
+# env-update from the files in /etc/env.d
+if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then
+ . "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env
+fi
+
+# You should override these in your ~/.zprofile (or equivalent) for per-user
+# settings. For system defaults, you can add a new file in /etc/profile.d/.
+export EDITOR=${EDITOR:-/bin/nano}
+export PAGER=${PAGER:-/usr/bin/less}
+
+# 077 would be more secure, but 022 is generally quite realistic
+umask 022
+
+# Set up PATH depending on whether we're root or a normal user.
+# There's no real reason to exclude sbin paths from the normal user,
+# but it can make tab-completion easier when they aren't in the
+# user's PATH to pollute the executable namespace.
+#
+# It is intentional in the following line to use || instead of -o.
+# This way the evaluation can be short-circuited and calling whoami is
+# avoided.
+if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
+ @ZSH_NOPREFIX@PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
+ @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin"
+else
+ @ZSH_NOPREFIX@PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
+ @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin"
+fi
+export PATH
+unset ROOTPATH
+
+shopts=$-
+setopt nullglob
+for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do
+ [ -r "$sh" ] && . "$sh"
+done
+unsetopt nullglob
+set -$shopts
+unset sh shopts