diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-portage/eclass-manpages |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-portage/eclass-manpages')
10 files changed, 709 insertions, 0 deletions
diff --git a/app-portage/eclass-manpages/Manifest b/app-portage/eclass-manpages/Manifest new file mode 100644 index 000000000000..7eb7772c3531 --- /dev/null +++ b/app-portage/eclass-manpages/Manifest @@ -0,0 +1,16 @@ +AUX eclass-to-manpage.awk 9812 SHA256 750d616d4cb53a28da2b125dcdaf6f664bed04f93557061dba314319c04e54c3 SHA512 af8901b21350c820ae206b5652394c4c859326791bc00af9a0baa3b9b7c72cd3068f20cff292f0707aec6aa9715477ca840df047c1bc033f48800e110d8bb51c WHIRLPOOL f088bd24d90f44cfec4530f7c59062373f05868c65da9b40051684c5eb6df817ee1269218dca0704a77f07a33fc37ba620cc64bcf0514d78d4b045b6c9fdeb72 +AUX eclass-to-manpage.sh 780 SHA256 27c19b79671cea217bd7d84e7f385a7d3cdf78411b6ce2f07303965d201c841b SHA512 266f15ac5d2efc42ce792d9e0c1d91e99502a5cd93ee1b915fe952cdd894bc4e773014c3f6731d2a11a2d82466676035cff21a1d88070fe85f1dca915dca203c WHIRLPOOL a9bafe48b6ba3fce7787cd6029adee73b1a08b06ebd114dfdfa9a1270a40e1190ff91fb21ccb6b9a3ef6063c3e9880445ba6daa8085551eb134b4658ec9fbf68 +DIST eclass-manpages-20170321.tar.xz 459596 SHA256 47aaef9603822bf0a5e7f738b4f354c83bdcbb61b1639f66de02db24de2b4bc6 SHA512 7ff2a48659382ae84944e4f4cf4bb8a73d51355d8bcd63f16fa155e3da3010430babe6f7d977327e5c7f14f0b5e6a23ee5659665e35b020bcd7772008ce3b3b0 WHIRLPOOL 656cb2a0867b6f10a2bba59dd26ffc19c75d8e753d150d4fec90ffe7d586192e98fd44af5aafeb2fee1e0209a10c916ad0dc677a71a14ba4796dd1795d6acb17 +DIST eclass-manpages-20170428.tar.xz 457936 SHA256 f1138d403ede694409c5cd584d1b7c1cd596e8714f092a84312cf19837240af6 SHA512 15f21b13aa66eb7fa9a02bcd4e33ec5f9eba9a82412184ba821ccfdccaa1e34d8161464ae9db939bc3e7df661eda45755efa4a465883c4577b406ca712aa2e01 WHIRLPOOL 10f688309fc299189b315b25a7f528b38b5bb5d8f35785d4d3dd0af46d2f7fcf7dd14bad693a57a9c0262c95412a5edf44d7ad1ca729df71cc7a12b005edf643 +DIST eclass-manpages-20170521.tar.xz 455584 SHA256 34063a43d913b5311596bf601c02f2cd0fd98d75dd6584fa95289bd7f8a2cbe6 SHA512 0f91eaf3066a8208fd02c256927ea5e8b2d488642f37573bedf8284afef49d7c4951144687fda29146cf27af05cc29efbea0a41462e0d59fc94cae3e9e70870e WHIRLPOOL 52846eb282307a56b662166dd4c26db4b09089fb4f8d8654aeccb4a94579b1495b7b196efee3bb4496b4895ca113f2e87d79aaab698c8c9977bf496172e3c156 +DIST eclass-manpages-20170712.tar.xz 456832 SHA256 aac17f7efec309db108c34fb511dcb0ebdee0d5dbcf94fa36ca3317afe5669bd SHA512 a64c97683fa796d6122b722dfe065447ebd106c2974a7f3c4ea67743429efa43082979febdfd5a3676635b745cec02420771d1b2ce401c7100867aef9bd9de0b WHIRLPOOL 212bdc3b6bb29b17765e557e4540ed8fed678a42d8a4678661ee13f59b0a7282be2439a4078ff1b0af8db8cba33dfb0446adac6b632bba5f8e2d50cc8c10e9ac +DIST eclass-manpages-20170905.tar.xz 453248 SHA256 bcf4204dcb8c6c3f29d81d4be94638781d7712b32246bece036fa0445db295b0 SHA512 a6e8732f7a06e3a7bfd009a25d91f7f3c6721283c0265361029ee25cdaa20198a7b273e5825d7ac3f66c7ccfa7eea20c2c3ff23dc08bab22a32c2325a413e6b5 WHIRLPOOL c3b7d5b80539c8ac0393d33ba9d96ce12d7894981669b8e67e55a3c8985af5474d0fea53dfb3620cc6788dd43e9c88095758f51cdc5e84fa67c9e84a4c43afc7 +EBUILD eclass-manpages-20170321.ebuild 1051 SHA256 8bbb1e862485a703824456769d04c2a71ca178276d772d3ecd9d345e4367e193 SHA512 26fd28474f65d196a20b1a64e7e9e5c04890bcc1a28b23a878220bb993f90ea226b1ddefb00af469998394510973f02fb8cde38eb713f4e7329940b95f30ed16 WHIRLPOOL 7871337c2502536913ff2ef331f564fb75172e218416c1dd77c63a83fc010b65c432eb20927060be9b8656a719d548db52a88deaa1c2f0c5ee68206655aa1acc +EBUILD eclass-manpages-20170428.ebuild 1051 SHA256 8bbb1e862485a703824456769d04c2a71ca178276d772d3ecd9d345e4367e193 SHA512 26fd28474f65d196a20b1a64e7e9e5c04890bcc1a28b23a878220bb993f90ea226b1ddefb00af469998394510973f02fb8cde38eb713f4e7329940b95f30ed16 WHIRLPOOL 7871337c2502536913ff2ef331f564fb75172e218416c1dd77c63a83fc010b65c432eb20927060be9b8656a719d548db52a88deaa1c2f0c5ee68206655aa1acc +EBUILD eclass-manpages-20170521.ebuild 1051 SHA256 8bbb1e862485a703824456769d04c2a71ca178276d772d3ecd9d345e4367e193 SHA512 26fd28474f65d196a20b1a64e7e9e5c04890bcc1a28b23a878220bb993f90ea226b1ddefb00af469998394510973f02fb8cde38eb713f4e7329940b95f30ed16 WHIRLPOOL 7871337c2502536913ff2ef331f564fb75172e218416c1dd77c63a83fc010b65c432eb20927060be9b8656a719d548db52a88deaa1c2f0c5ee68206655aa1acc +EBUILD eclass-manpages-20170712.ebuild 1051 SHA256 8bbb1e862485a703824456769d04c2a71ca178276d772d3ecd9d345e4367e193 SHA512 26fd28474f65d196a20b1a64e7e9e5c04890bcc1a28b23a878220bb993f90ea226b1ddefb00af469998394510973f02fb8cde38eb713f4e7329940b95f30ed16 WHIRLPOOL 7871337c2502536913ff2ef331f564fb75172e218416c1dd77c63a83fc010b65c432eb20927060be9b8656a719d548db52a88deaa1c2f0c5ee68206655aa1acc +EBUILD eclass-manpages-20170905.ebuild 1112 SHA256 1e6f9431c81ea2c9ff70ec9c11358778b3f6543010c7c7ea63984b33e2f1a275 SHA512 c91678e3f434802810c0611aeb5186218ddef027c7f0896cb27429b697005f5c1dd724e4b3946dc030c8cf8cc0e28f8a1e5e2f09db06aba0e13950ca64cb9231 WHIRLPOOL 96d21ec9c9c016c8aee25d922f70caac96328f06935c1d30b47327debc843a54524101492f2e20bb31a061c372e8ebfc1dd897e5fe818d9173b164b963b2cec4 +EBUILD eclass-manpages-99999999.ebuild 916 SHA256 1c2fe5c8b864ee252887846233d792133463140e16e52c3e15598947a31cadaf SHA512 ac863b1ab0c85239d7c31350be6cdeaef0856e771881f0296aa5321012618fa20a74dae3c20b11925eab18f6c787ebe050d9fb41abc8d2281d3e5713146e27b9 WHIRLPOOL 06f9a8b408c564ade369be28394e27d0987dcd3147a76b200e6564a6cfc64a4602d3e24d6401e8a8d35f45eaf744cf187c9fa92f3786f9184e72a0d90c74f452 +MISC ChangeLog 4364 SHA256 0fafda4a482913b6fe5e90ca8d934545b4b2f0e306a994391ab39a5b6a66afd8 SHA512 3ca98f6747566320c56963a46650d89302b25b47d7ac28142ac5b47f16f0e67689461757af71657e73e0c8d54386eec3be223e7c2570f3186c59a6c76ccb9b2c WHIRLPOOL e8292d83fb3f598c13a48eb5e0de68dd4f7ff406076658fbe72e93b6fc37110aa8330f5ea18c281f2331cedd8fafbf1a1e24ddab45ecdce093164a186ac79e52 +MISC ChangeLog-2015 5984 SHA256 4f408b5874baafcd2f70805c7830f6c64df24a202028f9f5649beb4680e29adf SHA512 72c9e444e6f5ebf46591c00d737517fb1b206aed566c4f284348a525cfc903fba2ad56609beb8cd50c8a09f2c348a9198b847cfe648cca8399c6201f92993e04 WHIRLPOOL 819507eb368e14c0ad275bccfbecd41acaabb6782709eb60ae5c6837132bab666a50189b8b3b619b4baf8dcb8edeb618a9ae08fed1abdd5ad3f31c2b30ecb62f +MISC metadata.xml 452 SHA256 8760946a9fffdb7fee0c3d55a8558b7f153ccd56c8c8001bd1038782cfac95a9 SHA512 a2296b428c42027039a65ee16f1dea3383d7a5ac08a89c5125551c3e089a0a7b01448ca397fc0c83e587522ddb1c15f1d9160ea1b0fa9fab857bcf5d7b3708f4 WHIRLPOOL 050e4768465ab47aa8ed1e20c090e95c34b730fcd2623111f67cb806f171e8c5bfb82cea5afa80681feecaa70c5c06085fa420be91f994048c1c7961e1465732 diff --git a/app-portage/eclass-manpages/eclass-manpages-20170321.ebuild b/app-portage/eclass-manpages/eclass-manpages-20170321.ebuild new file mode 100644 index 000000000000..a9f100ab082e --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20170321.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris" +IUSE="" + +DEPEND="app-arch/xz-utils" + +# How to create a snapshot and upload it to your dev-space: +# +# mkdir eclass-manpages-$(date +%Y%m%d) +# cp "$(portageq get_repo_path / gentoo)"/eclass/*.eclass eclass-manpages-$(date +%Y%m%d)/ +# tar -cf eclass-manpages-$(date +%Y%m%d).tar eclass-manpages-$(date +%Y%m%d) +# xz -9e eclass-manpages-$(date +%Y%m%d).tar +# scp eclass-manpages-$(date +%Y%m%d).tar.xz dev.gentoo.org:public_html/dist/ +# +# Then copy the ebuild and update your name in SRC_URI ;-). + +src_compile() { + env ECLASSDIR="${S}" bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/eclass-manpages-20170428.ebuild b/app-portage/eclass-manpages/eclass-manpages-20170428.ebuild new file mode 100644 index 000000000000..a9f100ab082e --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20170428.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris" +IUSE="" + +DEPEND="app-arch/xz-utils" + +# How to create a snapshot and upload it to your dev-space: +# +# mkdir eclass-manpages-$(date +%Y%m%d) +# cp "$(portageq get_repo_path / gentoo)"/eclass/*.eclass eclass-manpages-$(date +%Y%m%d)/ +# tar -cf eclass-manpages-$(date +%Y%m%d).tar eclass-manpages-$(date +%Y%m%d) +# xz -9e eclass-manpages-$(date +%Y%m%d).tar +# scp eclass-manpages-$(date +%Y%m%d).tar.xz dev.gentoo.org:public_html/dist/ +# +# Then copy the ebuild and update your name in SRC_URI ;-). + +src_compile() { + env ECLASSDIR="${S}" bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/eclass-manpages-20170521.ebuild b/app-portage/eclass-manpages/eclass-manpages-20170521.ebuild new file mode 100644 index 000000000000..a9f100ab082e --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20170521.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris" +IUSE="" + +DEPEND="app-arch/xz-utils" + +# How to create a snapshot and upload it to your dev-space: +# +# mkdir eclass-manpages-$(date +%Y%m%d) +# cp "$(portageq get_repo_path / gentoo)"/eclass/*.eclass eclass-manpages-$(date +%Y%m%d)/ +# tar -cf eclass-manpages-$(date +%Y%m%d).tar eclass-manpages-$(date +%Y%m%d) +# xz -9e eclass-manpages-$(date +%Y%m%d).tar +# scp eclass-manpages-$(date +%Y%m%d).tar.xz dev.gentoo.org:public_html/dist/ +# +# Then copy the ebuild and update your name in SRC_URI ;-). + +src_compile() { + env ECLASSDIR="${S}" bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/eclass-manpages-20170712.ebuild b/app-portage/eclass-manpages/eclass-manpages-20170712.ebuild new file mode 100644 index 000000000000..a9f100ab082e --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20170712.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris" +IUSE="" + +DEPEND="app-arch/xz-utils" + +# How to create a snapshot and upload it to your dev-space: +# +# mkdir eclass-manpages-$(date +%Y%m%d) +# cp "$(portageq get_repo_path / gentoo)"/eclass/*.eclass eclass-manpages-$(date +%Y%m%d)/ +# tar -cf eclass-manpages-$(date +%Y%m%d).tar eclass-manpages-$(date +%Y%m%d) +# xz -9e eclass-manpages-$(date +%Y%m%d).tar +# scp eclass-manpages-$(date +%Y%m%d).tar.xz dev.gentoo.org:public_html/dist/ +# +# Then copy the ebuild and update your name in SRC_URI ;-). + +src_compile() { + env ECLASSDIR="${S}" bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/eclass-manpages-20170905.ebuild b/app-portage/eclass-manpages/eclass-manpages-20170905.ebuild new file mode 100644 index 000000000000..4326190bb528 --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20170905.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="https://dev.gentoo.org/~titanofold/dist/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +# Keep the keywords stabled. No need to change to ~arch. +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris" +IUSE="" + +DEPEND="app-arch/xz-utils" + +# How to create a snapshot and upload it to your dev-space: +# +# mkdir eclass-manpages-$(date +%Y%m%d) +# cp "$(portageq get_repo_path / gentoo)"/eclass/*.eclass eclass-manpages-$(date +%Y%m%d)/ +# tar -cf eclass-manpages-$(date +%Y%m%d).tar eclass-manpages-$(date +%Y%m%d) +# xz -9e eclass-manpages-$(date +%Y%m%d).tar +# scp eclass-manpages-$(date +%Y%m%d).tar.xz dev.gentoo.org:public_html/dist/ +# +# Then copy the ebuild and update your name in SRC_URI ;-). + +src_compile() { + env ECLASSDIR="${S}" bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/eclass-manpages-99999999.ebuild b/app-portage/eclass-manpages/eclass-manpages-99999999.ebuild new file mode 100644 index 000000000000..e37f9d2ce39a --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-99999999.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND="sys-apps/portage" + +S=${WORKDIR} + +genit() { + local e=${1:-${ECLASSDIR}} + einfo "Generating man pages from: ${e}" + # Need `bash` because the .sh isn't +x on the servers #451352 + env ECLASSDIR=${e} bash "${FILESDIR}"/eclass-to-manpage.sh || die +} + +src_compile() { + # First process any eclasses found in overlays. Then process + # the main eclassdir last so that its output will clobber anything + # that might have come from overlays. Main tree wins! + local o e + for o in $(portageq get_repos /) ; do + e="$(portageq get_repo_path / ${o})/eclass" + [[ -d ${e} ]] || continue + genit "${e}" || die + done + genit || die +} + +src_install() { + doman *.5 +} diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk new file mode 100644 index 000000000000..0b65162c04ec --- /dev/null +++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk @@ -0,0 +1,427 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# 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: +# <required; list of contacts, one per line> +# @AUTHOR: +# <optional; list of authors, one per line> +# @BUGREPORTS: +# <optional; description of how to report bugs; +# default: tell people to use bugs.gentoo.org> +# @VCSURL: <optional; url to vcs for this eclass; default: https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/@ECLASS@> +# @BLURB: <required; short description> +# @DESCRIPTION: +# <optional; long description> +# @EXAMPLE: +# <optional; example usage> + +# The format of functions: +# @FUNCTION: foo +# @USAGE: <required arguments to foo> [optional arguments to foo] +# @RETURN: <whatever foo returns> +# @MAINTAINER: +# <optional; list of contacts, one per line> +# [@INTERNAL] +# @DESCRIPTION: +# <required if no @RETURN; blurb about this function> + +# The format of function-specific variables: +# @VARIABLE: foo +# [@DEFAULT_UNSET] +# [@INTERNAL] +# [@REQUIRED] +# @DESCRIPTION: +# <required; blurb about this variable> +# foo="<default value>" + +# The format of eclass variables: +# @ECLASS-VARIABLE: foo +# [@DEFAULT_UNSET] +# [@INTERNAL] +# [@REQUIRED] +# @DESCRIPTION: +# <required; blurb about this variable> +# foo="<default value>" + +# Disable manpage generation: +# @DEAD + +# Common features: +# @CODE +# In multiline paragraphs, you can create chunks of unformatted +# code by using this marker at the start and end. +# @CODE +# +# @ROFF <some roff macros> +# If you want a little more manual control over the formatting, you can +# insert roff macros directly into the output by using the @ROFF escape. + +function _stderr_msg(text, type, file, cnt) { + if (_stderr_header_done != 1) { + cnt = split(FILENAME, file, /\//) + print "\n" file[cnt] ":" > "/dev/stderr" + _stderr_header_done = 1 + } + + print " " type ":" NR ": " text > "/dev/stderr" +} +function warn(text) { + _stderr_msg(text, "warning") +} +function fail(text) { + _stderr_msg(text, "error") + exit(1) +} +function xfail(text) { + _stderr_msg(text, "error (ignoring)") + exit(77) +} + +function eat_line() { + ret = $0 + sub(/^# @[A-Z]*:[[:space:]]*/,"",ret) + getline + return ret +} +function eat_paragraph() { + code = 0 + ret = "" + getline + while ($0 ~ /^#/) { + # Only allow certain tokens in the middle of paragraphs + if ($2 ~ /^@/ && $2 !~ /^@(CODE|ROFF)$/) + break + + sub(/^#[[:space:]]?/, "", $0) + + # Escape . at start of line #420153 + if ($0 ~ /^[.]/) + $0 = "\\&" $0 + + # Translate @CODE into @ROFF + if ($1 == "@CODE" && NF == 1) { + if (code) + $0 = "@ROFF .fi" + else + $0 = "@ROFF .nf" + code = !code + } + + # Allow people to specify *roff commands directly + if ($1 == "@ROFF") + sub(/^@ROFF[[:space:]]*/, "", $0) + + ret = ret "\n" $0 + + # Handle the common case of trailing backslashes in + # code blocks to cross multiple lines #335702 + if (code && $NF == "\\") + ret = ret "\\" + getline + } + sub(/^\n/,"",ret) + return ret +} + +function pre_text(p) { + return ".nf\n" p "\n.fi" +} + +function man_text(p) { + return gensub(/-/, "\\-", "g", p) +} + +# +# Handle an @ECLASS block +# +function handle_eclass() { + eclass = $3 + eclass_maintainer = "" + eclass_author = "" + blurb = "" + desc = "" + example = "" + + # Sanity check the eclass name. #537392 + if (eclass !~ /[.]eclass$/) + fail(eclass ": @ECLASS name is missing a '.eclass' suffix") + + # first the man page header + print ".\\\" -*- coding: utf-8 -*-" + 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 == "@AUTHOR:") + eclass_author = eat_paragraph() + if ($2 == "@BUGREPORTS:") + reporting_bugs = eat_paragraph() + if ($2 == "@VCSURL:") + vcs_url = eat_line() + if ($2 == "@BLURB:") + blurb = eat_line() + if ($2 == "@DESCRIPTION:") + desc = eat_paragraph() + if ($2 == "@EXAMPLE:") + example = eat_paragraph() + # in case they typo-ed the keyword, bail now + if ($2 ~ /^@/) + fail(eclass ": unknown keyword " $2) + + # 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") +} + +# +# Handle a @FUNCTION block +# +function show_function_header() { + if (_function_header_done != 1) { + print ".SH \"FUNCTIONS\"" + _function_header_done = 1 + } +} +function handle_function() { + func_name = $3 + usage = "" + funcret = "" + maintainer = "" + internal = 0 + desc = "" + + # make sure people haven't specified this before (copy & paste error) + if (all_funcs[func_name]) + fail(eclass ": duplicate definition found for function: " func_name) + all_funcs[func_name] = func_name + + # 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 (internal == 1) + return + + show_function_header() + + # 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 = "" + default_unset = 0 + internal = 0 + required = 0 + + # make sure people haven't specified this before (copy & paste error) + if (all_vars[var_name]) + fail(eclass ": duplicate definition found for variable: " var_name) + all_vars[var_name] = var_name + + # grab the optional attributes + opts = 1 + while (opts) { + getline + if ($2 == "@DEFAULT_UNSET") + default_unset = 1 + else if ($2 == "@INTERNAL") + internal = 1 + else if ($2 == "@REQUIRED") + required = 1 + else + opts = 0 + } + if ($2 == "@DESCRIPTION:") + desc = eat_paragraph() + + # extract the default variable value + # first try var="val" + op = "=" + regex = "^.*" var_name "=(.*)$" + val = gensub(regex, "\\1", 1, $0) + if (val == $0) { + # next try : ${var:=val} + op = "?=" + regex = "^[[:space:]]*:[[:space:]]*[$]{" var_name ":?=(.*)}" + val = gensub(regex, "\\1", 1, $0) + if (val == $0) { + if (default_unset + required + internal == 0) + warn(var_name ": unable to extract default variable content: " $0) + val = "" + } else if (val !~ /^["']/ && val ~ / /) { + if (default_unset == 1) + warn(var_name ": marked as unset, but has value: " val) + val = "\"" val "\"" + } + } + if (length(val)) + val = " " op " \\fI" val "\\fR" + if (required == 1) + val = val " (REQUIRED)" + + if (internal == 1) + return "" + + # 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() { + show_function_header() + ret = _handle_variable() + if (ret == "") + return + print ret +} +function handle_eclass_variable() { + ret = _handle_variable() + if (ret == "") + return + if (eclass_variables != "") + eclass_variables = eclass_variables "\n" + eclass_variables = eclass_variables ret +} + +# +# Spit out the common footer of manpage +# +function handle_footer() { + if (eclass_variables != "") { + print ".SH \"ECLASS VARIABLES\"" + print man_text(eclass_variables) + } + if (eclass_author != "") { + print ".SH \"AUTHORS\"" + print pre_text(man_text(eclass_author)) + } + if (eclass_maintainer != "") { + print ".SH \"MAINTAINERS\"" + print pre_text(man_text(eclass_maintainer)) + } + print ".SH \"REPORTING BUGS\"" + print reporting_bugs + print ".SH \"FILES\"" + print ".BR " eclass + print ".SH \"SEE ALSO\"" + print ".BR ebuild (5)" + print pre_text(gensub("@ECLASS@", eclass, 1, vcs_url)) +} + +# +# Init parser +# +BEGIN { + state = "header" + reporting_bugs = "Please report bugs via http://bugs.gentoo.org/" + vcs_url = "https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/@ECLASS@" +} + +# +# Main parsing routine +# +{ + if (state == "header") { + if ($0 ~ /^# @ECLASS:/) { + handle_eclass() + state = "funcvar" + } else if ($0 == "# @DEAD") { + eclass = "dead" + exit(77) + } else if ($0 == "# @eclass-begin") { + # White list old eclasses that haven't been updated so we can block + # new ones from being added to the tree. + if (eclass == "") + xfail("java documentation not supported") + fail("java documentation not supported") + } 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 == "") + xfail("eclass not documented yet (no @ECLASS found)") + else if (eclass != "dead") + handle_footer() +} diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.sh b/app-portage/eclass-manpages/files/eclass-to-manpage.sh new file mode 100755 index 000000000000..5f389390d60e --- /dev/null +++ b/app-portage/eclass-manpages/files/eclass-to-manpage.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +: ${ECLASSDIR:=${0%/*}/../../../eclass} +: ${FILESDIR:=${ECLASSDIR}/../app-portage/eclass-manpages/files} + +AWK="gawk" +while [[ $# -gt 0 ]] ; do + case $1 in + -e) ECLASSDIR=$2; shift;; + -f) FILESDIR=$2; shift;; + -d) AWK="dgawk";; + *) break;; + esac + shift +done + +if [[ ! -d ${ECLASSDIR} ]] ; then + echo "Usage: ${0##*/} [-e eclassdir] [-f eclass-to-manpage.awk FILESDIR] [eclasses]" 1>&2 + exit 1 +fi + +[[ $# -eq 0 ]] && set -- "${ECLASSDIR}"/*.eclass + +ret=0 +for e in "$@" ; do + set -- \ + ${AWK} \ + -f "${FILESDIR}"/eclass-to-manpage.awk \ + ${e} + if [[ ${AWK} == "gawk" ]] ; then + "$@" > ${e##*/}.5 + tret=$? + if [[ ${tret} -ne 0 ]] ; then + rm -f ${e##*/}.5 + if [[ ${tret} -ne 77 ]] ; then + echo "FAIL: ${e}" + ret=1 + fi + fi + else + "$@" + fi +done +exit ${ret} diff --git a/app-portage/eclass-manpages/metadata.xml b/app-portage/eclass-manpages/metadata.xml new file mode 100644 index 000000000000..430fce10a0a1 --- /dev/null +++ b/app-portage/eclass-manpages/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>vapier@gentoo.org</email> + </maintainer> + <maintainer type="person"> + <email>mgorny@gentoo.org</email> + <name>Michał Górny</name> + </maintainer> + <maintainer type="project"> + <email>tools-portage@gentoo.org</email> + <name>Gentoo Portage tools team</name> + </maintainer> +</pkgmetadata> |