-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.csh.in
121 lines (105 loc) · 3.94 KB
/
init.csh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# init.csh
#
# to use the Fink hierarchy, put the following in your .cshrc:
#
# source BASEPATH/bin/init.csh
#
#
# Fink - a package manager that downloads source and installs it
# Copyright (c) 2001 Christoph Pfisterer
# Copyright (c) 2001-2020 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., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
#
# define append_path and prepend_path to add directory paths, e.g. PATH, MANPATH.
# add to end of path
alias append_path 'if ( $\!:1 !~ \!:2\:* && $\!:1 !~ *\:\!:2\:* && $\!:1 !~ *\:\!:2 && $\!:1 !~ \!:2 ) setenv \!:1 ${\!:1}\:\!:2'
# add to front of path
alias prepend_path 'if ( $\!:1 !~ \!:2\:* && $\!:1 !~ *\:\!:2\:* && $\!:1 !~ *\:\!:2 && $\!:1 !~ \!:2 ) setenv \!:1 \!:2\:${\!:1}; if ( $\!:1 !~ \!:2\:* ) setenv \!:1 \!:2`echo \:${\!:1} | /usr/bin/sed -e s%^\!:2\:%% -e s%:\!:2\:%:%g -e s%:\!:2\$%%`'
# setup fink related paths. we assume that the fink directories exist.
if ( $?PATH ) then
prepend_path PATH BASEPATH/bin:BASEPATH/sbin
else
setenv PATH BASEPATH/bin:BASEPATH/sbin:/bin:/sbin:/usr/bin:/usr/sbin
endif
set osMajorVersion = `uname -r | cut -d. -f1`
set osMinorVersion = `uname -r | cut -d. -f2`
if ( ! $?MANPATH ) then
setenv MANPATH `/usr/bin/manpath`
endif
prepend_path MANPATH BASEPATH/share/man
set perlversion = `/usr/bin/perl -e 'printf("%vd\n", $^V)'`
append_path MANPATH BASEPATH/lib/perl5/$perlversion/man
if ( $?INFOPATH ) then
prepend_path INFOPATH BASEPATH/share/info:BASEPATH/info
else
setenv INFOPATH BASEPATH/share/info:BASEPATH/info:/usr/share/info
endif
if ( -r BASEPATH/share/java/classpath ) then
if ( $?CLASSPATH ) then
set add2classpath = `cat BASEPATH/share/java/classpath`
prepend_path CLASSPATH $add2classpath
else
setenv CLASSPATH `cat BASEPATH/share/java/classpath`:.
endif
endif
if ( $?PERL5LIB ) then
prepend_path PERL5LIB BASEPATH/lib/perl5:BASEPATH/lib/perl5/darwin
else
setenv PERL5LIB BASEPATH/lib/perl5:BASEPATH/lib/perl5/darwin
endif
# Add X11 paths (first one found between /opt and /usr/X11).
if ( "$PATH" !~ *X11*/bin ) then
# For PATH, check for presence of *any* X11 entry present in var
# first. We support platforms with several possible prefixes (or
# symlinks to it), and don't want to add a different prefix or
# redundant link to it.
if ( -r /opt/X11/bin ) then
append_path PATH /opt/X11/bin
else if ( -r /usr/X11/bin ) then
append_path PATH /usr/X11/bin
endif
endif
if ( -r /opt/X11/man ) then
append_path MANPATH /opt/X11/man
else if ( -r /usr/X11/man ) then
append_path MANPATH /usr/X11/man
endif
if ($?version) then
if ("$version" =~ tcsh*) then
complete fink 'n/fink/(install remove purge update selfupdate update-all configure list apropos describe index validate --help --version)/'
endif
endif
set PROXYHTTP=`grep ProxyHTTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if ( "$PROXYHTTP" != "" ) then
setenv HTTP_PROXY $PROXYHTTP
setenv http_proxy $PROXYHTTP
endif
set PROXYFTP=`grep ProxyFTP BASEPATH/etc/fink.conf | grep -v "#" | cut -d " " -f2`
if ( "$PROXYFTP" != "" ) then
setenv FTP_PROXY $PROXYFTP
setenv ftp_proxy $PROXYFTP
endif
# read per-package scripts from BASEPATH/etc/profile.d
if ( -d BASEPATH/etc/profile.d ) then
set nonomatch
foreach i ( BASEPATH/etc/profile.d/*.csh )
if ( -r $i && -x $i ) then
source $i
endif
end
unset i nonomatch
endif
# eof