Ignore:
Timestamp:
02/19/14 16:16:49 (10 years ago)
Author:
pinsard
Message:

fix thanks to coding rules; typo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install_superbib.sh

    r325 r352  
    2626# 
    2727# .. option:: -lf  <login on forge.ipsl.jussieu.fr> 
    28 # .. option:: -d   <directory where executable, input and output will be written> 
     28# 
     29# .. option:: -d   <directory> 
     30# 
     31#    where executable, input and output will be written 
    2932# 
    3033# On the first usage of this tool, :file:`${tempdir}/for_install_superbib/` 
     
    8588system=$(uname) 
    8689case "${system}" in 
    87    AIX|IRIX64) 
    88       echo "${command} : www : no specific posix checking" 
    89    ;; 
    90    *) 
    91       set -o posix 
    92    ;; 
     90    AIX|IRIX64) 
     91        echo "${command} : www : no specific posix checking" 
     92    ;; 
     93    *) 
     94        set -o posix 
     95    ;; 
    9396esac 
    9497unset system 
     
    101104if [ "${PROJECT_LOG}" = "" ] 
    102105then 
    103    echo "${command} : eee : \${PROJECT_LOG} not defined" 
    104    exit 1 
     106    echo "${command} : eee : \${PROJECT_LOG} not defined" 
     107    exit 1 
    105108fi 
    106109# 
     
    108111if [ ! -d ${PROJECT_LOG} ] 
    109112then 
    110    echo "${command} : eee : ${PROJECT_LOG} not found" 
    111    exit 1 
     113    echo "${command} : eee : ${PROJECT_LOG} not found" 
     114    exit 1 
    112115fi 
    113116# 
     
    115118if [ ! -x ${PROJECT_LOG} ] 
    116119then 
    117    echo "${command} : eee : ${PROJECT_LOG} not reachable" 
    118    exit 1 
     120    echo "${command} : eee : ${PROJECT_LOG} not reachable" 
     121    exit 1 
    119122fi 
    120123# 
     
    122125if [ ! -w ${PROJECT_LOG} ] 
    123126then 
    124    echo "${command} : eee : ${PROJECT_LOG} not writable" 
    125    exit 1 
     127    echo "${command} : eee : ${PROJECT_LOG} not writable" 
     128    exit 1 
    126129fi 
    127130# 
     
    138141if [ ${#} -lt ${minargcount} ] 
    139142then 
    140    echo "${command} : eee : not enought arguments" 
    141    echo "${usage}" 
    142    exit 1 
     143    echo "${command} : eee : not enough arguments" 
     144    echo "${usage}" 
     145    exit 1 
    143146fi 
    144147unset minargcount 
     
    146149while [ ${#} -gt 0 ] 
    147150do 
    148    case ${1} in 
    149       -lf) 
    150          loginforgeipsl=${2} 
    151          shift 
    152       ;; 
    153       -h) 
    154          hostname=${2} 
    155          shift 
    156       ;; 
    157       -d) 
    158          directory=${2} 
    159          shift 
    160       ;; 
    161       *) 
    162          # anything else 
    163          echo "${command} : eee : unknown option ${1}" 
    164          echo "${command} : eee : ${usage}" 
    165          exit 1 
    166       ;; 
    167    esac 
    168    # next flag 
    169    shift 
     151    case ${1} in 
     152        -lf) 
     153            loginforgeipsl=${2} 
     154            shift 
     155        ;; 
     156        -h) 
     157            hostname=${2} 
     158            shift 
     159        ;; 
     160        -d) 
     161            directory=${2} 
     162            shift 
     163        ;; 
     164        *) 
     165            # anything else 
     166            echo "${command} : eee : unknown option ${1}" 
     167            echo "${command} : eee : ${usage}" 
     168            exit 1 
     169        ;; 
     170    esac 
     171    # next flag 
     172    shift 
    170173done 
    171174# 
     
    187190if [ ${svn_forge} -eq 1 ] 
    188191then 
    189    if [ "${loginforgeipsl}" = "" ] 
    190    then 
    191       echo "${command} : eee: loginforgeipsl must be defined" 
    192       exit 1 
    193    fi 
     192    if [ "${loginforgeipsl}" = "" ] 
     193    then 
     194        echo "${command} : eee: loginforgeipsl must be defined" 
     195        exit 1 
     196    fi 
    194197fi 
    195198# 
     
    199202domain=$(nslookup $(hostname) | grep Name: | cut -f 2 | cut -f 2- -d '.') 
    200203case ${domain} in 
    201    locean-ipsl.upmc.fr) 
    202       tempdir=/usr/temp/${LOGNAME}/ 
    203       local_svncfd=1 
    204    ;; 
    205    idris.fr) 
    206       tempdir=${WORKDIR}/ 
    207       local_svncfd=0 
    208    ;; 
     204    locean-ipsl.upmc.fr) 
     205        tempdir=/usr/temp/${LOGNAME}/ 
     206        local_svncfd=1 
     207    ;; 
     208    idris.fr) 
     209        tempdir=${WORKDIR}/ 
     210        local_svncfd=0 
     211    ;; 
    209212   *) 
    210       tempdir=/tmp/${LOGNAME}/ 
    211       local_svncfd=1 
     213       tempdir=/tmp/${LOGNAME}/ 
     214       local_svncfd=1 
    212215   ;; 
    213216esac 
     
    219222if [ -d ${tempdir}/for_install_superbib/ ] 
    220223then 
    221    # If ${tempdir}/for_install_superbib/ exists, we suppose it already 
    222    # contains files. 
    223    if [ ${svn_forge} -eq 1 ] 
    224    then 
    225       # We ask for update this working space 
    226       echo "${command} : iii : ${tempdir}/for_install_superbib/ already exists" 1>> ${log} 2>&1 
    227       echo "iii : You will be asked ${loginforgeipsl}@forge.ipsl.jussieu.fr passwd" 
    228       svn update ${tempdir}/for_install_superbib/ 
    229       svn_status=${?} 
    230       if [ ${svn_status} -ne 0 ] 
    231       then 
    232          echo "${command} : eee : pb with svn update forge" 1>> ${log} 2>&1 
    233          echo "${command} : iii : log is ${log}" 
    234          exit 1 
    235       fi 
    236    else 
    237       echo "${command} : iii : no svn forge update is asked" 1>> ${log} 2>&1 
    238    fi 
     224    # If ${tempdir}/for_install_superbib/ exists, we suppose it already 
     225    # contains files. 
     226    if [ ${svn_forge} -eq 1 ] 
     227    then 
     228        # We ask for update this working space 
     229        echo "${command} : iii : ${tempdir}/for_install_superbib/ already exists" 1>> ${log} 2>&1 
     230        echo "iii : You will be asked ${loginforgeipsl}@forge.ipsl.jussieu.fr passwd" 
     231        svn update ${tempdir}/for_install_superbib/ 
     232        svn_status=${?} 
     233        if [ ${svn_status} -ne 0 ] 
     234        then 
     235            echo "${command} : eee : pb with svn update forge" 1>> ${log} 2>&1 
     236            echo "${command} : iii : log is ${log}" 
     237            exit 1 
     238        fi 
     239    else 
     240        echo "${command} : iii : no svn forge update is asked" 1>> ${log} 2>&1 
     241    fi 
    239242else 
    240    mkdir -p ${tempdir}/for_install_superbib/ 
    241    if [ ${svn_forge} -eq 1 ] 
    242    then 
    243       # If ${tempdir}/for_install_superbib/ does not exist, we checkout 
    244       # files 
    245       echo "iii : You will be asked ${loginforgeipsl}@forge.ipsl.jussieu.fr passwd" 
    246       svn checkout svn+ssh://${loginforgeipsl}@forge.ipsl.jussieu.fr/ipsl/forge/projets/${project}/svn/trunk/ ${tempdir}/for_install_superbib/ 1>> ${log} 2>&1 
    247       svn_status=${?} 
    248       if [ ${svn_status} -ne 0 ] 
    249       then 
    250         echo "${command} : eee : pb with svn forge" 1>> ${log} 2>&1 
    251         echo "${command} : iii : log is ${log}" 
    252         exit 1 
    253       fi 
    254    else 
    255       echo "${command} : iii : no svn forge checkout is asked" 1>> ${log} 2>&1 
    256    fi 
     243    mkdir -p ${tempdir}/for_install_superbib/ 
     244    if [ ${svn_forge} -eq 1 ] 
     245    then 
     246        # If ${tempdir}/for_install_superbib/ does not exist, we checkout 
     247        # files 
     248        echo "iii : You will be asked ${loginforgeipsl}@forge.ipsl.jussieu.fr passwd" 
     249        svn checkout svn+ssh://${loginforgeipsl}@forge.ipsl.jussieu.fr/ipsl/forge/projets/${project}/svn/trunk/ ${tempdir}/for_install_superbib/ 1>> ${log} 2>&1 
     250        svn_status=${?} 
     251        if [ ${svn_status} -ne 0 ] 
     252        then 
     253            echo "${command} : eee : pb with svn forge" 1>> ${log} 2>&1 
     254            echo "${command} : iii : log is ${log}" 
     255            exit 1 
     256        fi 
     257    else 
     258        echo "${command} : iii : no svn forge checkout is asked" 1>> ${log} 2>&1 
     259    fi 
    257260fi 
    258261# 
Note: See TracChangeset for help on using the changeset viewer.