| Paste number 9693: | ? |
| Pasted by: | dk0r |
| When: | 5 years, 2 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+7H9 |
| Channel: | #fink |
| Paste contents: |
# init.sh
#
# to use the Fink hierarchy, put the following in your .profile:
#
# . /sw/bin/init.sh
#
#
# Fink - a package manager that downloads source and installs it
# Copyright (c) 2001 Christoph Pfisterer
# Copyright (c) 2001-2004 The Fink Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# define append_path and prepend_path to add directory paths, e.g. PATH, MANPATH.
# add to end of path
append_path()
{
if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o -z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
eval "$1=\$$1:$2"
fi
}
# add to front of path
prepend_path()
{
if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o -z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
eval "$1=$2:\$$1"
fi
}
# setup fink related paths. we assume that the fink directories exists.
if [ -z "$PATH" ]; then
PATH=/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin
else
prepend_path PATH /sw/bin:/sw/sbin
fi
export PATH
if [ -z "$MANPATH" ]; then
if [ `uname -r | cut -d. -f1` -gt 7 ]; then
MANPATH=`/usr/bin/manpath`
else
MANPATH=`/usr/bin/manpath -q`
fi
prepend_path MANPATH /sw/share/man
else
prepend_path MANPATH /sw/share/man
fi
export MANPATH
if [ -z "$INFOPATH" ]; then
INFOPATH=/sw/share/info:/sw/info:/usr/share/info
else
prepend_path INFOPATH /sw/share/info:/sw/info
fi
export INFOPATH
if [ -r /sw/share/java/classpath ]; then
if [ -z "$CLASSPATH" ]; then
CLASSPATH=`cat /sw/share/java/classpath`:.
else
add2classpath=`cat /sw/share/java/classpath`
prepend_path CLASSPATH $add2classpath
fi
export CLASSPATH
fi
if [ -z "$PERL5LIB" ]; then
PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin
else
prepend_path PERL5LIB /sw/lib/perl5:/sw/lib/perl5/darwin
fi
export PERL5LIB
# Add X11 paths (but only if the directories are readable)
if [ -r /usr/X11R6/bin ]; then
append_path PATH /usr/X11R6/bin
export PATH
fi
if [ -r /usr/X11R6/man ]; then
append_path MANPATH /usr/X11R6/man
export MANPATH
fi
PROXYHTTP=`grep ProxyHTTP /sw/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if [ "$PROXYHTTP" != "" ]; then
HTTP_PROXY=$PROXYHTTP
http_proxy=$PROXYHTTP
export HTTP_PROXY http_proxy
fi
PROXYFTP=`grep ProxyFTP /sw/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if [ "$PROXYFTP" != "" ]; then
FTP_PROXY=$PROXYFTP
ftp_proxy=$PROXYFTP
export FTP_PROXY ftp_proxy
fi
# read per-package scripts from /sw/etc/profile.d
if [ -d /sw/etc/profile.d ]; then
for i in /sw/etc/profile.d/*.sh ; do
if [ -r $i -a -x $i ]; then
. $i
fi
done
unset i
fi
# eof
This paste has no annotations.