eclass-manpages/0000755000000000000000000000000011020521527012612 5ustar rootrooteclass-manpages/Manifest0000644000000000000000000000112011020521527014275 0ustar rootrootAUX eclass-to-manpage.awk 6255 RMD160 1670a0fe24fd5e8057b972f86c31b9d32f7ca496 SHA1 57e913da2128598ed0965e6647d2edccc5ea6476 SHA256 27789461d9ed983c0e8457e1a9b3e8897ef2dfc19ace61c038f11e983c799c51 EBUILD eclass-manpages-20080601.ebuild 740 RMD160 6b1b5515392274ceb4df66761767f3780e1d9892 SHA1 6cd694d45a9a43350dd5d27a45e2d04420874cd0 SHA256 5ca85a022c5d77494fe0999e6d15a334a883dd1402abb8cb3eb3460fd0cf0f24 MISC ChangeLog 1932 RMD160 031256ec60c1e63ba24daa730540dab065746a4c SHA1 3a86b004a77595ab4c9909ae3bf0b2ff6766e4ae SHA256 6add4c56208f3760f3ea9362592b3c3362672457b4a76530bc94bf1b7ab0a157 eclass-manpages/files/0000755000000000000000000000000010756465250013733 5ustar rootrooteclass-manpages/files/eclass-to-manpage.awk0000644000000000000000000001415710756465250017747 0ustar rootroot# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.14 2008/02/19 05:22:38 vapier Exp $ # This awk converts the comment documentation found in eclasses # into man pages for easier/nicer reading. # # If you wish to have multiple paragraphs in a description, then # create empty comment lines. Paragraph parsing ends when the comment # block does. # # The format of the eclass description: # @ECLASS: foo.eclass # @MAINTAINER: # # @BLURB: # @DESCRIPTION: # # @EXAMPLE: # # The format of functions: # @FUNCTION: foo # @USAGE: [optional arguments to foo] # @RETURN: # @MAINTAINER: # # @DESCRIPTION: # # The format of function-specific variables: # @VARIABLE: foo # @DESCRIPTION: # # foo="" # The format of eclass variables: # @ECLASS-VARIABLE: foo # @DESCRIPTION: # # foo="" # Common features: # @CODE # In multiline paragraphs, you can create chunks of unformatted # code by using this marker at the start and end. # @CODE function _stderr_msg(text, type) { print FILENAME ":" NR ":" type ": " text > "/dev/stderr" } function warn(text) { _stderr_msg(text, "warning") } function fail(text) { _stderr_msg(text, "error") exit(1) } function eat_line() { ret = $0 sub(/^# @[A-Z]*:[[:space:]]*/,"",ret) getline return ret } function eat_paragraph() { code = 0 ret = "" getline while ($0 ~ /^#([[:space:]]*$|[[:space:]][^@])/) { sub(/^#[[:space:]]?/, "", $0) ret = ret "\n" $0 getline if ($0 ~ /^# @CODE$/) { if (code) ret = ret "\n.fi" else ret = ret "\n.nf" code = !code getline } } sub(/^\n/,"",ret) return ret } function man_text(p) { return gensub(/-/, "\\-", "g", p) } # # Handle an @ECLASS block # function handle_eclass() { eclass = $3 eclass_maintainer = "" blurb = "" desc = "" example = "" # first the man page header print ".\\\" ### DO NOT EDIT THIS FILE" print ".\\\" ### This man page is autogenerated by eclass-to-manpage.awk" print ".\\\" ### based on comments found in " eclass print ".\\\"" print ".\\\" See eclass-to-manpage.awk for documentation on how to get" print ".\\\" your eclass nicely documented as well." print ".\\\"" print ".TH \"" toupper(eclass) "\" 5 \"" strftime("%b %Y") "\" \"Portage\" \"portage\"" # now eat the global data getline if ($2 == "@MAINTAINER:") eclass_maintainer = eat_paragraph() if ($2 == "@BLURB:") blurb = eat_line() if ($2 == "@DESCRIPTION:") desc = eat_paragraph() if ($2 == "@EXAMPLE:") example = eat_paragraph() # finally display it print ".SH \"NAME\"" print eclass " \\- " man_text(blurb) if (desc != "") { print ".SH \"DESCRIPTION\"" print man_text(desc) } if (example != "") { print ".SH \"EXAMPLE\"" print man_text(example) } # sanity checks if (blurb == "") fail(eclass ": no @BLURB found") if (eclass_maintainer == "") warn(eclass ": no @MAINTAINER found") print ".SH \"FUNCTIONS\"" } # # Handle a @FUNCTION block # function handle_function() { func_name = $3 usage = "" funcret = "" maintainer = "" desc = "" # grab the docs getline if ($2 == "@USAGE:") usage = eat_line() if ($2 == "@RETURN:") funcret = eat_line() if ($2 == "@MAINTAINER:") maintainer = eat_paragraph() if ($2 == "@DESCRIPTION:") desc = eat_paragraph() # now print out the stuff print ".TP" print "\\fB" func_name "\\fR " man_text(usage) if (desc != "") print man_text(desc) if (funcret != "") { if (desc != "") print "" print "Return value: " funcret } if (blurb == "") fail(func_name ": no @BLURB found") if (desc == "" && funcret == "") fail(func_name ": no @DESCRIPTION found") } # # Handle @VARIABLE and @ECLASS-VARIABLE blocks # function _handle_variable() { var_name = $3 desc = "" val = "" # grab the docs getline if ($2 == "@DESCRIPTION:") desc = eat_paragraph() # extract the default variable value val = $0 regex = "^.*" var_name "=" sub(regex, "", val) if ($0 == val) { warn(var_name ": unable to extract default variable content: " $0) val = "" } else val = " = \\fI" val "\\fR" # now accumulate the stuff ret = \ ".TP" "\n" \ "\\fB" var_name "\\fR" val "\n" \ man_text(desc) if (desc == "") fail(var_name ": no @DESCRIPTION found") return ret } function handle_variable() { print _handle_variable() } function handle_eclass_variable() { if (eclass_variables != "") eclass_variables = eclass_variables "\n" eclass_variables = eclass_variables _handle_variable() } # # Spit out the common footer of manpage # function handle_footer() { if (eclass_variables != "") { print ".SH \"ECLASS VARIABLES\"" print man_text(eclass_variables) } #print ".SH \"AUTHORS\"" # hmm, how to handle ? someone will probably whine if we dont ... if (eclass_maintainer != "") { print ".SH \"MAINTAINERS\"" print man_text(eclass_maintainer) } print ".SH \"REPORTING BUGS\"" print "Please report bugs via http://bugs.gentoo.org/" print ".SH \"FILES\"" print ".BR /usr/portage/eclass/" eclass print ".SH \"SEE ALSO\"" print ".BR ebuild (5)" } # # Init parser # BEGIN { state = "header" } # # Main parsing routine # { if (state == "header") { if ($0 ~ /^# @ECLASS:/) { handle_eclass() state = "funcvar" } else if ($0 == "# @DEAD") { eclass = "dead" exit(10) } else if ($0 ~ /^# @/) warn("Unexpected tag in \"" state "\" state: " $0) } else if (state == "funcvar") { if ($0 ~ /^# @FUNCTION:/) handle_function() else if ($0 ~ /^# @VARIABLE:/) handle_variable() else if ($0 ~ /^# @ECLASS-VARIABLE:/) handle_eclass_variable() else if ($0 ~ /^# @/) warn("Unexpected tag in \"" state "\" state: " $0) } } # # Tail end # END { if (eclass == "") fail("eclass not documented yet (no @ECLASS found)"); else if (eclass != "dead") handle_footer() } eclass-manpages/eclass-manpages-20080601.ebuild0000644000000000000000000000134411020521463017742 0ustar rootroot# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/eclass-manpages-20080601.ebuild,v 1.1 2008/06/01 01:56:17 vapier Exp $ DESCRIPTION="collection of Gentoo eclass manpages" HOMEPAGE="http://www.gentoo.org/" SRC_URI="" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" IUSE="" DEPEND="" RDEPEND="!app-portage/portage-manpages" S=${WORKDIR} src_compile() { local e for e in "${ECLASSDIR}"/*.eclass ; do awk -f "${FILESDIR}"/eclass-to-manpage.awk ${e} > ${e##*/}.5 || rm -f ${e##*/}.5 done } src_install() { doman *.5 || die } eclass-manpages/ChangeLog0000644000000000000000000000361411020405636014372 0ustar rootroot# ChangeLog for app-portage/eclass-manpages # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/ChangeLog,v 1.13 2008/06/01 01:56:17 vapier Exp $ *eclass-manpages-20080531 (01 Jun 2008) 01 Jun 2008; Mike Frysinger +eclass-manpages-20080531.ebuild: Bump to push out accumulated changes in the tree. 25 May 2008; Zac Medico eclass-manpages-20070615.ebuild: Block app-admin/webapp-config due to webapp.eclass.5 file collision. 19 Feb 2008; Doug Klima metadata.xml: fix herd 19 Feb 2008; Mike Frysinger files/eclass-to-manpage.awk: Add a new "@DEAD" tag so we skip dead eclasses. 19 Feb 2008; Mike Frysinger files/eclass-to-manpage.awk: Do not abort if @DESCRIPTION is not set #209665 by mren. 01 Sep 2007; Mike Frysinger files/eclass-to-manpage.awk: Add support for global-scope variables #190871 and improve handling of variables and errors in general. 30 Aug 2007; Ulrich Mueller files/eclass-to-manpage.awk: Finally fix whitespace issues of bug #184779. 07 Aug 2007; Mike Frysinger files/eclass-to-manpage.awk: Add support for @VARIABLE descriptions. Add support for @RETURN values. Add support for @CODE and re-order trailing sections. 02 Aug 2007; Zac Medico eclass-manpages-20070615.ebuild: Block app-portage/portage-manpages due to eutils.eclass.5 file collision. 24 Jul 2007; Mike Frysinger files/eclass-to-manpage.awk: Dont require trailing whitespace to continue paragraphs as that just sets off QA checkers #184779 by Ulrich Mueller. *eclass-manpages-20070615 (16 Jun 2006) 16 Jun 2006; Mike Frysinger : Initial import. Ebuild submitted by me.