source: trunk/SRC/Documentation/xmldoc/mergeonline_help.sh @ 186

Last change on this file since 186 was 179, checked in by smasson, 18 years ago

update getsaxo + revision number in SRC tar file + improve exit status of /mergeonline_help.sh

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1#!/bin/sh
2#
3# history
4# Sept 2006: Sebastien Masson (smasson\@lodyc.jussieu.fr)
5#
6# version
7# $Id$
8#
9homeidl=$1
10homesaxo=$2
11homesrc=$3
12version=$4
13#
14#############################################################
15# create the file saxoidl.adp from idl.adp and idldoc-lib.adp
16#############################################################
17# create saxoidl.adp header
18[ ! -f ${homeidl}/idl.adp ] && exit 1
19[ ! -f ${homesaxo}/idldoc-lib.adp ] && exit 1
20#
21cat <<EOF > ${homesrc}/idl.adp
22<!DOCTYPE DCF> 
23<assistantconfig version="3.3.0"> 
24   <profile> 
25      <property name="name">SAXO - IDL ${version} Help</property> 
26      <property name="title">SAXO - IDL ${version} Help</property> 
27      <property name="startpage">${homesrc}/home.html</property> 
28      <property name="aboutmenutext">About SAXO</property> 
29      <property name="abouturl">${homesrc}/aboutsaxo.txt</property> 
30      <property name="assistantdocs">${homeidl}</property> 
31   </profile> 
32EOF
33[ $? -ne 0 ] && exit 1
34# extract part from </profile> to </assistantconfig>
35# put the complete path of the references
36# and put it at the end of idl.adp
37sed -e '1,/<\/profile>/ d' \
38    -e '/<\/assistantconfig>/,$ d' \
39    -e "s?ref=\"?ref=\"${homeidl}/?g" \
40    ${homeidl}/idl.adp  >> ${homesrc}/idl.adp
41[ $? -ne 0 ] && exit 1
42
43# extract part from </profile>
44# put the complete path of the references
45# and put it at the end of idl.adp
46sed -e '1,/<\/profile>/ d' \
47    -e "s?ref=\"?ref=\"${homesaxo}/?g" \
48    ${homesaxo}/idldoc-lib.adp >> ${homesrc}/idl.adp
49[ $? -ne 0 ] && exit 1
50
51#############################################################
52# create the file home.html from the one installed with IDL
53#############################################################
54[ ! -f ${homeidl}/home.html ] && exit 1
55# put the complete path of the references
56sed -e "s?ref=\"?ref=\"${homeidl}/?g" \
57    ${homeidl}/home.html > ${homesrc}/home.html
58[ $? -ne 0 ] && exit 1
59# number of the line containing the first </h3>
60grep -n '</h3>' ${homesrc}/home.html > /tmp/toto$$ 
61[ $? -ne 0 ] && exit 1
62numline=$( head -n 1 /tmp/toto$$ )
63[ $? -ne 0 ] && exit 1
64numline=$( echo ${numline} | cut -b1-2 )
65[ $? -ne 0 ] && exit 1
66# define the part to be added after the first </h3>
67cat << EOF > /tmp/toto$$
68<a name="SAXOdir"> </a><p class="pIndentedRelative"><img src="images/blueball_idl.gif" id="blueballSAXOdir" border="0" hspace="0" vspace="0"/> &#160;&#160;<a href="${homesaxo}/home.html">SAXO Directory</a></p>
69EOF
70[ $? -ne 0 ] && exit 1
71# add line for SAXO Directory after the first </h3>
72sed -e "${numline}r /tmp/toto$$" ${homesrc}/home.html > /tmp/toto2$$ 
73[ $? -ne 0 ] && exit 1
74mv -f /tmp/toto2$$ ${homesrc}/home.html
75[ $? -ne 0 ] && exit 1
76# number of the line containing the last </h3>
77grep -n '</h3>' ${homesrc}/home.html > /tmp/toto$$ 
78[ $? -ne 0 ] && exit 1
79numline=$( tail -n 1 /tmp/toto$$ )
80[ $? -ne 0 ] && exit 1
81numline=$( echo ${numline} | cut -b1-2 )
82[ $? -ne 0 ] && exit 1
83# define the part to be added after the last </h3>
84cat << EOF > /tmp/toto$$
85<a name="SAXOweb"> </a><p class="pIndentedRelative"><img src="images/blueball_idl.gif" id="blueballSAXOweb" border="0" hspace="0" vspace="0"/> &#160;&#160;<a href="http://forge.ipsl.jussieu.fr/saxo">SAXO Home Page</a> </p> 
86EOF
87[ $? -ne 0 ] && exit 1
88# add line for SAXO Home Page after the last </h3>
89sed -e "${numline}r /tmp/toto$$" ${homesrc}/home.html > /tmp/toto2$$ 
90[ $? -ne 0 ] && exit 1
91mv -f /tmp/toto2$$ ${homesrc}/home.html
92[ $? -ne 0 ] && exit 1
93# put the complete path of the images except for SAXOIDL_OnlineHelp_title.png
94sed -e "s?src=\"?src=\"${homeidl}/?g" \
95    -e "s?src=\".*IDL_OnlineHelp_Title\.gif\"?src=\"${homesaxo}/../xmldoc/images/SAXOIDL_OnlineHelp_title\.png\"?g" \
96    ${homesrc}/home.html > /tmp/toto$$ 
97[ $? -ne 0 ] && exit 1
98mv -f /tmp/toto$$ ${homesrc}/home.html
99[ $? -ne 0 ] && exit 1
100#############################################################
101# create the file aboutsaxo.txt from overview
102#############################################################
103[ ! -f ${homeidl}/home.html ] && exit 1
104# remove the line with @ in the file overview
105sed -e '/@/d' ${homesaxo}/../../overview > ${homesrc}/aboutsaxo.txt
106[ $? -ne 0 ] && exit 1
107# add a link to saxo page
108cat <<EOF >> ${homesrc}/aboutsaxo.txt
109
110More informations on
111http://forge.ipsl.jussieu.fr/saxo
112
113EOF
114[ $? -ne 0 ] && exit 1
115exit 0
Note: See TracBrowser for help on using the repository browser.