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

Annotation of /ReleaseTools/RTPath.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (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 :     workdir=${PWD}/${RTARCH}
65 :    
66 :     reldir=${RTDIST}/releases/${RTCURRENT}/${RTARCH}
67 :    
68 :     if [ "" != "$RTSITEOVERRIDE" ]; then
69 :     overridedir=${RTSITEOVERRIDE}/${RTCURRENT}/${RTARCH}
70 :     overridedirbin=$overridedir/bin
71 :     overridedirlib=$overridedir/lib
72 :     else
73 :     set overridedir=""
74 :     set overridedirbin=""
75 :     set overridedirlib=""
76 :     fi
77 :    
78 :    
79 :     #
80 :     # path
81 :     #
82 :     if [ `echo $PATH | grep RTMARKER` != "" ]; then
83 :     #RTMARKER sandwhich there...change out the filling
84 :    
85 :     PATH= `echo $path | sed "s%RTMARKER.*RTMARKER%RTMARKER:${workdir}/bin:${overridedirbin}:${reldir}/bin:RTMARKER%g"` )
86 :     else
87 :     #No MARKER...our first time, then
88 :    
89 :     PATH=$PATH:`echo RTMARKER:${workdir}/bin:${overridedirbin}:${reldir}/bin RTMARKER`
90 :     fi
91 :    
92 :     #
93 :     # PYTHONPATH
94 :     #
95 :    
96 :     if [ "" -eq "$PYTHONPATH" ]; then
97 :     PYTHONPATH=""
98 :     fi
99 :    
100 :     if [ `echo $PYTHONPATH | grep RTMARKER` != "" ]; then
101 :    
102 :     setenv PYTHONPATH `echo $PYTHONPATH | sed "s%RTMARKER.*RTMARKER%RTMARKER:${workdir}/lib:${overridedirlib}:${reldir}/lib RTMARKER%g"`
103 :    
104 :     else
105 :     #No MARKER...our first time, then
106 :    
107 :     setenv PYTHONPATH ${PYTHONPATH}:`echo RTMARKER:${workdir}/lib:${overridedirlib}:${reldir}/lib:RTMARKER`
108 :     endif
109 :    
110 :     #
111 :     # cleanup
112 :     #
113 :    
114 :     unset workdir
115 :     unset reldir
116 :     unset overridedir
117 :     unset overridedirbin
118 :     unset overridedirlib

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3