/[public]/psiconv/trunk/formats/generate_html4.sh
ViewVC logotype

Contents of /psiconv/trunk/formats/generate_html4.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (show annotations)
Thu Apr 29 21:43:28 2004 UTC (16 years, 4 months ago) by frodo
File MIME type: application/x-sh
File size: 1628 byte(s)
(Frodo) Solaris /bin/sh compatibility updates

/bin/sh on Solaris is just braindead, if you are used to bash (or even
Sun's ksh)

1 #! /bin/sh
2
3 # Work around a BASH bug (prints a directory even in a non-interactive shell)
4 unset CDPATH
5
6 if test "$#" -lt 3 ; then
7 echo "Syntax: $0 psiconv_dir output_dir files..."
8 exit 1
9 fi
10
11 if test ! -d "$1"/program/psiconv ; then
12 echo "First parameter should be base psiconv directory!"
13 exit 1
14 fi
15 basedir=`cd $1; pwd`
16
17 if test ! -d "$2" ; then
18 echo "Output directory does not exist!"
19 exit 1
20 fi
21 outputdir=`cd $2; pwd`
22
23
24 shift
25 shift
26 echo "Generating html4 docs..."
27
28 libtool=$basedir/libtool
29 psiconv=$basedir/program/psiconv/psiconv
30 indexfile=$outputdir/index
31 tempdir=$outputdir/.temp
32 mkindex=$basedir/formats/index_html.sh
33 index=$tempdir/index
34 mkdef=$basedir/formats/html4_links.sh
35 config="$basedir/formats/psiconv.conf"
36
37
38 echo "Going to create the intermediate files..."
39 rm -rf $tempdir
40 mkdir $tempdir
41 for file in "$@"; do
42 echo "Going to process $file..."
43 outputfile=$tempdir/`basename $file|sed s,'.psi$','.html,'`
44 echo $libtool --mode=execute $psiconv -c $config -o $outputfile -Thtml4 -eASCII $file
45 $libtool --mode=execute $psiconv -c $config -o $outputfile -Thtml4 -eASCII $file
46 done
47
48 echo "Going to produce the index..."
49 (
50 cd $tempdir
51 files=
52 for file in "$@"; do
53 files="$files `basename $file|sed s,'.psi$','.html',`"
54 done
55 $mkindex $index $files
56 )
57
58 echo "Going to produce the final files..."
59 for file in "$@"; do
60 echo "Going to process $file..."
61 inputfile=$tempdir/`basename $file|sed s,'.psi$','.html,'`
62 outputfile=$outputdir/`basename $file|sed s,'.psi$','.html,'`
63 rm -f $outputfile
64 echo $mkdef $index $inputfile \> $outputfile
65 $mkdef $index $inputfile > $outputfile
66 done

Properties

Name Value
svn:executable *

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26