source: modipsl/trunk/util/recup_my_ORCHIDEE @ 1832

Last change on this file since 1832 was 1832, checked in by jgipsl, 12 years ago

Added script developped by Martial, also stored at ORCHIDEE svn. Only for orchidee offline :

  • extract a non default ORCHIDEE_OL configuration
  • for exemple a branch, the trunk or a personla branch.
  • this script is a "surcouche" a model.
  • this script uses the configuration ORCHIDEE_SVN_DEV in mod.def
  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3# Usage : This script should be used in modipsl/util directory
4# ./recup_my_ORCHIDEE MYUSERNAME MYBRANCHE [REV]
5#    MYUSERNAME  : your personal login(firstname.lastname) or sechiba
6#    MYBRANCH    : your personal directory, for exemple perso/martial.mancip
7#                  or another branch, for example branches/Hydrology
8#    REV         : optional revison number on branch, default is HEAD revision
9#
10# For exemple :
11# ./recup_my_ORCHIDEE martial.mancip perso/martial.mancip
12# ./recup_my_ORCHIDEE martial.mancip branches/Hydrology
13# ./recup_my_ORCHIDEE sechiba        trunk
14
15
16MYUSERNAME=$1
17MYBRANCH=$2
18REV=$3
19
20svn revert mod.def
21
22sed -e "s/--username sechiba/--username ${MYUSERNAME}/" mod.def > mod.def.tmp
23mv mod.def.tmp mod.def
24sed -e "s&perso/yourlogin&${MYBRANCH}&" mod.def > mod.def.tmp
25mv mod.def.tmp mod.def
26sed -e "s&#-H- ORCHIDEE_SVN_DEV  ORCHIDEE trunk&#-H- ORCHIDEE_SVN_DEV  ORCHIDEE ${MYBRANCH} &" mod.def > mod.def.tmp
27mv mod.def.tmp mod.def
28
29# Extract a specific revision number if argument REV is given
30if [ X$REV != X ] ; then
31    # Test first if REV is a positive number or HEAD
32    if [ $REV == HEAD ] || [ $REV -gt 0 ] ; then
33        echo "Extract revision $REV"
34    else
35        echo "ERROR in third argument. It should be a revison number or HEAD"
36        exit
37    fi
38    sed -e "s&#-C- ORCHIDEE_SVN_DEV  \(.*\)?&#-C- ORCHIDEE_SVN_DEV  \1${REV}&" mod.def > mod.def.tmp
39    mv mod.def.tmp mod.def
40fi
41
42echo "diff changes in mod.def :"
43svn diff mod.def
44
45./model ORCHIDEE_SVN_DEV
46
Note: See TracBrowser for help on using the repository browser.