1 | #! /bin/bash -eu |
---|
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 that this is the trunk |
---|
12 | dir=`pwd | sed -e 's|.*/ckbs/||'` |
---|
13 | if [ "$dir" != "trunk" ] |
---|
14 | then |
---|
15 | echo "copy_doc.sh: can only be run in the trunk." |
---|
16 | echo "To change the documentation for a stable version," |
---|
17 | echo "use ./build_doc.sh and commit changes in doc/*" |
---|
18 | exit 1 |
---|
19 | fi |
---|
20 | # |
---|
21 | echo "Determining current documentation version number" |
---|
22 | version=`date +%F | sed -e 's|-||g' -e 's|^|0.|'` |
---|
23 | echo "version = $version" |
---|
24 | # |
---|
25 | echo "Changing verison number in ckbs.omh" |
---|
26 | sed -i ckbs.omh -e "s/ckbs-[0-9.]\{10\}/ckbs-$version/" |
---|
27 | # |
---|
28 | echo "./build_doc.sh" |
---|
29 | ./build_doc.sh |
---|
30 | # |
---|
31 | echo "cd doc" |
---|
32 | cd doc |
---|
33 | # |
---|
34 | if [ ! -e html ] |
---|
35 | then |
---|
36 | echo "svn checkout \\" |
---|
37 | echo " https://projects.coin-or.org/svn/CoinBazaar/html/ckbs html" |
---|
38 | svn checkout https://projects.coin-or.org/svn/CoinBazaar/html/ckbs html |
---|
39 | else |
---|
40 | echo "svn update html" |
---|
41 | svn update html |
---|
42 | fi |
---|
43 | # |
---|
44 | old_list=`ls html/* | sed -e 's|html/||'` |
---|
45 | for file in $old_list |
---|
46 | do |
---|
47 | if [ ! -e $file ] |
---|
48 | then |
---|
49 | echo "svn delete html/$file" |
---|
50 | svn delete html/$file |
---|
51 | fi |
---|
52 | done |
---|
53 | # |
---|
54 | new_list=`ls * | sed -e 's|html:||'` |
---|
55 | for file in $new_list |
---|
56 | do |
---|
57 | if [ ! -e html/$file ] |
---|
58 | then |
---|
59 | echo "cp $file html/$file" |
---|
60 | cp $file html/$file |
---|
61 | # |
---|
62 | echo "svn add html/$file" |
---|
63 | svn add html/$file |
---|
64 | else |
---|
65 | echo "cp $file html/$file" |
---|
66 | cp $file html/$file |
---|
67 | fi |
---|
68 | done |
---|
69 | echo "" |
---|
70 | echo "To see the differences use:" |
---|
71 | echo " svn diff doc/html" |
---|
72 | echo "To commit the changes use:" |
---|
73 | echo " svn commit -m \"[html/ckbs] message\" doc/html" |
---|
74 | echo "to commit the changes." |
---|