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 | # exit on any error |
---|
9 | set -e |
---|
10 | # |
---|
11 | # check initial working directory |
---|
12 | dir=`pwd | sed -e 's|.*/||'` |
---|
13 | if [ "$dir" != "trunk" ] |
---|
14 | then |
---|
15 | echo "new_stable.sh: must execute this script in the trunk" |
---|
16 | exit 1 |
---|
17 | fi |
---|
18 | # |
---|
19 | echo "Getting current repository revision number" |
---|
20 | rev_trunk=`svn info --revision HEAD | \ |
---|
21 | grep '^Revision:' | sed -e 's|^Revision: *||'` |
---|
22 | echo "rev_trunk = $rev_trunk" |
---|
23 | # |
---|
24 | echo "Getting current stable version number" |
---|
25 | stable_version=`date +%F | sed -e 's/-//g' -e 's|^|0.|'` |
---|
26 | echo "stable_version = $stable_version" |
---|
27 | # |
---|
28 | echo "Getting current documentation verison number" |
---|
29 | doc_version=`grep '$section' ckbs.omh | \ |
---|
30 | sed -e 's|.*ckbs-\([0-9.]\{10\}\).*|\1|'` |
---|
31 | echo "doc_version = $doc_version" |
---|
32 | # |
---|
33 | if [ "$doc_version" != "$stable_version" ] |
---|
34 | then |
---|
35 | echo "new_stable.sh: run ./copy_doc.sh to bring doc_version up to date" |
---|
36 | echo "new_stable.sh: stable_version = $stable_version" |
---|
37 | echo "new_stable.sh: doc_version = $doc_version" |
---|
38 | exit 1 |
---|
39 | fi |
---|
40 | # |
---|
41 | # web address for trunk, stable, release, and documentation |
---|
42 | repository="https://projects.coin-or.org/svn/CoinBazaar" |
---|
43 | rep_trunk="$repository/projects/ckbs/trunk" |
---|
44 | rep_stable="$repository/projects/ckbs/stable/$stable_version" |
---|
45 | rep_release="$repository/projects/ckbs/releases/$stable_version.0" |
---|
46 | rep_html="$repository/html/ckbs" |
---|
47 | # |
---|
48 | # create the new stable version |
---|
49 | msg="copy ckbs/trunk at revision $rev_trunk to ckbs/stable/$stable_version" |
---|
50 | echo "svn copy $rep_trunk $rep_stable -m \"$msg\"" |
---|
51 | svn copy $rep_trunk $rep_stable -m "$msg" |
---|
52 | # |
---|
53 | # Add documentation to the stable version |
---|
54 | msg="[ckbs/stable] Add documentation corresponding to this stable version" |
---|
55 | echo "svn copy $rep_html $rep_stable/doc -m \"$msg\"" |
---|
56 | svn copy $rep_html $rep_stable/doc -m "$msg" |
---|
57 | # |
---|
58 | # create the new release version |
---|
59 | msg="copy ckbs/stable/$stable_version to ckbs/releases/$stable_version.0" |
---|
60 | svn copy $rep_stable $rep_release -m "$msg" |
---|
61 | # |
---|
62 | echo "" |
---|
63 | echo "To check out this stable version use the command:" |
---|
64 | echo " svn checkout \\" |
---|
65 | echo "$rep_stable" |
---|
66 | echo "To check out this release version use the command:" |
---|
67 | echo " svn checkout \\" |
---|
68 | echo "$rep_release" |
---|