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