source: LMDZ6/branches/Amaury_dev/tools/fcm/test/create_repos @ 5095

Last change on this file since 5095 was 5095, checked in by abarral, 5 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

  • Property svn:executable set to *
File size: 6.7 KB
Line 
1#!/bin/ksh
2set -eu
3
4REPOS_FILES=$MY_BIN/repos
5
6echo "$(date): Creating repository ..."
7rm -rf $REPOS_DIR
8svnadmin create --fs-type fsfs $REPOS_DIR
9
10echo "$(date): Initial import ..."
11
12svn import -q $REPOS_FILES/trunk $REPOS_URL/trunk -m" "
13svn mkdir -q $REPOS_URL/branches -m" "
14svn mkdir -q $REPOS_URL/tags -m" "
15
16# Modify some files
17branch=modify_files_base
18fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
19rm -rf $BASE_DIR/work
20svn co -q $REPOS_URL/branches/dev/Share/$branch $BASE_DIR/work
21cd $BASE_DIR/work
22perl -pi -e 's/IMPLICIT NONE/implicit none/' program/hello.F90
23perl -pi -e 's/Hello Earth/Hello Earthlings/' module/hello_constants.inc
24svn ci -m" "
25
26# Modify some files, one of which can be merged with modify_files_base branch
27branch=modify_files_merge1
28fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
29svn sw $REPOS_URL/branches/dev/Share/$branch
30perl -pi -e "s/this = 'Hello'/this = 'HELLO'/" program/hello.F90
31perl -pi -e 's/Hello Earth/Hello Earthlings/' subroutine/hello_c.c
32svn ci -m" "
33
34# Modify a file which can be merged with the modify_files_base & modify_files_merge1 branches
35branch=modify_files_merge2
36fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
37svn sw $REPOS_URL/branches/dev/Share/$branch
38perl -pi -e 's/PROGRAM/program/' program/hello.F90
39svn ci -m" "
40
41# Modify a file which clashes with modify_files_base branch
42branch=modify_files_clash
43fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
44svn sw $REPOS_URL/branches/dev/Share/$branch
45perl -pi -e 's/IMPLICIT NONE/implicit NONE/' program/hello.F90
46svn ci -m" "
47
48# Modify a subroutine without altering its interface
49branch=modify_subroutine
50fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
51svn sw $REPOS_URL/branches/dev/Share/$branch
52perl -pi -e 's/integer (common)/integer (com)/' subroutine/hello_sub.F90
53svn ci -m" "
54
55# Modify a subroutine and alter its interface
56branch=modify_subroutine_interface
57fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
58svn sw $REPOS_URL/branches/dev/Share/$branch
59perl -pi -e 's/integer_arg/int_arg/' subroutine/hello_sub.F90
60svn ci -m" "
61
62# Modify a pre-processing include file
63branch=modify_pp_include
64fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
65svn sw $REPOS_URL/branches/dev/Share/$branch
66perl -pi -e 's/:/: Message - /' subroutine/hello_sub.h
67svn ci -m" "
68
69# Add lines to a file to coincide with following branch
70branch=add_lines
71fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
72svn sw $REPOS_URL/branches/dev/Share/$branch
73cp $REPOS_FILES/add_subroutine/hello.F90.add_lines program/hello.F90
74svn ci -m" "
75
76# Add a new file
77branch=add_file
78fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
79svn sw $REPOS_URL/branches/dev/Share/$branch
80cp $REPOS_FILES/add_subroutine/hello.F90 program/hello.F90
81cp $REPOS_FILES/add_subroutine/hello_sub2.f90 subroutine
82svn add subroutine/hello_sub2.f90
83svn ci -m" "
84
85# Add a new directory
86branch=add_directory
87fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
88svn sw $REPOS_URL/branches/dev/Share/$branch
89cp $REPOS_FILES/add_subroutine/hello.F90 program/hello.F90
90mkdir subroutine2
91cp $REPOS_FILES/add_subroutine/hello_sub2.f90 subroutine2
92svn add subroutine2
93svn ci -m" "
94
95# Add a duplicate subroutine
96branch=add_duplicate
97fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
98svn sw $REPOS_URL/branches/dev/Share/$branch
99cp subroutine/hello_sub.F90 subroutine/hello_sub2.F90
100svn add subroutine/hello_sub2.F90
101svn ci -m" "
102
103# Delete a file
104branch=delete_file
105fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
106svn sw $REPOS_URL/branches/dev/Share/$branch
107svn rm subroutine/hello_c.c
108svn ci -m" "
109
110# Delete a CPP file
111branch=delete_pp_file
112fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
113svn sw $REPOS_URL/branches/dev/Share/$branch
114svn rm subroutine/hello_sub.F90
115svn ci -m" "
116
117# Delete a Fortran include file
118branch=delete_inc_file
119fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
120svn sw $REPOS_URL/branches/dev/Share/$branch
121svn rm module/hello_constants.inc
122svn ci -m" "
123
124# Delete a CPP include file
125branch=delete_ppinc_file
126fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
127svn sw $REPOS_URL/branches/dev/Share/$branch
128svn rm subroutine/hello_sub.h
129svn ci -m" "
130
131# Delete a directory
132branch=delete_directory
133fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
134svn sw $REPOS_URL/branches/dev/Share/$branch
135svn rm subroutine
136svn ci -m" "
137
138# Rename the executable
139branch=exe_rename
140fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
141svn sw $REPOS_URL/branches/dev/Share/$branch
142perl -pi -e 's/hello.exe/hello_world.exe/' script/hello.sh
143svn ci -m" "
144
145# Use a .f90 file as an include file
146branch=change_src_type
147fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
148svn sw $REPOS_URL/branches/dev/Share/$branch
149perl -pi -e 's/hello_constants.inc/hello_constants_inc.f90/g' module/hello_constants_dummy.inc
150svn mv module/hello_constants.inc module/hello_constants_inc.f90
151svn ci -m" "
152
153# Add a symbolic link
154branch=symbolic_link
155fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
156svn sw $REPOS_URL/branches/dev/Share/$branch
157cd subroutine
158ln -s hello_sub.F90 hello_sub2.F90
159svn add hello_sub2.F90
160cd $OLDPWD
161svn ci -m" "
162
163# Use space in a path name
164branch=space_in_name
165fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
166svn sw $REPOS_URL/branches/dev/Share/$branch
167svn mv blockdata/hello_blockdata.F90 "blockdata/hello blockdata.F90"
168svn mv --force blockdata "block data"
169svn ci -m" "
170
171# Create a cylc dependency which will fail
172branch=cyclic_dep_fail
173fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
174svn sw $REPOS_URL/branches/dev/Share/$branch
175cp $REPOS_FILES/cyclic_dependency/hello.F90 program/hello.F90
176cp $REPOS_FILES/cyclic_dependency/hello_constants.f90.fail module/hello_constants.f90
177svn ci -m" "
178
179# Create a cylc dependency which should be OK
180branch=cyclic_dep_ok
181fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
182svn sw $REPOS_URL/branches/dev/Share/$branch
183cp $REPOS_FILES/cyclic_dependency/hello.F90 program/hello.F90
184cp $REPOS_FILES/cyclic_dependency/hello_constants.f90.ok module/hello_constants.f90
185cp $REPOS_FILES/cyclic_dependency/hello_sub2.f90 subroutine
186svn add subroutine/hello_sub2.f90
187svn ci -m" "
188
189# Create a dependency which needs to be defined manually
190branch=f77_dep
191fcm bc -t SHARE --rev-flag NONE --non-interactive $branch $REPOS_URL@1
192svn sw $REPOS_URL/branches/dev/Share/$branch
193perl -pi -e 's/INCLUDE /!INCLUDE /' program/hello.F90
194svn ci -m" "
195
196rm -rf $BASE_DIR/work
197echo "$(date): Finished"
Note: See TracBrowser for help on using the repository browser.