summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-07-18 14:27:54 +0000
committerMike Frysinger <vapier@gentoo.org>2012-07-18 14:27:54 +0000
commitdc2fdbd2bc2013432af7cf12019b3240405d99f4 (patch)
treec22e200e926facc18a27523f34774e1593a83aa2 /app-portage
parentadd missing test to IUSE (diff)
downloadgentoo-2-dc2fdbd2bc2013432af7cf12019b3240405d99f4.tar.gz
gentoo-2-dc2fdbd2bc2013432af7cf12019b3240405d99f4.tar.bz2
gentoo-2-dc2fdbd2bc2013432af7cf12019b3240405d99f4.zip
Add support for @ROFF (idea from Ulrich Müller), and escape any leading . chars in comments to avoid mangling of the content #420153 by Michał Górny.
(Portage version: 2.2.0_alpha116/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'app-portage')
-rw-r--r--app-portage/eclass-manpages/ChangeLog10
-rw-r--r--app-portage/eclass-manpages/eclass-manpages-20111014.ebuild25
-rw-r--r--app-portage/eclass-manpages/eclass-manpages-20120718.ebuild (renamed from app-portage/eclass-manpages/eclass-manpages-20100821.ebuild)12
-rw-r--r--app-portage/eclass-manpages/files/eclass-to-manpage.awk39
4 files changed, 41 insertions, 45 deletions
diff --git a/app-portage/eclass-manpages/ChangeLog b/app-portage/eclass-manpages/ChangeLog
index 51a8694a92a1..b688b4ecfdb3 100644
--- a/app-portage/eclass-manpages/ChangeLog
+++ b/app-portage/eclass-manpages/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-portage/eclass-manpages
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/ChangeLog,v 1.30 2012/07/18 14:24:06 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/ChangeLog,v 1.31 2012/07/18 14:27:54 vapier Exp $
+
+*eclass-manpages-20120718 (18 Jul 2012)
+
+ 18 Jul 2012; Mike Frysinger <vapier@gentoo.org>
+ +eclass-manpages-20120718.ebuild, -eclass-manpages-20100821.ebuild,
+ -eclass-manpages-20111014.ebuild, files/eclass-to-manpage.awk:
+ Add support for @ROFF (idea from Ulrich Müller), and escape any leading .
+ chars in comments to avoid mangling of the content #420153 by Michał Górny.
18 Jul 2012; Mike Frysinger <vapier@gentoo.org> files/eclass-to-manpage.awk:
Error out when we hit an unknown keyword in an @ECLASS block.
diff --git a/app-portage/eclass-manpages/eclass-manpages-20111014.ebuild b/app-portage/eclass-manpages/eclass-manpages-20111014.ebuild
deleted file mode 100644
index fcb49c2d7229..000000000000
--- a/app-portage/eclass-manpages/eclass-manpages-20111014.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/eclass-manpages-20111014.ebuild,v 1.3 2011/12/08 18:36:36 slyfox 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 ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
-IUSE=""
-
-DEPEND=""
-RDEPEND=""
-
-S=${WORKDIR}
-
-src_compile() {
- bash "${FILESDIR}"/eclass-to-manpage.sh || die
-}
-
-src_install() {
- doman *.5 || die
-}
diff --git a/app-portage/eclass-manpages/eclass-manpages-20100821.ebuild b/app-portage/eclass-manpages/eclass-manpages-20120718.ebuild
index 715d08feba00..41adc8f72cc2 100644
--- a/app-portage/eclass-manpages/eclass-manpages-20100821.ebuild
+++ b/app-portage/eclass-manpages/eclass-manpages-20120718.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/eclass-manpages-20100821.ebuild,v 1.4 2011/12/08 18:36:36 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/eclass-manpages-20120718.ebuild,v 1.1 2012/07/18 14:27:54 vapier Exp $
DESCRIPTION="collection of Gentoo eclass manpages"
HOMEPAGE="http://www.gentoo.org/"
@@ -17,13 +17,7 @@ RDEPEND=""
S=${WORKDIR}
src_compile() {
- local e
- for e in "${ECLASSDIR}"/*.eclass ; do
- gawk \
- -vPORTDIR="${PORTDIR}" \
- -f "${FILESDIR}"/eclass-to-manpage.awk \
- ${e} > ${e##*/}.5 || rm -f ${e##*/}.5
- done
+ bash "${FILESDIR}"/eclass-to-manpage.sh || die
}
src_install() {
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index a3b0558d9812..b3c11bb65053 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -1,6 +1,6 @@
# Copyright 1999-2012 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.26 2012/07/18 14:24:06 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.27 2012/07/18 14:27:54 vapier Exp $
# This awk converts the comment documentation found in eclasses
# into man pages for easier/nicer reading.
@@ -54,6 +54,10 @@
# 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) {
@@ -82,22 +86,37 @@ function eat_paragraph() {
code = 0
ret = ""
getline
- while ($0 ~ /^#([[:space:]]*$|[[:space:]][^@])/) {
+ 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
- if ($0 ~ /^# @CODE$/) {
- if (code)
- ret = ret "\n.fi"
- else
- ret = ret "\n.nf"
- code = !code
- getline
- }
}
sub(/^\n/,"",ret)
return ret