Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 280853 Details for
Bug 375975
app-doc/eclass-manpages: add @SEE_ALSO, @DEPRECATED, @EXPORTED, @PRE_INHERIT...
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
This patch is supposed to allow converting java eclasses
eclass-manpages_handle-java-eclasses.patch (text/plain), 7.98 KB, created by
Ralph Sennhauser (RETIRED)
on 2011-07-24 18:16:15 UTC
(
hide
)
Description:
This patch is supposed to allow converting java eclasses
Filename:
MIME Type:
Creator:
Ralph Sennhauser (RETIRED)
Created:
2011-07-24 18:16:15 UTC
Size:
7.98 KB
patch
obsolete
>--- app-portage/eclass-manpages/files/eclass-to-manpage.awk 2011-07-20 05:31:05.000000000 +0200 >+++ app-portage/eclass-manpages/files/eclass-to-manpage.awk 2011-07-24 19:09:34.921064814 +0200 >@@ -13,7 +13,10 @@ > # @ECLASS: foo.eclass > # @MAINTAINER: > # <required; list of contacts, one per line> >+# @AUTHOR: >+# <optional; list of authors, one per line> > # @BLURB: <required; short description> >+# @SEE_ALSO <optional; list of eclass names; disables extracting inherit> > # @DESCRIPTION: > # <optional; long description> > # @EXAMPLE: >@@ -43,10 +46,16 @@ > # [@DEFAULT_UNSET] > # [@INTERNAL] > # [@REQUIRED] >+# [@PREINHERIT] > # @DESCRIPTION: > # <required; blurb about this variable> > # foo="<default value>" > >+# The format of sections: >+# @SECTION: foo >+# @DESCRIPTION: >+# <optional; description of this section> >+ > # Common features: > # @CODE > # In multiline paragraphs, you can create chunks of unformatted >@@ -72,7 +81,7 @@ > > function eat_line() { > ret = $0 >- sub(/^# @[A-Z]*:[[:space:]]*/,"",ret) >+ sub(/^# @[A-Z_]*:[[:space:]]*/,"",ret) > getline > return ret > } >@@ -128,10 +137,15 @@ > > # now eat the global data > getline >+ if ($2 == "@AUTHOR:") >+ eclass_authors = eat_paragraph() > if ($2 == "@MAINTAINER:") > eclass_maintainer = eat_paragraph() > if ($2 == "@BLURB:") > blurb = eat_line() >+ if ($2 == "@SEE_ALSO:") >+ _see_also_override = 1 >+ see_also = eat_line() > if ($2 == "@DESCRIPTION:") > desc = eat_paragraph() > if ($2 == "@EXAMPLE:") >@@ -144,6 +158,7 @@ > print ".SH \"DESCRIPTION\"" > print man_text(desc) > } >+ # aren't example somewhere at the bottom usually? -sera > if (example != "") { > print ".SH \"EXAMPLE\"" > print man_text(example) >@@ -171,55 +186,84 @@ > funcret = "" > maintainer = "" > internal = 0 >+ exported = 0 > desc = "" > >+ # grab the optional attributes >+ opts = 1 >+ while (opts) { >+ getline >+ if ($2 == "@INTERNAL") >+ internal = 1 >+ else if ($2 == "@EXPORTED") >+ exported = 1 >+ else >+ opts = 0 >+ } > # grab the docs >- getline > if ($2 == "@USAGE:") > usage = eat_line() > if ($2 == "@RETURN:") > funcret = eat_line() > if ($2 == "@MAINTAINER:") > maintainer = eat_paragraph() >- if ($2 == "@INTERNAL") { >- internal = 1 >- getline >- } > if ($2 == "@DESCRIPTION:") > desc = eat_paragraph() > >+ if (exported + internal == 2) >+ fail(func_name ": Using both @INTERNAL and @EXPORTED") >+ if (desc == "" && funcret == "") >+ fail(func_name ": no @DESCRIPTION found") >+ > if (internal == 1) > return > > show_function_header() > > # now print out the stuff >- print ".TP" >- print "\\fB" func_name "\\fR " man_text(usage) >+ result = \ >+ ".TP" "\n" \ >+ "\\fB" func_name "\\fR " man_text(usage) >+ > if (desc != "") >- print man_text(desc) >+ result = result "\n" man_text(desc) > if (funcret != "") { > if (desc != "") >- print "" >- print "Return value: " funcret >+ result = result "\n" >+ result = result "Return value: " funcret "\n" > } > >- if (blurb == "") >- fail(func_name ": no @BLURB found") >- if (desc == "" && funcret == "") >- fail(func_name ": no @DESCRIPTION found") >+ if (exported == 1) { >+ if (exported_function_buffer != "") >+ exported_function_buffer = exported_function_buffer "\n\n" >+ if (variable_buffer != "") >+ exported_function_buffer = exported_function_buffer variable_buffer "\n" >+ variable_buffer = "" >+ exported_function_buffer = exported_function_buffer result >+ } else { >+ # maybe write to buffer so eclass variables and phase functions can go first? -sera >+ if (section_buffer != "") >+ print section_buffer >+ section_buffer = "" >+ if (variable_buffer != "") >+ print variable_buffer >+ variable_buffer = "" >+ print result >+ print "" >+ } > } > > # > # Handle @VARIABLE and @ECLASS-VARIABLE blocks > # >-function _handle_variable() { >+function handle_variable(type) { > var_name = $3 > desc = "" > val = "" > default_unset = 0 > internal = 0 > required = 0 >+ pre_inherit = 0 > > # grab the optional attributes > opts = 1 >@@ -231,6 +275,8 @@ > internal = 1 > else if ($2 == "@REQUIRED") > required = 1 >+ else if ($2 == "@PRE_INHERIT") >+ pre_inherit = 1 > else > opts = 0 > } >@@ -257,51 +303,122 @@ > val = "\"" val "\"" > } > } >+ >+ if (desc == "") >+ fail(var_name ": no @DESCRIPTION found") >+ if (internal == 1) >+ return >+ > if (length(val)) > val = " " op " \\fI" val "\\fR" > if (required == 1) > val = val " (REQUIRED)" > >- if (internal == 1) >- return "" >+ result = ".TP" "\n" >+ if (type == "eclass") >+ result = result "\\fB" var_name "\\fR" val "\n" >+ else >+ result = result var_name val "\n" >+ result = result man_text(desc) >+ >+ if (type == "eclass") { >+ if (pre_inherit == 1) { >+ if (pre_inherit_eclass_variables != "") >+ pre_inherit_eclass_variables = pre_inherit_eclass_variables "\n" >+ pre_inherit_eclass_variables = pre_inherit_eclass_variables result >+ } else { >+ if (eclass_variables != "") >+ eclass_variables = eclass_variables "\n" >+ eclass_variables = eclass_variables result >+ } >+ } else { >+ if (variable_buffer != "") >+ variable_buffer = variable_buffer "\n" >+ variable_buffer = variable_buffer result >+ } >+} > >- # now accumulate the stuff >- ret = \ >- ".TP" "\n" \ >- "\\fB" var_name "\\fR" val "\n" \ >- man_text(desc) >+# >+# Handle a @SECTION block >+# >+function handle_section() { >+ section_name = $3 >+ desc = "" > >- if (desc == "") >- fail(var_name ": no @DESCRIPTION found") >+ getline >+ if ($2 == "@DESCRIPTION:") >+ desc = eat_paragraph() > >- return ret >+ if (section_buffer != "") >+ fail(section_name ": Non empty section buffer") >+ >+ section_buffer = ".SS " section_name "\n" \ >+ man_text(desc) "\n" > } >-function handle_variable() { >- show_function_header() >- ret = _handle_variable() >- if (ret == "") >+ >+# >+# Handle an inherit line >+# >+function handle_inherit() { >+ if (_see_also_override == 1) > return >- print ret >+ >+ val = $0 >+ sub(/^[[:space:]]*inherit[[:space:]]*/, "", val) >+ >+ if (see_also != "") >+ see_also = see_also " " >+ see_also = see_also val > } >-function handle_eclass_variable() { >- ret = _handle_variable() >- if (ret == "") >- return >- if (eclass_variables != "") >- eclass_variables = eclass_variables "\n" >- eclass_variables = eclass_variables ret >+ >+# >+# Print SEE ALSO >+# >+function print_see_also() { >+ print ".SH \"SEE ALSO\"" >+ if (see_also == "") { >+ print ".BR ebuild(5)" >+ } else { >+ split(see_also, a) >+ for (i in a) { >+ a[i] = a[i] ".eclass" >+ } >+ a[ebuild] = "ebuild" >+ n = asort(a) >+ for (i = 1; i <= n; i++) { >+ print ".BR " a[i] "(5)" >+ } >+ } > } > > # > # Spit out the common footer of manpage > # > function handle_footer() { >- if (eclass_variables != "") { >+ # print exported functions >+ if (exported_function_buffer != "") { >+ print ".SH \"EXPORTED PHASE FUNCTIONS\"" >+ print exported_function_buffer >+ } >+ # print eclass variables >+ if (eclass_variables != "" || pre_inherit_eclass_variables != "") { > print ".SH \"ECLASS VARIABLES\"" >- print man_text(eclass_variables) >+ if (pre_inherit_eclass_variables != "") { >+ print ".SS PRE-INHERIT" >+ print man_text(pre_inherit_eclass_variables) >+ } >+ if (eclass_variables != "") { >+ print ".SS POST-INHERIT" >+ print man_text(eclass_variables) >+ } > } > #print ".SH \"AUTHORS\"" > # hmm, how to handle ? someone will probably whine if we dont ... >+ # ... so we just add it, nothing wrong with it as I can see. -sera >+ if (eclass_authors != "") { >+ print ".SH \"AUTHORS\"" >+ print man_text(eclass_authors) >+ } > if (eclass_maintainer != "") { > print ".SH \"MAINTAINERS\"" > print man_text(eclass_maintainer) >@@ -310,8 +427,7 @@ > print "Please report bugs via http://bugs.gentoo.org/" > print ".SH \"FILES\"" > print ".BR " eclassdir "/" eclass >- print ".SH \"SEE ALSO\"" >- print ".BR ebuild (5)" >+ print_see_also() > } > > # >@@ -343,9 +459,13 @@ > if ($0 ~ /^# @FUNCTION:/) > handle_function() > else if ($0 ~ /^# @VARIABLE:/) >- handle_variable() >+ handle_variable("function") > else if ($0 ~ /^# @ECLASS-VARIABLE:/) >- handle_eclass_variable() >+ handle_variable("eclass") >+ else if ($0 ~ /^# @SECTION:/) >+ handle_section() >+ else if ($0 ~ /^[[:space:]]*inherit[[:space:]]/) >+ handle_inherit() > else if ($0 ~ /^# @/) > warn("Unexpected tag in \"" state "\" state: " $0) > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 375975
:
280591
|
280853
|
284979
|
284983