[Bio] / ReleaseTools / RTPath.csh Repository:
ViewVC logotype

Annotation of /ReleaseTools/RTPath.csh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download) (as text)

1 : efrank 1.1 #############################################################################
2 :     #
3 :     # The goal is to set various path env variables to control search order
4 :     # under the release tools.
5 :     #
6 :     # USAGE:
7 :     # o run from inside a work directory
8 :     # o Have RTDIST, RTCURRENT defined. Also, RTSITEOVERRIDE, if needed
9 :     #
10 :     # source RTPATH
11 :     #
12 :     #
13 :     # DETAILS:
14 :     #
15 :     # We care about:
16 :     #
17 :     # path affects locating release programs, tools
18 :     # PYTHONPATH affects loading of built code
19 :     # LD_LIBRARY_PATH as for PYTHONPATH.** Not used yet, thank heavens
20 :     #
21 :     # The search order is as follows, and this defines levels of overrides
22 :     #
23 :     # 1. working directory
24 :     # 2. site overrides not implemented yet.
25 :     # 3. base release
26 :     #
27 :     # Thus, anything checked out (in case its modified) wins out over
28 :     # everything. Anything in site-level config comes next. This allows the
29 :     # site to do config that is perhaps more tricky than
30 :     # a typical user cares to know about. Finally comes base release, allowing
31 :     # us to ship releases with reasonable defaults (or examples).
32 :     #
33 :     # Site overrides work by keying off of RTSITEOVERRIDE environment variable.
34 :     # That's just a path that points to the overrides. We look in there for
35 :     # a subdirectory with the current release name (RTCURRENT).
36 :     #
37 :     # So, the end result is something like
38 :     #
39 :     # ${PWD}/${RTARCH}/bin:${RTSITEOVERRIDE}/${RTCURRENT}/${RTARCH}/bin:
40 :     # ${RTDIST}/releases/${RTCURRENT}/${RTARCH}/bin
41 :     #
42 :     # or with bin->lib, as needed.
43 :     #
44 :     # HISTORY:
45 :     # 06Feb04 efrank first version
46 :     #
47 :     # BUGS
48 :     # o We don't want the paths to get longer and longer if RTPath is called
49 :     # multiple times, e.g., if you change to a new working directory. We
50 :     # have a KLUDGE for the moment: we stick RTMARKER as a literal into
51 :     # the path to sandwhich what we put there. We then use that to locate
52 :     # our stuff later when we need to modify it. Not robust at all.
53 :     #
54 :     #############################################################################
55 :    
56 :     # PYTHONPATH affects loading of built code
57 :     # LD_LIBRARY_PATH as for PYTHONPATH.** Not used yet, thank heavens
58 :    
59 :    
60 :     #
61 :     # precompute a few directory names.
62 :     #
63 :    
64 :     set workdir=${PWD}/${RTARCH}
65 :    
66 :     set reldir=${RTDIST}/releases/${RTCURRENT}/${RTARCH}
67 :    
68 : efrank 1.4 #if ( -f rtConfig ) then
69 :     # source rtConfig
70 :     # set reldir=${RTDIST}/releases/${baserelname}/${RTARCH}
71 :     #else
72 :     # set reldir=${RTDIST}/releases/${RTCURRENT}/${RTARCH}
73 :     #endif
74 : efrank 1.3
75 : efrank 1.1 if ( $?RTSITEOVERRIDE ) then
76 :     set overridedir=${RTSITEOVERRIDE}/${RTCURRENT}/${RTARCH}
77 :     set overridedirbin=$overridedir/bin
78 :     set overridedirlib=$overridedir/lib
79 :     else
80 :     set overridedir=""
81 :     set overridedirbin=""
82 :     set overridedirlib=""
83 :     endif
84 :    
85 :    
86 :     #
87 :     # path
88 :     #
89 :     if ( `echo $path | grep RTMARKER` != "" ) then
90 :     #RTMARKER sandwhich there...change out the filling
91 :    
92 :     set path=( `echo $path | sed "s%RTMARKER.*RTMARKER%RTMARKER $workdir/bin $overridedirbin $reldir/bin RTMARKER%g"` )
93 :    
94 :     else
95 :     #No MARKER...our first time, then
96 :    
97 :     set path=($path `echo RTMARKER $workdir/bin $overridedirbin $reldir/bin RTMARKER` )
98 :    
99 :     endif
100 :    
101 :     #
102 :     # PYTHONPATH
103 :     #
104 :     if ( ! $?PYTHONPATH ) then
105 : efrank 1.2 setenv PYTHONPATH ""
106 : efrank 1.1 endif
107 :    
108 :     if ( `echo $PYTHONPATH | grep RTMARKER` != "" ) then
109 :    
110 : efrank 1.3 setenv PYTHONPATH `echo $PYTHONPATH | sed "s%RTMARKER.*RTMARKER%RTMARKER:${workdir}/lib:${overridedirlib}:${reldir}/lib:RTMARKER%g"`
111 : efrank 1.1
112 :     else
113 :     #No MARKER...our first time, then
114 :    
115 :     setenv PYTHONPATH ${PYTHONPATH}:`echo RTMARKER:${workdir}/lib:${overridedirlib}:${reldir}/lib:RTMARKER`
116 :     endif
117 :    
118 :     #
119 :     # cleanup
120 :     #
121 :    
122 :     unset workdir
123 :     unset reldir
124 :     unset overridedir
125 :     unset overridedirbin
126 :     unset overridedirlib

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3