summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-01 18:13:07 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-01 18:13:07 +0000
commit5ad8121f6a2d9a0c04674f09ec41c15e147bcb40 (patch)
tree4d816a988bf3d9bc39f48e60a4c70f356ebef170 /app-portage
parentStable on ppc wrt bug 190405 (diff)
downloadgentoo-2-5ad8121f6a2d9a0c04674f09ec41c15e147bcb40.tar.gz
gentoo-2-5ad8121f6a2d9a0c04674f09ec41c15e147bcb40.tar.bz2
gentoo-2-5ad8121f6a2d9a0c04674f09ec41c15e147bcb40.zip
add a comment block to the top of manpages explaining that it's autogenerated and include the words 'error' and 'warning' in the output so people know the difference
(Portage version: 2.1.3.7)
Diffstat (limited to 'app-portage')
-rw-r--r--app-portage/eclass-manpages/files/eclass-to-manpage.awk21
1 files changed, 17 insertions, 4 deletions
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 742c097a05a5..e75e9d781008 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-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.9 2007/09/01 15:17:17 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.10 2007/09/01 18:13:07 vapier Exp $
# This awk converts the comment documentation found in eclasses
# into man pages for easier/nicer reading.
@@ -32,11 +32,13 @@
# @VARIABLE: foo
# @DESCRIPTION:
# <required; blurb about this variable>
+# foo="<default value>"
# The format of eclass variables:
# @ECLASS-VARIABLE: foo
# @DESCRIPTION:
# <required; blurb about this variable>
+# foo="<default value>"
# Common features:
# @CODE
@@ -44,11 +46,14 @@
# 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) {
- print FILENAME ":" NR ": " text > "/dev/stderr"
+ _stderr_msg(text, "warning")
}
function fail(text) {
- warn(text)
+ _stderr_msg(text, "error")
exit(1)
}
@@ -94,6 +99,13 @@ function handle_eclass() {
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
@@ -181,7 +193,8 @@ function _handle_variable() {
# extract the default variable value
val = $0
- sub(/^[^=]*=/, "", val)
+ regex = "^.*" var_name "="
+ sub(regex, "", val)
if ($0 == val) {
warn(var_name ": unable to extract default variable content: " $0)
val = ""