Changeset 1593


Ignore:
Timestamp:
11/25/11 11:31:59 (12 years ago)
Author:
mmaipsl
Message:

Problem with an UTF-8 underscore...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/trunk/util/script_diff_model

    r1584 r1593  
    4141# env must know MODIPSL path variable ! 
    4242MODIPSL=${MODIPSL:=$(pwd)} 
     43SUBMIT_DIR=$1 
    4344 
    4445DEBUG_mode=false 
     
    177178        case ${ModelSystems[$i]} in 
    178179            svn) 
    179                 ListPathRev[$i]=$( svn info ${filecomp} | grep "R.vision *:" | gawk -F  ' ' '{print $2}' ) 
     180                ListPathRev[$i]=$( svn info ${filecomp} | grep "R.vision_*:" | gawk -F  ' ' '{print $2}' ) 
    180181                ListPathBranch[$i]=${comp} 
    181182                 
     
    292293 
    293294done 
     295 
     296if [ -d ${SUBMIT_DIR} ] ; then 
     297    echo "Save SUBMIT_DIR : " ${SUBMIT_DIR} 
     298    echo 
     299    pathComp=$( basename ${SUBMIT_DIR} ) 
     300    LocalDirectories[$i]=$( find . -mindepth 1 -type d \ 
     301        \( -not -path "*${MODIPSL_SAVE_NAME}*" -a -name "${pathComp}" \) | head -1 ) 
     302    ModelDirectories[$i]=. 
     303 
     304    ListPathComp[$i]=${pathComp} 
     305 
     306    cd ${SUBMIT_DIR} 
     307    SpathComp=${MODIPSL_SAVE}/${LocalDirectories[$i]} 
     308 
     309    save_diff_file=${pathComp} 
     310             
     311    ListPathRev[$i]=$( svn info | grep "R.vision_*:" | gawk -F  ' ' '{print $2}' ) 
     312     
     313    svn diff > ${MODIPSL}/svn_diff_${save_diff_file} 
     314    RET=$? 
     315    if [ $RET -gt 0 ] ; then 
     316        ListPathComp[$i]="error" 
     317        ListPathFile[$i]="error" 
     318        ListPathRev[$i]="error" 
     319        ListPathBranch[$i]="error" 
     320    else 
     321        svn status > ${MODIPSL}/svn_status_${save_diff_file} 
     322        set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${MODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" ) 
     323        printDebugArray NewFiles 
     324        for file in ${NewFiles[@]} ; do 
     325            echo "New file : " $file 
     326            cp -p $file ${SpathComp}/$( dirname $file ) 
     327            ListNewFiles[$NbNewFiles]=${pathComp}/${file} 
     328            (( NbNewFiles = NbNewFiles + 1 )) 
     329        done 
     330 
     331        set -A ModifiedFiles -- $( grep "^M *" ${MODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" ) 
     332        printDebugArray ModifiedFiles 
     333        for file in ${ModifiedFiles[@]} ; do 
     334            echo "Modified file : " $file 
     335            filedate=$( ls -l --full-time --time-style='+%Y%m%d%H%M%S' $file | gawk -F  ' ' '{print $6}' ) 
     336            Maxfiledate=$(( ( $Maxfiledate > $filedate ) ? $Maxfiledate : $filedate )) 
     337            ListModifFiles[$NbModifFiles]=${pathComp}/${file} 
     338            ListModifFilesDate[$NbModifFiles]=${filedate} 
     339            (( NbModifFiles = NbModifFiles + 1 )) 
     340        done 
     341 
     342        if ( ${DEBUG_mode} ); then  
     343            cp ${MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 
     344        else 
     345            rm ${MODIPSL}/svn_status_${save_diff_file} 
     346            mv ${MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 
     347        fi 
     348        RET=$? 
     349        if [ $RET -gt 0 ] ; then 
     350            ListPathComp[$i]="error" 
     351            ListPathFile[$i]="error" 
     352            ListPathRev[$i]="error" 
     353            ListPathBranch[$i]="error" 
     354        fi 
     355    fi 
     356     
     357    echo  
     358    cd ${MODIPSL} 
     359fi 
     360 
    294361printDebugArray ListPathComp 
    295362printDebugArray ListPathFile 
Note: See TracChangeset for help on using the changeset viewer.