Ignore:
Timestamp:
10/16/12 13:04:38 (12 years ago)
Author:
sdipsl
Message:
  • curie, titane, mercurex9, mercure : minor bugfixes coming from r716 and r717. Further systematic loop over cp command
  • obelix, vargas, ulam : cosmetics
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh

    r714 r719  
    509509#D-  Error values and explanations can depend on your system version. 
    510510function IGCM_sys_Rsync_out { 
    511   RET=$1 
    512   if [ ! $RET ] ; then 
     511  status=$1 
     512  if [ ! $status ] ; then 
    513513    echo "rsync error !" 
    514514  fi 
    515515 
    516516  if [ $MYLANG = "fr" ]; then 
    517     case $RET in 
     517    case $status in 
    518518    0)  return ;; 
    519519    1)  echo "Erreur de rsync ; RERR_SYNTAX : " 
     
    563563      echo "Temps d'attente écoulé dans l'envoi/réception de données" 
    564564      return;; 
    565     *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 
     565    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status 
    566566      return;; 
    567567    esac 
    568568  elif [ $MYLANG = "en" ] ; then 
    569     case $RET in 
     569    case $status in 
    570570    0)  return;; 
    571571    1)  echo "rsync error : Syntax or usage error " 
     
    604604    30) echo "rsync error : Timeout in data send/receive " 
    605605      return;; 
    606     *)  echo "rsync error : return code of rsync unknown :" $RET 
     606    *)  echo "rsync error : return code of rsync unknown :" $status 
    607607      return;; 
    608608    esac 
     
    624624  fi 
    625625 
    626   typeset RET 
     626  typeset status 
    627627 
    628628  echo cp $@ > out_rsync 2>&1 
    629629  \cp $@ >> out_rsync 2>&1 
    630   RET=$? 
    631  
    632   if [ ${RET} -gt 0 ] ; then 
     630  status=$? 
     631 
     632  if [ ${status} -gt 0 ] ; then 
    633633    echo "IGCM_sys_Cp : error." 
    634634    cat out_rsync 
     
    649649  fi 
    650650 
    651   typeset RET 
     651  typeset status 
    652652 
    653653  echo rm $@ > out_rsync 2>&1 
    654654  \rm $@ >> out_rsync 2>&1 
    655   RET=$? 
    656  
    657   if [ ${RET} -gt 0 ] ; then 
     655  status=$? 
     656 
     657  if [ ${status} -gt 0 ] ; then 
    658658    echo "IGCM_sys_Rm : error." 
    659659    cat out_rsync 
     
    691691  if [ $DRYRUN = 0 ]; then 
    692692 
    693     typeset RET 
     693    typeset status 
    694694 
    695695    echo mv $@ > out_rsync 2>&1 
    696696    \mv $@ >> out_rsync 2>&1 
    697     RET=$? 
    698  
    699     if [ ${RET} -gt 0 ] ; then 
     697    status=$? 
     698 
     699    if [ ${status} -gt 0 ] ; then 
    700700      echo "IGCM_sys_Mv : error in mv." 
    701701      cat out_rsync 
     
    726726    fi 
    727727 
    728     typeset RET 
     728    typeset status 
    729729 
    730730    # Only if we use rsync 
     
    733733    #USUAL WAY 
    734734    rcp -r $1 gaya:$2 > out_rsync 2>&1 
    735     RET=$? 
    736  
    737     if [ ${RET} -gt 0 ] ; then 
     735    status=$? 
     736 
     737    if [ ${status} -gt 0 ] ; then 
    738738      echo "IGCM_sys_Put_Dir : error." 
    739739      cat out_rsync 
     
    768768#       fi 
    769769 
    770     typeset RET 
     770    typeset status 
    771771 
    772772    #USUAL WAY 
    773773    rcp -rp gaya:$1 $2 > out_rsync 2>&1 
    774     RET=$? 
    775  
    776     if [ ${RET} -gt 0 ] ; then 
     774    status=$? 
     775 
     776    if [ ${status} -gt 0 ] ; then 
    777777      echo "IGCM_sys_Get_Dir : error." 
    778778      cat out_rsync 
     
    803803    fi 
    804804 
    805     typeset RET 
     805    typeset status 
    806806 
    807807    #USUAL WAY 
    808808    rcp -r ${MASTER}:$1 $2 > out_rsync 2>&1 
    809     RET=$? 
    810  
    811     if [ ${RET} -gt 0 ] ; then 
     809    status=$? 
     810 
     811    if [ ${status} -gt 0 ] ; then 
    812812      echo "IGCM_sys_Get_Master : error." 
    813813      cat out_rsync 
     
    837837    fi 
    838838 
    839     typeset RET 
     839    typeset status 
    840840        # 
    841841    if [ X${JobType} = XRUN ] ; then 
     
    848848    # USUAL WAY 
    849849    mfput $1 $2 > out_rsync 2>&1 
    850     RET=$? 
     850    status=$? 
    851851 
    852852#       #RSYNC WITH NETWORK RSH CALL 
     
    858858#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 
    859859 
    860 #       RET=$? 
    861 #       IGCM_sys_Rsync_out $RET 
     860#       status=$? 
     861#       IGCM_sys_Rsync_out $status 
    862862 
    863863#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    864 #       (( RET=RET+$? )) 
    865  
    866     if [ ${RET} -gt 0 ] ; then 
     864#       (( status=status+$? )) 
     865 
     866    if [ ${status} -gt 0 ] ; then 
    867867      echo "IGCM_sys_Put_Out : error." 
    868868      cat out_rsync 
     
    870870            # 
    871871      mfput $1 $2 > out_rsync 2>&1 
    872       RET=$? 
     872      status=$? 
    873873            # 
    874       if [ ${RET} -gt 0 ] ; then 
     874      if [ ${status} -gt 0 ] ; then 
    875875        echo "IGCM_sys_Put_Out : error." 
    876876        IGCM_debug_Print 1 "mfput failed twice. You have a problem" 
     
    894894  IGCM_debug_PushStack "IGCM_sys_Get" $@ 
    895895 
    896   typeset DEST RET dm_liste ifile target 
     896  typeset DEST status dm_liste ifile target 
    897897 
    898898  if ( $DEBUG_sys ) ; then 
     
    910910    # test if the (first) file is present in the old computation : 
    911911    IGCM_sys_TestFileArchive ${dm_liste[0]} 
    912     RET=$? 
    913     if [ ${RET} -gt 0 ] ; then 
     912    status=$? 
     913    if [ ${status} -gt 0 ] ; then 
    914914      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 
    915915      IGCM_debug_Exit "IGCM_sys_Get" 
     
    942942#   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 
    943943 
    944 #   RET=$? 
    945 #   IGCM_sys_Rsync_out $RET 
     944#   status=$? 
     945#   IGCM_sys_Rsync_out $status 
    946946 
    947947#   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 
    948 #   (( RET=RET+$? )) 
     948#   (( status=status+$? )) 
    949949 
    950950  else 
     
    974974    fi 
    975975 
    976     typeset RET 
     976    typeset status 
    977977    # 
    978978    rsh gaya exec /bin/ksh <<EOF 
     
    984984          /bin/chmod -R u+w ${R_SAVE}/${1} 
    985985EOF 
    986     RET=$? 
    987  
    988     if [ ${RET} -gt 0 ] ; then 
     986    status=$? 
     987 
     988    if [ ${status} -gt 0 ] ; then 
    989989      echo "IGCM_sys_Put_Dods : error." 
    990990      IGCM_debug_Exit "IGCM_sys_Put_Dods" 
Note: See TracChangeset for help on using the changeset viewer.