From 87e381feb31c30eeacd1196ec30c518a6ac59a1d Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 31 Jan 2008 14:41:15 +0000 Subject: [PATCH] - Tweak /etc/zshrc to source /etc/profile.d/*.sh in ksh compat. mode - Tweak /etc/zprofile to source /etc/profile in ksh compat. mode - Resolves: rhbz#430665 --- zprofile.rhs | 19 +++++++++++++++---- zsh.spec | 2 +- zshrc.rhs | 29 +++++++++++++++++------------ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/zprofile.rhs b/zprofile.rhs index 6eaf26d..03d316f 100644 --- a/zprofile.rhs +++ b/zprofile.rhs @@ -5,7 +5,18 @@ PATH="$PATH:$HOME/bin" export PATH -# source profile -if [ -f /etc/profile ]; then - source /etc/profile -fi +_src_etc_profile() +{ + # Make /etc/profile happier, and have possible ~/.zshenv options like + # NOMATCH ignored. + # + emulate -L ksh + + # source profile + if [ -f /etc/profile ]; then + source /etc/profile + fi +} +_src_etc_profile + +unset -f _src_etc_profile diff --git a/zsh.spec b/zsh.spec index 88d03d2..71b4bb5 100644 --- a/zsh.spec +++ b/zsh.spec @@ -3,7 +3,7 @@ Summary: A powerful interactive shell Name: zsh Version: 4.3.4 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD URL: http://zsh.sunsite.dk/ Group: System Environment/Shells diff --git a/zshrc.rhs b/zshrc.rhs index 8619a39..4dd1c77 100644 --- a/zshrc.rhs +++ b/zshrc.rhs @@ -15,19 +15,24 @@ PROMPT='[%n@%m]%~%# ' # default prompt # bindkey -e # emacs key bindings bindkey ' ' magic-space # also do history expansion on space +_src_etc_profile_d() { - # Make the *.sh things happier, and have possible ~/.zshenv options like - # NOMATCH ignored. - emulate -L ksh + # Make the *.sh things happier, and have possible ~/.zshenv options like + # NOMATCH ignored. + emulate -L ksh -# from bashrc, with zsh fixes -if [[ ! -o login ]]; then # We're not a login shell - for i in /etc/profile.d/*.sh; do - if [ -r "$i" ]; then - . $i - fi - done - unset i -fi + # from bashrc, with zsh fixes + if [[ ! -o login ]]; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + . $i + fi + done + unset i + fi } +_src_etc_profile_d + +unset -f _src_etc_profile_d +