New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 12505 – NEMO

Changeset 12505


Ignore:
Timestamp:
2020-03-03T15:15:48+01:00 (4 years ago)
Author:
mathiot
Message:

#2304 : fix issues related to MY_SRC synchronisation when files are removed

Location:
utils/CI/sette_ticket2304
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • utils/CI/sette_ticket2304/all_functions.sh

    r12444 r12505  
    9393# sync MYSRC files (input CFG and CFG_ST) 
    9494sync_config() { 
    95    if [ ${SETTE_SYNC_CONFIGS} == "yes" ]; then 
     95   if [ ${SYNC_CONFIGS} == "yes" ]; then 
     96 
     97      echo "configuration $3/$2 will be synchronised with $3/$1" 
     98 
    9699      lREF=$3/$1    # reference  
    97100      lCFG=$3/$2    # target 
    98       if [ -d $lREF/MY_SRC ] && [ -d $lCFG/MY_SRC ] ; then 
    99          rsync $lREF/MY_SRC/* $lCFG/MY_SRC/. 
     101 
     102      # synchronise MY_SRC if $lCFG directory exist 
     103      if [ -d $lREF/MY_SRC ] && [ -d $lCFG ] ; then 
     104 
     105         if [ -d $lCFG/MY_SRC ] ; then 
     106 
     107            # Manage case number of file in MY_SRC changes 
     108            # find number of file only in $lCFG/MY_SRC 
     109            FCFG=`diff -r $lREF/MY_SRC $lCFG/MY_SRC | grep $lCFG/MY_SRC | awk '{print $4}'` 
     110 
     111            # if more than 0, trigger a cleaning as Makenemo do not properly manage this case. 
     112            if [ ! -z "$FCFG" ]; then  
     113               echo '' 
     114               echo "$lCFG contains a different file list than $lREF :" 
     115               diff -r $lREF/MY_SRC $lCFG/MY_SRC | grep $lCFG/MY_SRC | awk '{print $4}' 
     116               echo "Synchronisation is not enough because Makenemo does not handle well case where a file in MY_SRC is removed" 
     117               echo "Therefore, we need to clean $lCFG before starting runing it" 
     118               echo '' 
     119               CLEAN_CONFIGS="yes" 
     120            fi 
     121         fi 
     122 
     123         # synchronisation $lREF/MY_SRC directory (and delete file in target location if needed) 
     124         rsync -av --delete $lREF/MY_SRC/ $lCFG/MY_SRC 
    100125      fi 
    101126 
     127      # synchronize EXPREF 
    102128      if [ -d $lREF/EXPREF ] && [ -d $lCFG/EXP00 ] ; then 
    103129         rsync $lREF/EXPREF/*namelist*_cfg  $lCFG/EXP00/. 
     
    106132         rsync $lREF/EXPREF/file_def_*.xml  $lCFG/EXP00/. 
    107133      fi 
     134 
    108135   fi 
    109136} 
     
    111138# clean _ST config (input CFG CFG_ST TYPE (test or ref)) 
    112139clean_config() { 
    113    if [ ${SETTE_CLEAN_CONFIGS} == "yes" ]; then 
     140   if [ ${CLEAN_CONFIGS} == "yes" ]; then 
    114141      lREF=$1 
    115142      lCFG=$2 
     
    122149         echo 'ERROR in the cleaning process'; exit 42 
    123150      fi 
     151      echo '' 
     152      echo "$lCFG configuration has been cleaned" 
     153      echo '' 
    124154   fi 
    125155} 
     
    199229                NGRP=$(grep ${NAMGRP} ${EXE_DIR}/$1 | wc -l ) 
    200230                if [ ${NGRP} -eq 0 ]; then 
    201                    echo '' 
    202                    echo "+++++ Group ${NAMGRP} containing ${2} is missing in ${EXE_DIR}/$1 +++++ "       
    203                    echo "+++++ Group ${NAMGRP}                 is added   in ${EXE_DIR}/$1 +++++ "       
    204                    echo '' 
     231                   echo ''                                                                          >> ${SETTE_DIR}/output.sette 
     232                   echo "+++++ Group ${NAMGRP} containing ${2} is missing in ${EXE_DIR}/$1 +++++ "  >> ${SETTE_DIR}/output.sette 
     233                   echo "+++++ Group ${NAMGRP}                 is added   in ${EXE_DIR}/$1 +++++ "  >> ${SETTE_DIR}/output.sette 
     234                   echo ''                                                                          >> ${SETTE_DIR}/output.sette 
    205235                   echo "&${NAMGRP}" >> ${EXE_DIR}/$1 
    206236                   echo "/"          >> ${EXE_DIR}/$1 
  • utils/CI/sette_ticket2304/param.cfg

    r12431 r12505  
    6565#TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00 
    6666# cleaning CFG_ST 
    67 SETTE_CLEAN_CONFIGS=${SETTE_CLEAN_CONFIGS:-"no"} 
     67CLEAN_CONFIGS=${SETTE_CLEAN_CONFIGS:-"no"} 
    6868# synchronisation MY_SRC and EXP00 of CFG_ST with MY_SRC and EXPREF form CFG 
    69 SETTE_SYNC_CONFIGS=${SETTE_SYNC_CONFIGS:-"no"} 
     69SYNC_CONFIGS=${SETTE_SYNC_CONFIGS:-"no"} 
    7070# ------------------------------------------------------------------------------------------ 
    7171# 
  • utils/CI/sette_ticket2304/sette.sh

    r12444 r12505  
    99     case $option in 
    1010        c) export SETTE_CLEAN_CONFIGS='yes' 
     11           export SETTE_SYNC_CONFIGS='yes' 
    1112           echo "" 
    12            echo "Configuration $SETTE_TEST_CONFIGS will be cleaned" 
     13           echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation" 
    1314           echo "";; 
    1415        s) export SETTE_SYNC_CONFIGS='yes' 
Note: See TracChangeset for help on using the changeset viewer.