source: projects/ckbs/trunk/copy_doc.sh @ 95

Last change on this file since 95 was 95, checked in by bradbell, 11 years ago

[cbks/trunk] Improve scripts that help with commits to repositories.

new_release.sh: fix errors in this script (and make executable).
ckbs.omh: update date so it corresponds to documentation.
copy_doc.sh:

  • Property svn:executable set to *
File size: 1.7 KB
Line 
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
9dir=`pwd | sed -e 's|.*/ckbs/||'`
10if [ "$dir" != "trunk" ]
11then
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
15fi
16version=`date +%F | sed -e 's|-||g' -e 's|^|0.|'`
17sed -i ckbs.omh -e "s/ckbs-[0-9.]\{10\}/ckbs-$version/"
18#
19if [ -e doc ]
20then
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
27fi
28#
29echo "cd doc"
30cd doc
31#
32if [ ! -e html ]
33then
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
37else
38        echo "svn update html"
39        svn update html
40fi
41#
42old_list=`ls html/* | sed -e 's|html/||'`
43for file in $old_list
44do
45        if [ ! -e $file ]
46        then
47                echo "svn delete html/$file"
48                svn delete html/$file
49        fi
50done
51#
52new_list=`ls * | sed -e 's|html:||'`
53for file in $new_list
54do
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
66done
67echo ""
68echo "To see the differences use:"
69echo "  svn diff doc/html"
70echo "To commit the changes use:"
71echo "  svn commit -m \"[html/ckbs] message\" doc/html"
72echo "to commit the changes."
Note: See TracBrowser for help on using the repository browser.