source: stable/0.5/commit_new_release @ 1695

Last change on this file since 1695 was 1272, checked in by andreasw, 11 years ago

synchronized BuildTools?/stable/0.5 with trunk rev 1271

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
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 1272 2009-04-24 16:33:02Z tkr $
9#
10# Author: Andreas Waechter     IBM      2007-06-21
11# Modified by: Lou Hafer       SFU      2008-04-17
12
13#set -x -v
14
15set -e
16
17# Remember what was done during release generation.
18
19if test -r .new_release_data; then
20  . .new_release_data
21else
22  echo ''
23  echo 'Error: You need to run prepare_new_release first.'
24  echo ''
25  exit -1;
26fi
27
28# Commit the release to stable so we can do a repository-side copy to create
29# the release.
30
31echo ''
32echo '===> Temporarily committing changed version of stable...'
33echo ''
34
35rev_num_before=`svn info . | grep -E '^Revision:' | sed -e 's|Revision: ||'`
36echo "Revision number before commit: $rev_num_before"
37
38cmd="svn ci -m \"temporarily committing release candidate to stable\""
39echo $cmd
40eval $cmd
41
42# Update to confirm the commit. Avoid pulling in externals --- if we're doing
43# circular dependencies, they may not exist. As it stands, the main purpose of
44# this call is to allow us to easily obtain the current revision. It might be
45# useful to strengthen this and check that the value is what we're expecting
46# --- one greater than the revision before commit. `--ignore-externals' could
47# be made provisional on the existence of circular dependency by passing a
48# boolean through .new_release_data. This would strengthen the update, in that
49# the update would confirm existence of the externals.
50
51cmd='svn update --ignore-externals'
52echo $cmd
53eval $cmd
54
55rev_num=`svn info . | grep -E '^Revision:' | sed -e 's|Revision: ||'`
56echo "Current revision number is: $rev_num"
57
58# Create the release with a repository-side copy.
59
60echo ''
61echo "===> Creating new release $new_ver from stable $stableBranch (rev $rev_num)..."
62echo ''
63
64cmd="svn copy -m \"creating releases/$new_ver from stable/$stableBranch (rev $rev_num)\" $stableURL $releaseURL"
65echo $cmd
66eval $cmd
67
68# And restore the stable branch to it's original condition. Start by reverting
69# to the original externals.
70
71if test -r Externals; then
72  echo ''
73  echo '===> Restoring original externals...'
74  echo ''
75
76  mv Externals.bak Externals
77  svn pset svn:externals -F Externals .
78fi
79
80# Revert the package id in configure.ac and propagate with run_autotools.  Note
81# that this does not exclude configure.ac for externals in the normal place.
82# But since changes to externals are not swept up by the commit, it doesn't
83# matter. On the other hand, if this whole checkout is a temporary for the
84# purpose of release generation, I'm not entirely convinced we need to bother
85# to exclude configure.ac in the actual ThirdParty code base. Comments from
86# ThirdParty maintainers welcome.
87
88conf_ac_files=`find . -name 'configure.ac' | grep -v -E 'ThirdParty/.*/.*/configure.ac'`
89
90echo ''
91echo "===> Restoring version number (${stableBranch}stable) in configure.ac files"
92for i in $conf_ac_files; do
93  sed -e "s|AC_INIT\(.*\)\[[0-9\.]*\],\(.*\)|AC_INIT\1[${stableBranch}stable],\2|" $i > bla
94  mv bla $i
95  svn di $i
96done
97
98echo ''
99echo '===> Running the autotools'
100echo ''
101curdir=`pwd`
102cd $buildBase
103BuildTools/run_autotools
104cd "$curdir"
105
106# Commit the restored stable branch.
107
108echo ''
109echo '===> Committing restored stable...'
110echo ''
111
112cmd="svn ci -m \"restoring stable/$stableBranch\""
113echo $cmd
114eval $cmd
115
116echo ''
117echo "Done, new release $releaseURL created"
118echo ''
119echo "You can now delete the directory $buildBase including subdirectories"
120
121rm .new_release_data
Note: See TracBrowser for help on using the repository browser.