1 | #! /bin/bash |
---|
2 | # ------------------------------------------------------------------- |
---|
3 | # ckbs: Constrained Kalman-Bucy Smoother Program: Copyright (C) 2006 |
---|
4 | # Authors: Bradlely Bell: bradbell at washington dot edu |
---|
5 | # Gianluigi Pillonetto: giapi at dei dot unipd dot it |
---|
6 | # License: GNU General Public License Version 2 |
---|
7 | # ---------------------------------------------------------------------------- |
---|
8 | # check initial working directory |
---|
9 | dir=`pwd | sed -e 's|.*/||'` |
---|
10 | if [ "$dir" != "trunk" ] |
---|
11 | then |
---|
12 | echo "new_stable.sh: must execute this script in the trunk" |
---|
13 | exit 1 |
---|
14 | fi |
---|
15 | # |
---|
16 | echo "Getting current revision number for version of trunk" |
---|
17 | rev_trunk=`svn info --revision HEAD | \ |
---|
18 | grep '^Revision:' | sed -e 's|^Revision: *||'` |
---|
19 | echo "rev_trunk=$rev_trunk" |
---|
20 | # |
---|
21 | # number for the stable version we are creating |
---|
22 | stable_version=`date +%F |sed -e 's/-//g' -e 's|^|0.|'` |
---|
23 | # |
---|
24 | # check that the documentation is up to date |
---|
25 | doc_version=`grep '$section' ckbs.omh | \ |
---|
26 | sed -e 's|.*ckbs-\([0-9.]\{10\}\).*|\1|'` |
---|
27 | if [ "$doc_version" != "$stable_version" ] |
---|
28 | then |
---|
29 | echo "new_stable.sh: run ./copy_doc.sh to bring doc version up to date" |
---|
30 | echo "new_stable.sh: stable_version = $stable_version" |
---|
31 | echo "new_stable.sh: doc_version = $doc_version" |
---|
32 | exit 1 |
---|
33 | fi |
---|
34 | # |
---|
35 | # web address for trunk, stable, and release |
---|
36 | repository="https://projects.coin-or.org/svn/CoinBazaar" |
---|
37 | rep_trunk="$repository/projects/ckbs/trunk" |
---|
38 | rep_stable="$repository/projects/ckbs/stable/$stable_version" |
---|
39 | rep_release="$repository/projects/ckbs/releases/$stable_version.0" |
---|
40 | rep_html="$repository/html/ckbs" |
---|
41 | # |
---|
42 | # create the new stable version |
---|
43 | msg="[ckbs/stable] Create ckbs/stable/$stable_version |
---|
44 | from ckbs/trunk at revision $rev_trunk." |
---|
45 | echo "svn copy $rep_trunk $rep_stable -m \"$msg\"" |
---|
46 | if ! svn copy $rep_trunk $rep_stable -m "$msg" |
---|
47 | then |
---|
48 | "new_stable.sh: Cannot create $rep_stable" |
---|
49 | exit 1 |
---|
50 | fi |
---|
51 | # |
---|
52 | # add a copy of the documentation to the stable version |
---|
53 | msg="[ckbs/stable] Add documentation corresponding to this stable version" |
---|
54 | echo "svn copy $rep_html $rep_stable/doc -m \"$msg\"" |
---|
55 | if ! svn copy $rep_html $rep_stable/doc -m "$msg" |
---|
56 | then |
---|
57 | "new_stable.sh: Cannot copy documentation for this stable version" |
---|
58 | exit 1 |
---|
59 | fi |
---|
60 | # |
---|
61 | # create the new release version |
---|
62 | msg="[ckbs/releases] Create ckbs/releases/$stable_version.0 |
---|
63 | from ckbs/trunk at revision $rev_trunk." |
---|
64 | echo "svn copy $rep_stable $rep_release -m \"$msg\"" |
---|
65 | if ! svn copy $rep_stable $rep_release -m "$msg" |
---|
66 | then |
---|
67 | "new_stable.sh: Cannot create $rep_release" |
---|
68 | exit 1 |
---|
69 | fi |
---|
70 | echo "" |
---|
71 | echo "To check out this stable version use the command:" |
---|
72 | echo " svn_checkout.sh ckbs stable/$stable_version" |
---|
73 | echo "To check out this release version use the command:" |
---|
74 | echo " svn_checkout.sh ckbs releases/$stable_version.0" |
---|