From 6a869c5733bc298e1de85ea033fdd0183a35cd19 Mon Sep 17 00:00:00 2001 From: James Antill Date: Mar 22 2010 14:09:37 +0000 Subject: - Add pathmunge to our /etc/zshrc, for profile.d compat. - Resolves: bug#548960 --- diff --git a/zsh.spec b/zsh.spec index 4483458..0569377 100644 --- a/zsh.spec +++ b/zsh.spec @@ -3,7 +3,7 @@ Summary: A powerful interactive shell Name: zsh Version: 4.3.10 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD URL: http://zsh.sunsite.dk/ Group: System Environment/Shells @@ -175,6 +175,10 @@ fi %doc Doc/*.html %changelog +* Mon Mar 22 2010 James Antill - 4.3.10-5 +- Add pathmunge to our /etc/zshrc, for profile.d compat. +- Resolves: bug#548960 + * Fri Aug 7 2009 James Antill - 4.3.10-4 - Allow --excludedocs command to work! - Resolves: bug#515986 diff --git a/zshrc.rhs b/zshrc.rhs index 4dd1c77..5b3b92a 100644 --- a/zshrc.rhs +++ b/zshrc.rhs @@ -15,6 +15,18 @@ PROMPT='[%n@%m]%~%# ' # default prompt # bindkey -e # emacs key bindings bindkey ' ' magic-space # also do history expansion on space +# Provide pathmunge for /etc/profile.d scripts +pathmunge() +{ + if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)" ; then + if [ "$2" = "after" ] ; then + PATH=$PATH:$1 + else + PATH=$1:$PATH + fi + fi +} + _src_etc_profile_d() { # Make the *.sh things happier, and have possible ~/.zshenv options like @@ -34,5 +46,5 @@ _src_etc_profile_d() } _src_etc_profile_d -unset -f _src_etc_profile_d +unset -f pathmunge _src_etc_profile_d