source: stable/20130000/bin/new_release.sh @ 2757

Last change on this file since 2757 was 2757, checked in by bradbell, 7 years ago
  1. Relevant part of bug fix to limits.cpp in trunk

between revision 2755 and 2756.

  1. Advance release number from 1 to 2.
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#! /bin/bash -e
2# $Id: new_release.sh 2757 2013-02-27 20:10:22Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
5#
6# CppAD is distributed under multiple licenses. This distribution is under
7# the terms of the
8#                     Eclipse Public License Version 1.0.
9#
10# A copy of this license is included in the COPYING file of this distribution.
11# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12# -----------------------------------------------------------------------------
13if [ ! -e "bin/new_release.sh" ]
14then
15        echo "bin/new_release.sh: must be executed from its parent directory"
16        exit 1
17fi
18# bash function that echos and executes a command
19echo_eval() {
20        echo $*
21        eval $*
22}
23# -----------------------------------------------------------------------------
24repository="https://projects.coin-or.org/svn/CppAD"
25stable_version="20130000"
26release='2'
27release_version="$stable_version.$release"
28msg="Creating releases/$release_version"
29# -----------------------------------------------------------------------------
30# check initial working directory
31dir=`pwd | sed -e 's|.*/[Cc][Pp][Pp][Aa][Dd]/||'`
32check="stable/$stable_version"
33if [ "$dir" != "$check" ]
34then
35        echo bin/"new_release.sh: must execute this script in $check"
36        exit 1
37fi
38# -----------------------------------------------------------------------------
39# Check release version
40if svn list $repository/releases | grep "$release_version" > /dev/null
41then
42        echo bin/"new_release.sh: Release number $release_version already exists."
43        echo "You must first change the assigment"
44        echo "  release=$release"
45        echo "in file bin/new_release.sh to a higher release number."
46        exit 1
47fi
48#
49check_one=`bin/version.sh get`
50echo_eval svn revert doc.omh
51check_two=`grep "cppad-$stable_version" doc.omh \
52        | sed -e 's|cppad-\([0-9.]*\):.*|\1|'`
53if [ "$check_one" != "$release_version" ] || [ "$check_one" != "$check_two" ]
54then
55        echo 'bin/new_release.sh:'
56        echo 'Set new version number with following commands:'
57        echo "  bin/version.sh set $release_version"
58        echo '  bin/version.sh copy'
59        echo 'then test and then commit the changes.'
60        exit 1
61fi
62# -----------------------------------------------------------------------------
63rep_stable="$repository/stable/$stable_version"
64rep_release="$repository/releases/$release_version"
65echo_eval svn copy $rep_stable $rep_release -m \"$msg\"
66# -----------------------------------------------------------------------------
67echo "cd ../.."
68cd ../..
69#
70if [ -e conf ]
71then
72        echo_eval rm -rf conf.old
73        echo_eval mv conf conf.old
74fi
75echo_eval svn checkout $repository/conf conf
76#
77echo_eval cd conf
78#
79msg="Update stable and release numbers in projDesc.xml"
80echo 'Settting stable and advance release in ../../conf/projDesc.xml.'
81sed -i projDesc.xml \
82        -e "/^ *<stable/,/^ *<\/stable/s/[0-9]\{8\}/$stable_version/" \
83        -e "/^ *<release/,/^ *<\/release/s/[0-9]\{8\}\.[0-9]*/$release_version/"
84#
85echo "Use the command the following command to finish the process"
86echo "  svn commit -m \"$msg\" ../../conf/projDesc.xml"
Note: See TracBrowser for help on using the repository browser.