Hi,
In message <[EMAIL PROTECTED]>
on Sat, Mar 13, 2004 at 01:43:49AM -0500, Gary Kerbaugh wrote:
> The latest version of zsh breaks the append_path() and prepend_path()
> functions in the /sw/bin/init.sh script. They still add elements to
> the path but they always do it, even if there is duplication. This
> means that the elaborate "if" statements always evaluate to true.
I've been hoping to submit patches and packages that I've accumulated,
but have not yet found the time to revise them for latest versions of
Fink. However, this post caught my eye, so here is one contribution...
Since I use zsh as my default shell, I don't even bother with
/sw/bin/init.sh. Instead, I use a version that I wrote specifically
for zsh. I have attached a script that zsh users can use as a drop-in
replacement for /sw/bin/init.sh. It does vary slightly from Fink's
init.sh in its handling of the default MANPATH. Also, you will need
to replace instances of /sw with BASEPATH.
# init.zsh
#
# To use the Fink hierarchy, read this file into your Zsh shell. You may prefer
# to add the following line to either your ~/.zshenv or ~/.zshrc file (at any
# location that suits your tastes, though one recommendation is to place it
# near the very end of your ~/.zshenv):
# . /path/to/init.zsh
#
# Copyright (C) 2003-4 James Devenish. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that: (a) redistributions of source code
# must retain the above copyright notice, this list of conditions and the
# following disclaimer; (b) redistributions in binary form must reproduce the
# above copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
typeset -U PATH MANPATH INFOPATH PERL5LIB CLASSPATH
export PATH=/sw/bin:/sw/sbin:${PATH:-/bin:/sbin:/usr/bin:/usr/sbin}
export MANPATH=/sw/share/man:${MANPATH:-`/usr/bin/manpath -q`}
export INFOPATH=/sw/share/info:/sw/info:${INFOPATH:-/usr/share/info:/usr/local/info}
export PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin${PERL5LIB:+:}${PERL5LIB}
if [[ -r /sw/share/java/classpath ]]; then
CLASSPATH=$(</sw/share/java/classpath)${CLASSPATH:+:}${CLASSPATH}
fi
export CLASSPATH
if [[ -r /usr/X11R6/bin ]]; then
export PATH=$PATH:/usr/X11R6/bin
fi
if [[ -r /usr/X11R6/man ]]; then
export MANPATH=$MANPATH:/usr/X11R6/man
fi
if [[ -d /sw/etc/profile.d ]]; then
function fink_profile_d {
local i
foreach i (/sw/etc/profile.d/*.sh(*N)); do
. $i
done
}
fink_profile_d
fi
PROXYHTTP=`grep ProxyHTTP /sw/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if [[ ! -z $PROXYHTTP ]]; then
export HTTP_PROXY=$PROXYHTTP http_proxy=$PROXYHTTP
fi
PROXYFTP=`grep ProxyFTP /sw/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if [[ ! -z $PROXYFTP ]]; then
export FTP_PROXY=$PROXYFTP ftp_proxy=$PROXYFTP
fi
# EOF