Changeset 9 for trunk/src/project_profile.sh
- Timestamp:
- 04/26/11 19:05:26 (13 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/project_profile.sh
r2 r9 2 2 #+ 3 3 # 4 # .. program:: pomme_profile.sh 5 # 6 # ================ 7 # pomme_profile.sh 8 # ================ 9 # 10 # ------------------------ 11 # define POMME environment 12 # ------------------------ 4 # .. program:: project_profile.sh 5 # 6 # .. _project_profile.sh: 7 # 8 # ============================================= 9 # project_profile.sh - define POMME environment 10 # ============================================= 13 11 # 14 12 # SYNOPSIS … … 17 15 # Online usage:: 18 16 # 19 # $ . ./p omme_profile.sh -d directory -i indir -o outdir -t tempdir17 # $ . ./project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir 20 18 # 21 19 # In ${HOME}/.profile, add the following line:: 22 20 # 23 # . p omme_profile.sh -d directory -i indir -o outdir -t tempdir21 # . project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir 24 22 # 25 23 # DESCRIPTION … … 30 28 # .. option:: -o <outdir> 31 29 # .. option:: -t <tempdir> 30 # .. option:: -s <saxo_dir> 32 31 # 33 32 # define POMME environment 34 33 # 35 # ${POMME} is the base directory of tools. 36 # 37 # ${POMME_LOG} is the directory where log files will be written. 38 # 39 # ${POMME_ID} is the directory where input files must be. 40 # 41 # ${POMME_OD} is the directory where output files will be written. 42 # 43 # PATH is completed with ${POMME}. 34 # ${PROJECT} is the base directory of tools. 35 # 36 # ${PROJECT_LOG} is the directory where log files will be written. 37 # 38 # ${PROJECT_ID} is the directory where input files must be. 39 # 40 # ${PROJECT_OD} is the directory where output files will be written. 41 # 42 # ${SAXO_DIR} is the base directory of SAXO tools. 43 # 44 # PATH is completed with ${PROJECT}. 44 45 # 45 46 # SEE ALSO … … 48 49 # for IDL/GDL environment : 49 50 # 50 # :program:`pomme_startup.pro` 51 # :ref:`project_init.pro` 52 # :ref:`cm_project.pro` 51 53 # 52 54 # EXAMPLES … … 56 58 # 57 59 # $ cd /usr/home/fplod/incas/pomme/pomme_ws/ 58 # $ . ./src/p omme_profile.sh \60 # $ . ./src/project_profile.sh \ 59 61 # -d $(pwd) \ 60 62 # -i /usr/temp/${LOGNAME}/pomme_d/ \ 61 63 # -o /usr/temp/${LOGNAME}/pomme_d/ \ 62 # -t /usr/temp/${LOGNAME}/log/ 63 # 64 # For fplod on zeus.locean-ipsl.umpc.fr:: 64 # -t /usr/temp/${LOGNAME}/log/ \ 65 # -s /usr/home/fplod/SAXO_DIR/ 66 # 67 # For fplod on cratos.locean-ipsl.umpc.fr:: 65 68 # 66 69 # $ cd ${HOME}/incas/pomme/pomme_ws/ 67 # $ . ./src/p omme_profile.sh \70 # $ . ./src/project_profile.sh \ 68 71 # -d $(pwd) \ 69 72 # -i /usr/temp/${LOGNAME}/pomme_d/ \ 70 73 # -o /usr/temp/${LOGNAME}/pomme_d/ \ 71 # -t /usr/temp/${LOGNAME}/log/ 74 # -t /usr/temp/${LOGNAME}/log/ \ 75 # -s ${HOME}/SAXO_DIR/ 72 76 # 73 77 # For pinsard on camelot.ipsl.polytechnique.fr or merlin15-c.climserv:: 74 78 # 75 79 # $ cd ${HOME}/pomme/ 76 # $ . ./src/p omme_profile.sh \80 # $ . ./src/project_profile.sh \ 77 81 # -d $(pwd) \ 78 82 # -i /homedata/${LOGNAME}/pomme_d/ \ 79 83 # -o /homedata/${LOGNAME}/pomme_d/ \ 80 # -t /homedata/${LOGNAME}/log/ 84 # -t /homedata/${LOGNAME}/log/ \ 85 # -s ${HOME}/SAXO_DIR/ 81 86 # 82 87 # TODO … … 89 94 # ++ besoin de posix 90 95 # 91 # ++ pas de MANPATH defini par défaut sur zeus et cerbere 92 # 93 # define IDL_STARTUP 96 # ++ pas de MANPATH defini par défaut sur cratos et cerbere 94 97 # 95 98 # EVOLUTIONS 96 99 # ========== 100 # 101 # - fplod 20110426T151058Z cratos.locean-ipsl.upmc.fr (Linux) 102 # 103 # * add IDL and SAXO env. 104 # * replace POMME by PROJECT 105 # * replace zeus by cratos 97 106 # 98 107 # - fplod 20101118T171653Z aedon.locean-ipsl.upmc.fr (Darwin) … … 115 124 # 116 125 # as this script might be launch in .profile, command is forced. 117 command=p omme_profile.sh118 # 119 usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir "126 command=project_profile.sh 127 # 128 usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir -s saxo_dir" 120 129 # 121 130 set +u … … 143 152 shift 144 153 ;; 154 -s) 155 saxo_dir=${2} 156 shift 157 ;; 145 158 *) 146 159 # other choice … … 169 182 fi 170 183 # 171 P OMME=${directory}172 export P OMME184 PROJECT=${directory} 185 export PROJECT 173 186 unset drectory 174 187 # 175 # add P OMMEtools to PATH188 # add PROJECT tools to PATH 176 189 # if not already done 177 suppath=$(echo ${P OMME}/src | tr -s "/")190 suppath=$(echo ${PROJECT}/src | tr -s "/") 178 191 echo ${PATH} | grep -q "${suppath}:" 179 192 test_path=${?} … … 188 201 unset test_path 189 202 # 190 # add P OMMEmanuals to MANPATH203 # add PROJECT manuals to MANPATH 191 204 # if not already done 192 suppath=$(echo ${P OMME}/doc/man | tr -s "/")205 suppath=$(echo ${PROJECT}/doc/man | tr -s "/") 193 206 echo ${MANPATH} | grep -q "${suppath}:" 194 207 test_manpath=${?} … … 204 217 unset suppath 205 218 # 206 P OMME_LOG=${tempdir}207 export P OMME_LOG219 PROJECT_LOG=${tempdir} 220 export PROJECT_LOG 208 221 unset tempdir 209 if [ ! -d ${P OMME_LOG} ]210 then 211 mkdir -p ${P OMME_LOG}222 if [ ! -d ${PROJECT_LOG} ] 223 then 224 mkdir -p ${PROJECT_LOG} 212 225 status=${?} 213 226 if [ ${status} -ne 0 ] … … 216 229 # nb : no exit because this file should be launched by login process 217 230 else 218 echo "${command} : iii : creation of \${P OMME_LOG}"231 echo "${command} : iii : creation of \${PROJECT_LOG}" 219 232 fi 220 233 unset status 221 234 fi 222 # check for permission on P OMME_LOG223 if [ ! -x ${P OMME_LOG} ]224 then 225 echo " eee : ${P OMME_LOG} not reachable"226 # nb : no exit because this file should be launched by login process 227 fi 228 # 229 # check for permission on P OMME_LOG230 if [ ! -w ${P OMME_LOG} ]231 then 232 echo " eee : ${P OMME_LOG} not writable"235 # check for permission on PROJECT_LOG 236 if [ ! -x ${PROJECT_LOG} ] 237 then 238 echo " eee : ${PROJECT_LOG} not reachable" 239 # nb : no exit because this file should be launched by login process 240 fi 241 # 242 # check for permission on PROJECT_LOG 243 if [ ! -w ${PROJECT_LOG} ] 244 then 245 echo " eee : ${PROJECT_LOG} not writable" 233 246 # nb : no exit because this file shouldreachable be launched by login process 234 247 fi … … 238 251 # 239 252 # io directories 240 P OMME_ID=${indir}241 export P OMME_ID253 PROJECT_ID=${indir} 254 export PROJECT_ID 242 255 unset indir 243 if [ ! -d ${P OMME_ID} ]244 then 245 mkdir -p ${P OMME_ID}246 echo "${command} : iii : creation of \${P OMME_ID}"247 fi 248 # check for permission on P OMME_ID249 if [ ! -x ${P OMME_ID} ]250 then 251 echo " eee : ${P OMME_ID} not reachable"252 # nb : no exit because this file should be launched by login process 253 fi 254 # 255 P OMME_OD=${outdir}256 export P OMME_OD256 if [ ! -d ${PROJECT_ID} ] 257 then 258 mkdir -p ${PROJECT_ID} 259 echo "${command} : iii : creation of \${PROJECT_ID}" 260 fi 261 # check for permission on PROJECT_ID 262 if [ ! -x ${PROJECT_ID} ] 263 then 264 echo " eee : ${PROJECT_ID} not reachable" 265 # nb : no exit because this file should be launched by login process 266 fi 267 # 268 PROJECT_OD=${outdir} 269 export PROJECT_OD 257 270 unset outdir 258 if [ ! -d ${POMME_OD} ] 259 then 260 mkdir -p ${POMME_OD} 261 echo "${command} : iii : creation of \${POMME_OD}" 262 fi 263 # check for permission on POMME_OD 264 if [ ! -x ${POMME_OD} ] 265 then 266 echo " eee : ${POMME_OD} not reachable" 267 # nb : no exit because this file should be launched by login process 268 fi 269 if [ ! -w ${POMME_OD} ] 270 then 271 echo " eee : ${POMME_OD} not writable" 272 # nb : no exit because this file should be launched by login process 273 fi 274 # 271 if [ ! -d ${PROJECT_OD} ] 272 then 273 mkdir -p ${PROJECT_OD} 274 echo "${command} : iii : creation of \${PROJECT_OD}" 275 fi 276 # check for permission on PROJECT_OD 277 if [ ! -x ${PROJECT_OD} ] 278 then 279 echo " eee : ${PROJECT_OD} not reachable" 280 # nb : no exit because this file should be launched by login process 281 fi 282 if [ ! -w ${PROJECT_OD} ] 283 then 284 echo " eee : ${PROJECT_OD} not writable" 285 # nb : no exit because this file should be launched by login process 286 fi 287 # 288 SAXO_DIR=${saxo_dir} 289 export SAXO_DIR 290 # 291 # IDL startup 292 IDL_STARTUP=${PROJECT}/src/project_init.pro 293 export IDL_STARTUP 275 294 # end 276 295 unset command
Note: See TracChangeset
for help on using the changeset viewer.