1 | #!/bin/sh |
---|
2 | |
---|
3 | # Copyright (C) 2007 International Business Machines. |
---|
4 | # All Rights Reserved. |
---|
5 | # This file is distributed under the Common Public License. |
---|
6 | # It is part of the BuildTools project in COIN-OR (www.coin-or.org) |
---|
7 | # |
---|
8 | ## $Id: commit_new_release 799 2007-12-04 21:06:00Z andreasw $ |
---|
9 | # |
---|
10 | # Author: Andreas Waechter IBM 2007-06-21 |
---|
11 | |
---|
12 | #set -x -v |
---|
13 | |
---|
14 | set -e |
---|
15 | |
---|
16 | if test -r .new_release_data; then |
---|
17 | . .new_release_data |
---|
18 | else |
---|
19 | echo '' |
---|
20 | echo 'Error: You need to run prepare_new_release first.' |
---|
21 | echo '' |
---|
22 | exit -1; |
---|
23 | fi |
---|
24 | |
---|
25 | echo '' |
---|
26 | echo '===> Temporarily committing changed version of stable...' |
---|
27 | echo '' |
---|
28 | |
---|
29 | rev_num_before=`svn info . | grep -E '^Revision:' | sed -e 's|Revision: ||'` |
---|
30 | echo "Revision number before commit: $rev_num_before" |
---|
31 | |
---|
32 | cmd="svn ci -m \"temporarily committing release candidate to stable\"" |
---|
33 | echo $cmd |
---|
34 | eval $cmd |
---|
35 | |
---|
36 | cmd='svn update' |
---|
37 | echo $cmd |
---|
38 | eval $cmd |
---|
39 | |
---|
40 | rev_num=`svn info . | grep -E '^Revision:' | sed -e 's|Revision: ||'` |
---|
41 | echo "Current revision number is: $rev_num" |
---|
42 | |
---|
43 | echo '' |
---|
44 | echo "===> Creating new release $new_ver from stable $stable_branch (rev $rev_num)..." |
---|
45 | echo '' |
---|
46 | |
---|
47 | new_rel_url=$base_url/releases/$new_ver |
---|
48 | cmd="svn copy -m \"creating releases/$new_ver from stable/$stable_branch (rev $rev_num)\" $stable_url $new_rel_url" |
---|
49 | echo $cmd |
---|
50 | eval $cmd |
---|
51 | |
---|
52 | if test -r Externals; then |
---|
53 | echo '' |
---|
54 | echo '===> Restoring original externals...' |
---|
55 | echo '' |
---|
56 | |
---|
57 | mv Externals.bak Externals |
---|
58 | svn pset svn:externals -F Externals . |
---|
59 | fi |
---|
60 | |
---|
61 | conf_ac_files=`find . -name 'configure.ac' | grep -v -E 'ThirdParty/.*/.*/configure.ac'` |
---|
62 | |
---|
63 | echo '' |
---|
64 | echo "===> Restoring version number (${stable_branch}stable) in configure.ac files" |
---|
65 | for i in $conf_ac_files; do |
---|
66 | sed -e "s|AC_INIT\(.*\)\[[0-9\.]*\],\(.*\)|AC_INIT\1[${stable_branch}stable],\2|" $i > bla |
---|
67 | mv bla $i |
---|
68 | svn di $i |
---|
69 | done |
---|
70 | |
---|
71 | echo '' |
---|
72 | echo '===> Running the autotools' |
---|
73 | echo '' |
---|
74 | curdir=`pwd` |
---|
75 | cd $tmpbas |
---|
76 | BuildTools/run_autotools |
---|
77 | cd "$curdir" |
---|
78 | |
---|
79 | echo '' |
---|
80 | echo '===> Committing restored stable...' |
---|
81 | echo '' |
---|
82 | |
---|
83 | cmd="svn ci -m \"restoring stable/$stable_branch\"" |
---|
84 | echo $cmd |
---|
85 | eval $cmd |
---|
86 | |
---|
87 | echo '' |
---|
88 | echo "Done, new release $new_rel_url created" |
---|
89 | echo '' |
---|
90 | echo "You can now delete the directory $tmpbas including subdirectories" |
---|
91 | |
---|
92 | rm .new_release_data |
---|