OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [snmp/] [agent/] [v2_0/] [doc/] [prepare-manpages.sh] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#! /bin/sh
2
 
3
echo 'dude, assuming you are running this script from the packages/net/snmp/agent/current/doc/ directory'
4
 
5
MANPAGE_LIST=`find manpages -type f -name '*.?'`
6
 
7
echo "MANPAGE_LIST is $MANPAGE_LIST"
8
 
9
echo 'removing the previous file snmp-manpages.sgml'
10
/bin/rm -f snmp-manpages.sgml
11
touch snmp-manpages.sgml
12
echo '<!-- HEY YOU!!!!!!!!! -->' >> snmp-manpages.sgml
13
echo '<!-- this file is automatically generated by the script -->' >> snmp-manpages.sgml
14
echo '<!-- ' "     $0    " ' -->' >> snmp-manpages.sgml
15
echo '<!-- so PLEASE do not modify it: your changes will be lost -->' >> snmp-manpages.sgml
16
echo >> snmp-manpages.sgml
17
echo >> snmp-manpages.sgml
18
 
19
for manpage in $MANPAGE_LIST
20
do
21
    echo "processing $manpage"
22
    # get the title for this section
23
    manpage_title=`egrep '^\.TH' $manpage | awk '{print $2}' | tr 'A-Z' 'a-z'`
24
    # note that _ is illegal in an id, so we canonicalize it to -
25
    docbook_section_id=`echo $manpage_title | sed 's/_/-/g'`
26
    # now prepare out a section and title
27
    echo "  <sect1 id=\"net-snmp-agent-manpages-$docbook_section_id\">" >> snmp-manpages.sgml
28
    echo "    <title>$manpage_title</title>" >> snmp-manpages.sgml
29
    # we make it <screen> so that it is a monospaced font
30
    echo "    <screen>" >> snmp-manpages.sgml
31
 
32
    # now put the contents into this section
33
    cat $manpage | groff -Tascii -mandoc | sed 's/\_\(.\)/\1/g' \
34
      | sed 's/\(.\)\(.\)/\1/g' \
35
      | sed 's/\&/\&amp;/g' \
36
      | sed 's/</\&lt;/g' \
37
      | sed 's/+o/o/g' >> snmp-manpages.sgml
38
 
39
    # now close out the section
40
    echo "    </screen>" >> snmp-manpages.sgml
41
    echo "  </sect1>" >> snmp-manpages.sgml
42
    echo >> snmp-manpages.sgml
43
done
44
 
45
cat <<EOF >> snmp-manpages.sgml
46
 
47
<!-- Keep this comment at the end of the file
48
Local variables:
49
mode: sgml
50
sgml-omittag:nil
51
sgml-shorttag:t
52
sgml-namecase-general:t
53
sgml-general-insert-case:lower
54
sgml-minimize-attributes:nil
55
sgml-always-quote-attributes:t
56
sgml-indent-step:2
57
sgml-indent-data:t
58
sgml-parent-document:("tcpip.sgml" "book" "chapter")
59
sgml-exposed-tags:nil
60
sgml-local-catalogs:nil
61
sgml-local-ecat-files:nil
62
sgml-doctype:"book"
63
End:
64
-->
65
 
66
EOF
67
 
68
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.