Changeset 1733 for modipsl/branches


Ignore:
Timestamp:
05/21/12 18:23:44 (12 years ago)
Author:
jgipsl
Message:

Added new functionnality in model :

In mod.def, if the component path is preceded with "DEFAULT:" then model will ask to confirm this path or to type a new path. model will also ask for the revision number for the same component. If argument -d (for default) the default components will be used.

For exemple, in mod.def config LMDZOR_v5 :
#-C- LMDZOR_v5 DEFAULT:LMDZ5/trunk 1575 11 LMDZ modeles

In this exemple, LMDZ5/trunk can be changed to LMDZ4/branches/LMDZ4_AR5 (or other). And revision number 1575 can be changed as wish.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/branches/newconfig/util/model

    r1616 r1733  
    1616#- 
    1717m_n=""; m_a="checkout"; m_v='silencious'; no_tag='false'; 
    18 while getopts :hevH V 
     18# Option -d to take default set up without asking 
     19changeok='yes' 
     20while getopts :hevdH V 
    1921  do 
    2022    case $V in 
     
    2224      (e)  m_a='checkout';; 
    2325      (v)  m_v='verbose';; 
     26      (d)  changeok='no';; 
    2427      (H)  no_tag='true';; 
    2528      (:)  echo ${b_n}" : option $OPTARG : missing value" 1>&2; 
     
    189192    echo 'H            : suppress the tags and take the HEAD version'; 
    190193    echo 'v            : verbose mode'; 
     194    echo 'd            : extract default components without option to change'; 
    191195    echo 'Defaults     : -e'; 
    192196    echo ' '; 
     
    266270    zp=${m_p[${qi}]}; zs=${m_s[${qi}]}; 
    267271    zd=${m_d[${qi}]}; zl=${m_l[${qi}]}; 
     272 
     273# Maybe change some information marked with DEFAULT.  
     274# Check if key word DEFAULT is used in component name 
     275    defcomp=$(echo ${zc} | awk -FDEFAULT: '{print $2}') 
     276    if [ X$defcomp != X ] ; then 
     277        if [ $changeok == 'yes' ] ; then 
     278            echo "=> Default component $defcomp can be changed." 
     279            echo "   Do you want to change this path ? Type new path or return for the above default." 
     280            read newcomp 
     281            echo "   Type revision number for chosen component version or return for $zt default value" 
     282            read newrev 
     283            if [ X$newcomp == X ] ; then 
     284                zc=$defcomp 
     285            else 
     286                zc=$newcomp 
     287            fi 
     288 
     289            if [ X$newrev != X ] ; then 
     290                zt=$newrev 
     291            fi 
     292        else 
     293            # changeok=no : Take default value# 
     294            zc=$defcomp 
     295        fi 
     296    fi 
    268297    [[ ${m_v} = 'verbose' ]] && \ 
    269298     { echo '---'; 
Note: See TracChangeset for help on using the changeset viewer.