Changeset 204 for trunk/src/project_profile.sh
- Timestamp:
- 03/26/14 11:58:56 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/project_profile.sh
r203 r204 74 74 # cd /usr/home/fplod/incas/tropflux/tropflux_ws/ 75 75 # . ./src/project_profile.sh \ 76 # -d $(pwd) \76 # -d $(pwd)/ \ 77 77 # -i /usr/temp/${LOGNAME}/tropflux_d/ \ 78 78 # -o /usr/temp/${LOGNAME}/tropflux_d/ \ … … 87 87 # cd ${HOME}/incas/tropflux/tropflux_ws/ 88 88 # . ./src/project_profile.sh \ 89 # -d $(pwd) \89 # -d $(pwd)/ \ 90 90 # -i /usr/temp/${LOGNAME}/tropflux_d/ \ 91 91 # -o /usr/temp/${LOGNAME}/tropflux_d/ \ … … 101 101 # cd ${HOME}/tropflux/ 102 102 # . ./src/project_profile.sh \ 103 # -d $(pwd) \103 # -d $(pwd)/ \ 104 104 # -i /homedata/${LOGNAME}/tropflux_d/ \ 105 105 # -o /homedata/${LOGNAME}/tropflux_d/ \ … … 180 180 # default 181 181 idl_cmd=idl 182 # 183 while [ ${#} -gt 0 ] 184 do 185 case ${1} in 186 -d) 187 # directory for application choosen by user (see svn checkout command used) 188 directory=${2} 189 shift 190 ;; 191 -i) 192 # directory for inputs choosen by user 193 indir=${2} 194 shift 195 ;; 196 -o) 197 # directory for outputs choosen by user 198 outdir=${2} 199 shift 200 ;; 201 -t) 202 # directory for temporary outputs choosen by user 203 tempdir=${2} 204 shift 205 ;; 206 -s) 207 # directory for SAXO tools 208 saxo_dir=${2} 209 shift 210 ;; 211 -idl_cmd) 212 # command for idl 213 idl_cmd=${2} 214 shift 215 ;; 216 *) 217 # other choice 218 echo "eee : unknown option ${1}" 219 echo "${usage}" 182 pb=0 183 # 184 minargcount=12 185 maxargcount=12 186 narg=${#} 187 # 188 if [ ${narg} -lt ${minargcount} ] 189 then 190 echo "eee : not enough arguments (${narg} vs ${minargcount})" 191 echo "${usage}" 192 # nb : no exit because this file should be launched by login process 193 pb=1 194 fi 195 unset minargcount 196 # 197 if [ ${narg} -gt ${maxargcount} ] 198 then 199 echo "eee : too many arguments (${narg} vs ${maxargcount})" 200 echo "${usage}" 201 # nb : no exit because this file should be launched by login process 202 pb=1 203 fi 204 unset maxargcount 205 unset narg 206 # 207 if [ ${pb} -eq 0 ] 208 then 209 while [ ${#} -gt 0 ] 210 do 211 case ${1} in 212 -d) 213 # directory for application chosen by user (see svn checkout command used) 214 directory=${2} 215 shift 216 ;; 217 -i) 218 # directory for inputs chosen by user 219 indir=${2} 220 shift 221 ;; 222 -o) 223 # directory for outputs chosen by user 224 outdir=${2} 225 shift 226 ;; 227 -t) 228 # directory for temporary outputs chosen by user 229 tempdir=${2} 230 shift 231 ;; 232 -s) 233 # directory for SAXO tools 234 saxo_dir=${2} 235 shift 236 ;; 237 -idl_cmd) 238 # command for idl 239 idl_cmd=${2} 240 shift 241 ;; 242 *) 243 # other choice 244 echo "eee : unknown option ${1}" 245 echo "${usage}" 246 # nb : no exit because this file should be launched by login process 247 ;; 248 esac 249 # next flag 250 shift 251 done 252 unset usage 253 fi 254 # 255 if [ ${pb} -eq 0 ] 256 then 257 # check for ${directory} 258 if [ ! -d ${directory} ] 259 then 260 echo " eee : ${directory} not found" 261 # nb : no exit because this file should be launched by login process 262 fi 263 # 264 # check for permission on directory 265 if [ ! -x ${directory} ] 266 then 267 echo " eee : ${directory} not reachable" 268 # nb : no exit because this file should be launched by login process 269 fi 270 # 271 PROJECT=${directory} 272 export PROJECT 273 unset directory 274 # 275 # add PROJECT tools to PATH 276 # if not already done 277 suppath=$(echo ${PROJECT}/src | tr -s "/") 278 echo ${PATH} | grep -q "${suppath}:" 279 test_path=${?} 280 if [ ${test_path} -ne 0 ] 281 then 282 PATH=${suppath}:${PATH} 283 export PATH 284 else 285 # option bavarde oui/non pas encore implantée ++ 286 echo "${command} : iii : ${suppath} already in \${PATH}" 287 fi 288 unset test_path 289 # 290 # add PROJECT manuals to MANPATH 291 # if not already done 292 suppath=$(echo ${PROJECT}/doc/man | tr -s "/") 293 echo ${MANPATH} | grep -q "${suppath}:" 294 test_manpath=${?} 295 if [ ${test_manpath} -ne 0 ] 296 then 297 MANPATH=${suppath}:${MANPATH} 298 export MANPATH 299 else 300 # option bavarde oui/non pas encore implantée ++ 301 echo "${command} : iii : ${suppath} already in \${MANPATH}" 302 fi 303 unset test_manpath 304 unset suppath 305 # 306 PROJECT_LOG=${tempdir} 307 export PROJECT_LOG 308 unset tempdir 309 if [ ! -d ${PROJECT_LOG} ] 310 then 311 mkdir -p ${PROJECT_LOG} 312 status=${?} 313 if [ ${status} -ne 0 ] 314 then 315 echo "${command} : eee : can not create \${PROJECT_LOG}" 220 316 # nb : no exit because this file should be launched by login process 221 ;; 222 esac 223 # next flag 224 shift 225 done 226 unset usage 227 # 228 # check for ${directory} 229 if [ ! -d ${directory} ] 230 then 231 echo " eee : ${directory} not found" 232 # nb : no exit because this file should be launched by login process 317 else 318 echo "${command} : iii : creation of \${PROJECT_LOG}" 319 fi 320 unset status 321 fi 322 # check for permission on PROJECT_LOG 323 if [ ! -x ${PROJECT_LOG} ] 324 then 325 echo " eee : ${PROJECT_LOG} not reachable" 326 # nb : no exit because this file should be launched by login process 327 fi 328 # 329 # check for permission on PROJECT_LOG 330 if [ ! -w ${PROJECT_LOG} ] 331 then 332 echo " eee : ${PROJECT_LOG} not writable" 333 # nb : no exit because this file shouldreachable be launched by login process 334 fi 335 # 336 EDITOR=vi 337 export EDITOR 338 # 339 # io directories 340 PROJECT_ID=${indir} 341 export PROJECT_ID 342 unset indir 343 if [ ! -d ${PROJECT_ID} ] 344 then 345 mkdir -p ${PROJECT_ID} 346 echo "${command} : iii : creation of \${PROJECT_ID}" 347 fi 348 # check for permission on PROJECT_ID 349 if [ ! -x ${PROJECT_ID} ] 350 then 351 echo " eee : ${PROJECT_ID} not reachable" 352 # nb : no exit because this file should be launched by login process 353 fi 354 # 355 PROJECT_OD=${outdir} 356 export PROJECT_OD 357 unset outdir 358 if [ ! -d ${PROJECT_OD} ] 359 then 360 mkdir -p ${PROJECT_OD} 361 echo "${command} : iii : creation of \${PROJECT_OD}" 362 fi 363 # check for permission on PROJECT_OD 364 if [ ! -x ${PROJECT_OD} ] 365 then 366 echo " eee : ${PROJECT_OD} not reachable" 367 # nb : no exit because this file should be launched by login process 368 fi 369 if [ ! -w ${PROJECT_OD} ] 370 then 371 echo " eee : ${PROJECT_OD} not writable" 372 # nb : no exit because this file should be launched by login process 373 fi 374 # 375 # setup for ferret 376 set +u 377 if [ "${FER_GO}" = "" ] 378 then 379 FER_GO="${FER_DIR}/go ${FER_GO} ${PROJECT}/src" 380 else 381 FER_GO="${FER_DIR}/go ${PROJECT}/src" 382 fi 383 set -u 384 FER_GO="${FER_GO} ${PROJECT}/src/test" 385 export FER_GO 386 # 387 # set up for idl 388 IDL_CMD=${idl_cmd} 389 export IDL_CMD 390 unset idl_cmd 391 # 392 SAXO_DIR=${saxo_dir} 393 export SAXO_DIR 394 unset saxo_dir 395 # 396 # IDL startup 397 IDL_STARTUP=${PROJECT}/src/project_init.pro 398 export IDL_STARTUP 233 399 fi 234 # 235 # check for permission on directory 236 if [ ! -x ${directory} ] 237 then 238 echo " eee : ${directory} not reachable" 239 # nb : no exit because this file should be launched by login process 240 fi 241 # 242 PROJECT=${directory} 243 export PROJECT 244 unset drectory 245 # 246 # add PROJECT tools to PATH 247 # if not already done 248 suppath=$(echo ${PROJECT}/src | tr -s "/") 249 echo ${PATH} | grep -q "${suppath}:" 250 test_path=${?} 251 if [ ${test_path} -ne 0 ] 252 then 253 PATH=${suppath}:${PATH} 254 export PATH 255 else 256 # option bavarde oui/non pas encore implantée ++ 257 echo "${command} : iii : ${suppath} already in \${PATH}" 258 fi 259 unset test_path 260 # 261 # add PROJECT manuals to MANPATH 262 # if not already done 263 suppath=$(echo ${PROJECT}/doc/man | tr -s "/") 264 echo ${MANPATH} | grep -q "${suppath}:" 265 test_manpath=${?} 266 if [ ${test_manpath} -ne 0 ] 267 then 268 MANPATH=${suppath}:${MANPATH} 269 export MANPATH 270 else 271 # option bavarde oui/non pas encore implantée ++ 272 echo "${command} : iii : ${suppath} already in \${MANPATH}" 273 fi 274 unset test_manpath 275 unset suppath 276 # 277 PROJECT_LOG=${tempdir} 278 export PROJECT_LOG 279 unset tempdir 280 if [ ! -d ${PROJECT_LOG} ] 281 then 282 mkdir -p ${PROJECT_LOG} 283 status=${?} 284 if [ ${status} -ne 0 ] 285 then 286 echo "${command} : eee : can not create \${PROJECT_LOG}" 287 # nb : no exit because this file should be launched by login process 288 else 289 echo "${command} : iii : creation of \${PROJECT_LOG}" 290 fi 291 unset status 292 fi 293 # check for permission on PROJECT_LOG 294 if [ ! -x ${PROJECT_LOG} ] 295 then 296 echo " eee : ${PROJECT_LOG} not reachable" 297 # nb : no exit because this file should be launched by login process 298 fi 299 # 300 # check for permission on PROJECT_LOG 301 if [ ! -w ${PROJECT_LOG} ] 302 then 303 echo " eee : ${PROJECT_LOG} not writable" 304 # nb : no exit because this file shouldreachable be launched by login process 305 fi 306 # 307 EDITOR=vi 308 export EDITOR 309 # 310 # io directories 311 PROJECT_ID=${indir} 312 export PROJECT_ID 313 unset indir 314 if [ ! -d ${PROJECT_ID} ] 315 then 316 mkdir -p ${PROJECT_ID} 317 echo "${command} : iii : creation of \${PROJECT_ID}" 318 fi 319 # check for permission on PROJECT_ID 320 if [ ! -x ${PROJECT_ID} ] 321 then 322 echo " eee : ${PROJECT_ID} not reachable" 323 # nb : no exit because this file should be launched by login process 324 fi 325 # 326 PROJECT_OD=${outdir} 327 export PROJECT_OD 328 unset outdir 329 if [ ! -d ${PROJECT_OD} ] 330 then 331 mkdir -p ${PROJECT_OD} 332 echo "${command} : iii : creation of \${PROJECT_OD}" 333 fi 334 # check for permission on PROJECT_OD 335 if [ ! -x ${PROJECT_OD} ] 336 then 337 echo " eee : ${PROJECT_OD} not reachable" 338 # nb : no exit because this file should be launched by login process 339 fi 340 if [ ! -w ${PROJECT_OD} ] 341 then 342 echo " eee : ${PROJECT_OD} not writable" 343 # nb : no exit because this file should be launched by login process 344 fi 345 # 346 # setup for ferret 347 set +u 348 if [ "${FER_GO}" = "" ] 349 then 350 FER_GO="${FER_DIR}/go ${FER_GO} ${PROJECT}/src" 351 else 352 FER_GO="${FER_DIR}/go ${PROJECT}/src" 353 fi 354 set -u 355 FER_GO="${FER_GO} ${PROJECT}/src/test" 356 export FER_GO 357 # 358 # set up for idl 359 IDL_CMD=${idl_cmd} 360 export IDL_CMD 361 unset idl_cmd 362 # 363 SAXO_DIR=${saxo_dir} 364 export SAXO_DIR 365 unset saxo_dir 366 # 367 # IDL startup 368 IDL_STARTUP=${PROJECT}/src/project_init.pro 369 export IDL_STARTUP 370 # 400 unset pb 371 401 # end 372 402 unset command
Note: See TracChangeset
for help on using the changeset viewer.