1 |
vapier 10/08/22 23:10:55 |
2 |
|
3 |
Modified: eclass-to-manpage.awk |
4 |
Log: |
5 |
only dump FUNCTIONS section header when necessary |
6 |
(Portage version: 2.2_rc67/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.17 app-portage/eclass-manpages/files/eclass-to-manpage.awk |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk?rev=1.17&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk?rev=1.17&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk?r1=1.16&r2=1.17 |
14 |
|
15 |
Index: eclass-to-manpage.awk |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v |
18 |
retrieving revision 1.16 |
19 |
retrieving revision 1.17 |
20 |
diff -u -r1.16 -r1.17 |
21 |
--- eclass-to-manpage.awk 21 Aug 2010 19:25:57 -0000 1.16 |
22 |
+++ eclass-to-manpage.awk 22 Aug 2010 23:10:55 -0000 1.17 |
23 |
@@ -1,6 +1,6 @@ |
24 |
-# Copyright 1999-2007 Gentoo Foundation |
25 |
+# Copyright 1999-2010 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.16 2010/08/21 19:25:57 vapier Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.17 2010/08/22 23:10:55 vapier Exp $ |
29 |
|
30 |
# This awk converts the comment documentation found in eclasses |
31 |
# into man pages for easier/nicer reading. |
32 |
@@ -148,13 +148,17 @@ |
33 |
fail(eclass ": no @BLURB found") |
34 |
if (eclass_maintainer == "") |
35 |
warn(eclass ": no @MAINTAINER found") |
36 |
- |
37 |
- print ".SH \"FUNCTIONS\"" |
38 |
} |
39 |
|
40 |
# |
41 |
# Handle a @FUNCTION block |
42 |
# |
43 |
+function show_function_header() { |
44 |
+ if (_function_header_done != 1) { |
45 |
+ print ".SH \"FUNCTIONS\"" |
46 |
+ _function_header_done = 1 |
47 |
+ } |
48 |
+} |
49 |
function handle_function() { |
50 |
func_name = $3 |
51 |
usage = "" |
52 |
@@ -162,6 +166,8 @@ |
53 |
maintainer = "" |
54 |
desc = "" |
55 |
|
56 |
+ show_function_header() |
57 |
+ |
58 |
# grab the docs |
59 |
getline |
60 |
if ($2 == "@USAGE:") |
61 |
@@ -257,6 +263,7 @@ |
62 |
return ret |
63 |
} |
64 |
function handle_variable() { |
65 |
+ show_function_header() |
66 |
ret = _handle_variable() |
67 |
if (ret == "") |
68 |
return |