Ignore:
Timestamp:
02/11/14 18:41:24 (10 years ago)
Author:
pinsard
Message:

fix thanks to coding rules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/project_profile.sh

    r184 r203  
    1313# ======== 
    1414# 
    15 # Online usage:: 
    16 # 
    17 #  $ . ./project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir -idl_cmd idl_cmd 
    18 # 
    19 # In ${HOME}/.profile, add the following line:: 
    20 # 
    21 #  . project_profile.sh -d directory  -i indir -o outdir -t tempdir -s saxo_dir -idl_cmd idl_cmd 
     15# Online usage: 
     16# 
     17# .. code-block:: bash 
     18# 
     19#    . ./project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir -idl_cmd idl_cmd 
     20# 
     21# In ${HOME}/.profile, add the following line: 
     22# 
     23# .. code-block:: bash 
     24# 
     25#    . project_profile.sh -d directory  -i indir -o outdir -t tempdir -s saxo_dir -idl_cmd idl_cmd 
    2226# 
    2327# DESCRIPTION 
     
    4751# IDL_STARTUP is set to tell IDL where find tools. 
    4852# 
    49 # If :option:`idl_cmd` is used, **idl_cmd** will be used as the IDL command  
    50 # when launched from scripts.  
    51 # By default, ${IDL_CMD} is set to `idl`.  
     53# If :option:`idl_cmd` is used, **idl_cmd** will be used as the IDL command 
     54# when launched from scripts. 
     55# By default, ${IDL_CMD} is set to `idl`. 
    5256# 
    5357# FER_GO is completed with ${PROJECT}/src/ and ${PROJECT}/src/test/. 
     
    6468# ======== 
    6569# 
    66 # For fplod, on halios.locean-ipsl.upmc.fr using gdl (to be tested):: 
    67 # 
    68 #  $ cd /usr/home/fplod/incas/tropflux/tropflux_ws/ 
    69 #  $ . ./src/project_profile.sh \ 
     70# For fplod, on halios.locean-ipsl.upmc.fr using gdl (to be tested): 
     71# 
     72# .. code-block:: bash 
     73# 
     74#    cd /usr/home/fplod/incas/tropflux/tropflux_ws/ 
     75#    . ./src/project_profile.sh \ 
    7076#    -d $(pwd) \ 
    7177#    -i /usr/temp/${LOGNAME}/tropflux_d/ \ 
     
    7581#    -idl_cmd gdl 
    7682# 
    77 # For fplod on cratos.locean-ipsl.umpc.fr using idl 7.0:: 
    78 # 
    79 #  $ cd ${HOME}/incas/tropflux/tropflux_ws/ 
    80 #  $ . ./src/project_profile.sh \ 
     83# For fplod on cratos.locean-ipsl.umpc.fr using idl 7.0: 
     84# 
     85# .. code-block:: bash 
     86# 
     87#    cd ${HOME}/incas/tropflux/tropflux_ws/ 
     88#    . ./src/project_profile.sh \ 
    8189#    -d $(pwd) \ 
    8290#    -i /usr/temp/${LOGNAME}/tropflux_d/ \ 
     
    8694#    -idl_cmd idl70 
    8795# 
    88 # For pinsard on camelot.ipsl.polytechnique.fr or merlin15-c.climserv to use  
    89 # idl6.4:: 
    90 # 
    91 #  $ cd ${HOME}/tropflux/ 
    92 #  $ . ./src/project_profile.sh \ 
     96# For pinsard on camelot.ipsl.polytechnique.fr or merlin15-c.climserv to use 
     97# idl6.4: 
     98# 
     99# .. code-block:: bash 
     100# 
     101#    cd ${HOME}/tropflux/ 
     102#    . ./src/project_profile.sh \ 
    93103#   -d $(pwd) \ 
    94104#   -i /homedata/${LOGNAME}/tropflux_d/ \ 
     
    125135# - fplod 20111104T130726Z cratos (Linux) 
    126136# 
    127 #   * add $PROJECT/src/test to FER_GO 
     137#   * add ${PROJECT}/src/test to FER_GO 
    128138# 
    129139# - fplod 20111010T072623Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    150160system=$(uname) 
    151161case "${system}" in 
    152    AIX|IRIX64) 
    153       echo " www : no specific posix checking" 
    154    ;; 
    155    *) 
    156       set -o posix 
    157    ;; 
     162    AIX|IRIX64) 
     163        echo " www : no specific posix checking" 
     164    ;; 
     165    *) 
     166        set -o posix 
     167    ;; 
    158168esac 
    159169unset system 
     
    173183while [ ${#} -gt 0 ] 
    174184do 
    175    case ${1} in 
    176       -d) 
    177          # directory for application choosen by user (see svn checkout command used) 
    178          directory=${2} 
    179          shift 
    180       ;; 
    181       -i) 
    182          # directory for inputs choosen by user 
    183          indir=${2} 
    184          shift 
    185       ;; 
    186       -o) 
    187          # directory for outputs choosen by user 
    188          outdir=${2} 
    189          shift 
    190       ;; 
    191       -t) 
    192          # directory for temporary outputs choosen by user 
    193          tempdir=${2} 
    194          shift 
    195       ;; 
    196       -s) 
    197          # directory for SAXO tools 
    198          saxo_dir=${2} 
    199          shift 
    200       ;; 
    201       -idl_cmd) 
    202         # command for idl 
    203         idl_cmd=${2} 
    204         shift 
    205       ;; 
    206       *) 
    207          # other choice 
    208          echo "eee : unknown option ${1}" 
    209          echo "${usage}" 
    210          # nb : no exit because this file should be launched by login process 
    211       ;; 
    212    esac 
    213    # next flag 
    214    shift 
     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}" 
     220            # nb : no exit because this file should be launched by login process 
     221        ;; 
     222    esac 
     223    # next flag 
     224    shift 
    215225done 
    216226unset usage 
     
    219229if [ ! -d ${directory} ] 
    220230then 
    221    echo " eee : ${directory} not found" 
    222    # nb : no exit because this file should be launched by login process 
     231    echo " eee : ${directory} not found" 
     232    # nb : no exit because this file should be launched by login process 
    223233fi 
    224234# 
     
    226236if [ ! -x ${directory} ] 
    227237then 
    228    echo " eee : ${directory} not reachable" 
    229    # nb : no exit because this file should be launched by login process 
     238    echo " eee : ${directory} not reachable" 
     239    # nb : no exit because this file should be launched by login process 
    230240fi 
    231241# 
     
    241251if [ ${test_path} -ne 0 ] 
    242252then 
    243    PATH=${suppath}:${PATH} 
    244    export PATH 
     253    PATH=${suppath}:${PATH} 
     254    export PATH 
    245255else 
    246    # option bavarde oui/non pas encore implantée ++ 
    247    echo "${command} : iii : ${suppath} already in \${PATH}" 
     256    # option bavarde oui/non pas encore implantée ++ 
     257    echo "${command} : iii : ${suppath} already in \${PATH}" 
    248258fi 
    249259unset test_path 
     
    256266if [ ${test_manpath} -ne 0 ] 
    257267then 
    258    MANPATH=${suppath}:${MANPATH} 
    259    export MANPATH 
     268    MANPATH=${suppath}:${MANPATH} 
     269    export MANPATH 
    260270else 
    261    # option bavarde oui/non pas encore implantée ++ 
    262    echo "${command} : iii : ${suppath} already in \${MANPATH}" 
     271    # option bavarde oui/non pas encore implantée ++ 
     272    echo "${command} : iii : ${suppath} already in \${MANPATH}" 
    263273fi 
    264274unset test_manpath 
     
    270280if [ ! -d ${PROJECT_LOG} ] 
    271281then 
    272    mkdir -p ${PROJECT_LOG} 
    273    status=${?} 
    274    if [ ${status} -ne 0 ] 
    275    then 
    276       echo "${command} : eee : can not create \${PROJECT_LOG}" 
    277       # nb : no exit because this file should be launched by login process 
    278    else 
    279       echo "${command} : iii : creation of \${PROJECT_LOG}" 
    280    fi 
    281    unset status 
     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 
    282292fi 
    283293# check for permission on PROJECT_LOG 
    284294if [ ! -x ${PROJECT_LOG} ] 
    285295then 
    286    echo " eee : ${PROJECT_LOG} not reachable" 
    287    # nb : no exit because this file should be launched by login process 
     296    echo " eee : ${PROJECT_LOG} not reachable" 
     297    # nb : no exit because this file should be launched by login process 
    288298fi 
    289299# 
     
    291301if [ ! -w ${PROJECT_LOG} ] 
    292302then 
    293    echo " eee : ${PROJECT_LOG} not writable" 
    294    # nb : no exit because this file shouldreachable be launched by login process 
     303    echo " eee : ${PROJECT_LOG} not writable" 
     304    # nb : no exit because this file shouldreachable be launched by login process 
    295305fi 
    296306# 
     
    304314if [ ! -d ${PROJECT_ID} ] 
    305315then 
    306    mkdir -p ${PROJECT_ID} 
    307    echo "${command} : iii : creation of \${PROJECT_ID}" 
     316    mkdir -p ${PROJECT_ID} 
     317    echo "${command} : iii : creation of \${PROJECT_ID}" 
    308318fi 
    309319# check for permission on PROJECT_ID 
    310320if [ ! -x ${PROJECT_ID} ] 
    311321then 
    312    echo " eee : ${PROJECT_ID} not reachable" 
    313    # nb : no exit because this file should be launched by login process 
     322    echo " eee : ${PROJECT_ID} not reachable" 
     323    # nb : no exit because this file should be launched by login process 
    314324fi 
    315325# 
     
    325335if [ ! -x ${PROJECT_OD} ] 
    326336then 
    327    echo " eee : ${PROJECT_OD} not reachable" 
    328    # nb : no exit because this file should be launched by login process 
     337    echo " eee : ${PROJECT_OD} not reachable" 
     338    # nb : no exit because this file should be launched by login process 
    329339fi 
    330340if [ ! -w ${PROJECT_OD} ] 
    331341then 
    332    echo " eee : ${PROJECT_OD} not writable" 
    333    # nb : no exit because this file should be launched by login process 
     342    echo " eee : ${PROJECT_OD} not writable" 
     343    # nb : no exit because this file should be launched by login process 
    334344fi 
    335345# 
Note: See TracChangeset for help on using the changeset viewer.