[8a5fe8]: src / docu.sh  Maximize  Restore  History

Download this file

113 lines (100 with data), 4.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# -----------------------------------------------------------------------------
# Copyright (c) 2009, Yuval Levy http://www.photopla.net/
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Yuval Levy nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY Yuval Levy ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Yuval Levy BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# docu.sh - generates documentation and post it to the website
# -----------------------------------------------------------------------------
# EXPECTED FOLDER LAYOUT (run only the first time to set up)
# mkdir -p ~/src/enblend
# cd ~/src/enblend
# hg clone ssh://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend
# hg clone ssh://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend-web
# EXPECTED STARTUP LOCATION
cd ~/src/enblend/
# EDIT REVISION AND VERSION BELOW TO PRODUCE DOCU FOR ANOTHER VERSION
# tagged revision. to determine, do `hg tags`
REVISION="637"
# version of enblend-enfuse for which the documentation will be generated
# and published. To determine, do g tags`
VERSION="4.0.0"
# should not have to change anything below this line
# folder with the enblend-enfuse source code
EN_SOURCE="enblend"
# folder with enblend website code
WEB_SOURCE="enblend-web"
# suffix of files to be processed
SUFFIX="xhtml"
# get the latest version of the website
cd ${WEB_SOURCE}
hg pull
hg up
# update source tree to the version to be documented
cd ../${EN_SOURCE}
hg pull
hg update -C -r ${REVISION}
# generate the documentation
make --makefile=Makefile.scm
./configure
make pdf
make xhtml
cd doc/
# strip the documentation for the website
cd enblend.xhtml/
for e in "enblend.xhtml" "enfuse.xhtml"
cd ../${e}
for i in *.$SUFFIX
do
l=`echo ${i%%.$SUFFIX} |sed 's#^.*/##'`
echo $i
perl -i -pe 's/ / /g' $i
xpath -e "//html/body/*" $i > "$l.temp"
rm "$l.xhtml"
mv "$l.temp" "$l.xhtml"
done
# move the documentation into the website
cd ..
mv enblend.pdf ../../enblend-web/enblend.doc/enblend_${VERSION}.pdf
mv enfuse.pdf ../../enblend-web/enfuse.doc/enfuse_${VERSION}.pdf
mv enblend.xhtml ../../enblend-web/enblend.doc/enblend_${VERSION}.xhtml
mv enfuse.xhtml ../../enblend-web/enfuse.doc/enfuse_${VERSION}.xhtml
# update website's repository
cd ../${WEB_SOURCE}
hg add
hg push
# uploading to the website itself should work via cron job
# to manually update, issue the following commands
# rsync -rl --delete --exclude ".hg*" --exclude "src" ../enblend-web/* <USER>,enblend@web.sourceforge.net:/home/groups/e/en/enblend/htdocs/
# to set up the cron job
# 1. Initial setup locally
# cd
# hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend-web
#
# 2. Make sure you have the fingerprint of the SF host in your approved
# hosts list, i.e. try to manually update first until it works without
# prompt
#
# 3. set the following command as a cron job
# cd enblend-web && hg pull && hg up && rsync -rl --delete --exclude ".hg*" --exclude "src" ../enblend-web/* yuv,enblend@web.sourceforge.net:/home/groups/e/en/enblend/htdocs/

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks