* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2015-08-14 4:07 Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2015-08-14 4:07 UTC (permalink / raw
To: gentoo-commits
commit: 0bc58e562cd8ef5447d1947eee69d980aa3c202f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 14 04:03:32 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Aug 14 04:05:36 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bc58e56
app-portage/eclass-manpages: fix gensub warnings
Newer gawk warns when you use an empty string with the 3rd arg to gensub
since that only accepts "g", "G", or a number.
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index ee42810..979ad10 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -294,12 +294,12 @@ function _handle_variable() {
# first try var="val"
op = "="
regex = "^.*" var_name "=(.*)$"
- val = gensub(regex, "\\1", "", $0)
+ val = gensub(regex, "\\1", 1, $0)
if (val == $0) {
# next try : ${var:=val}
op = "?="
regex = "^[[:space:]]*:[[:space:]]*[$]{" var_name ":?=(.*)}"
- val = gensub(regex, "\\1", "", $0)
+ 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)
@@ -367,7 +367,7 @@ function handle_footer() {
print ".BR " eclassdir "/" eclass
print ".SH \"SEE ALSO\""
print ".BR ebuild (5)"
- print pre_text(gensub("@ECLASS@", eclass, "", vcs_url))
+ print pre_text(gensub("@ECLASS@", eclass, 1, vcs_url))
}
#
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2017-11-17 16:49 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-11-17 16:49 UTC (permalink / raw
To: gentoo-commits
commit: 900365947d030667731279e7978c3457d847fb5a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 28 13:49:14 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 16:49:21 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90036594
app-portage/eclass-manpages: Add @SUPPORTED_EAPIS tag for eclass
Add a @SUPPORTED_EAPIS tag that can be used to explicitly provide a list
of EAPIs that are supported by the eclass. The main goal is to make it
possible to extract this list with relative ease, for scripting
purposes. It is not included explicitly in the manpages at the moment.
The first use case is to make it possible to explicitly distinguish
eclasses that do not support a specific EAPI from eclasses that are not
used by any ebuilds using a specific EAPI. Therefore, it will make it
possible to easily detect when we can deprecate old EAPIs from eclasses.
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 0b65162c04e..fe7e9c12d8f 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -18,6 +18,7 @@
# <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@>
+# @SUPPORTED_EAPIS: <optional; space-separated list of EAPIs>
# @BLURB: <required; short description>
# @DESCRIPTION:
# <optional; long description>
@@ -147,6 +148,7 @@ function handle_eclass() {
eclass = $3
eclass_maintainer = ""
eclass_author = ""
+ supported_eapis = ""
blurb = ""
desc = ""
example = ""
@@ -176,6 +178,8 @@ function handle_eclass() {
reporting_bugs = eat_paragraph()
if ($2 == "@VCSURL:")
vcs_url = eat_line()
+ if ($2 == "@SUPPORTED_EAPIS:")
+ supported_eapis = eat_line()
if ($2 == "@BLURB:")
blurb = eat_line()
if ($2 == "@DESCRIPTION:")
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2017-11-17 16:49 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-11-17 16:49 UTC (permalink / raw
To: gentoo-commits
commit: 1a2962517426e51bea4b05b848175d788f44766f
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 28 14:51:12 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 16:49:22 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a296251
app-portage/eclass-manpages: Introduce additional variable classes
Add a few additional variable classes to better emphasize the specifics
of different kinds of variables set for eclasses, and by eclasses.
The change applied, each eclass variable can belong to one of
the following five eclasses:
1. (default) - variable set by ebuild, influences eclass behavior.
2. @PRE_INHERIT - likewise but must be set above the inherit line,
and not modified afterwards.
3. @USER_VARIABLE - variable to be set by user (make.conf), and not
by ebuilds. This mostly involves MAKEOPTS-style variables.
4. @OUTPUT_VARIABLE - variable that is generated and defined by eclass,
and ebuilds can *read* it.
5. @INTERNAL - (existing) internal use variable.
.../eclass-manpages/files/eclass-to-manpage.awk | 32 ++++++++++++++++++++--
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index fe7e9c12d8f..b2f9afb0fa9 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -37,8 +37,9 @@
# The format of function-specific variables:
# @VARIABLE: foo
+# [@USER_VARIABLE] (set in make.conf, not ebuilds)
+# [@INTERNAL] (internal eclass use variable)
# [@DEFAULT_UNSET]
-# [@INTERNAL]
# [@REQUIRED]
# @DESCRIPTION:
# <required; blurb about this variable>
@@ -46,8 +47,11 @@
# The format of eclass variables:
# @ECLASS-VARIABLE: foo
+# [@PRE_INHERIT] (the variable must be set before inheriting the eclass)
+# [@USER_VARIABLE] (set in make.conf, not ebuilds)
+# [@OUTPUT_VARIABLE] (set by eclass, to be read in ebuilds)
+# [@INTERNAL] (internal eclass use variable)
# [@DEFAULT_UNSET]
-# [@INTERNAL]
# [@REQUIRED]
# @DESCRIPTION:
# <required; blurb about this variable>
@@ -279,6 +283,11 @@ function _handle_variable() {
internal = 0
required = 0
+ # additional variable classes
+ pre_inherit = 0
+ user_variable = 0
+ output_variable = 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)
@@ -294,6 +303,12 @@ function _handle_variable() {
internal = 1
else if ($2 == "@REQUIRED")
required = 1
+ else if ($2 == "@PRE_INHERIT")
+ pre_inherit = 1
+ else if ($2 == "@USER_VARIABLE")
+ user_variable = 1
+ else if ($2 == "@OUTPUT_VARIABLE")
+ output_variable = 1
else
opts = 0
}
@@ -311,7 +326,7 @@ function _handle_variable() {
regex = "^[[:space:]]*:[[:space:]]*[$]{" var_name ":?=(.*)}"
val = gensub(regex, "\\1", 1, $0)
if (val == $0) {
- if (default_unset + required + internal == 0)
+ if (default_unset + required + internal + output_variable == 0)
warn(var_name ": unable to extract default variable content: " $0)
val = ""
} else if (val !~ /^["']/ && val ~ / /) {
@@ -324,6 +339,17 @@ function _handle_variable() {
val = " " op " \\fI" val "\\fR"
if (required == 1)
val = val " (REQUIRED)"
+ # TODO: group variables using those classes
+ if (pre_inherit == 1)
+ val = val " (SET BEFORE INHERIT)"
+ if (user_variable == 1)
+ val = val " (USER VARIABLE)"
+ if (output_variable == 1)
+ val = val " (GENERATED BY ECLASS)"
+
+ # check for invalid combos
+ if (internal + pre_inherit + user_variable + output_variable > 1)
+ fail(var_name ": multiple variable classes specified")
if (internal == 1)
return ""
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2017-03-21 18:22 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-03-21 18:22 UTC (permalink / raw
To: gentoo-commits
commit: 9178bbd9f43529f0b31d24f0e1f581ea833826fe
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 14 15:54:43 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 18:22:43 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9178bbd9
app-portage/eclass-manpages: Do not include system paths in manpages
Replace the system paths in generated manpages with just the eclass
filename. This avoids depending on any particular system layout.
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 5 +----
app-portage/eclass-manpages/files/eclass-to-manpage.sh | 1 -
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 02eb4c82581..0b65162c04e 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -370,7 +370,7 @@ function handle_footer() {
print ".SH \"REPORTING BUGS\""
print reporting_bugs
print ".SH \"FILES\""
- print ".BR " eclassdir "/" eclass
+ print ".BR " eclass
print ".SH \"SEE ALSO\""
print ".BR ebuild (5)"
print pre_text(gensub("@ECLASS@", eclass, 1, vcs_url))
@@ -381,9 +381,6 @@ function handle_footer() {
#
BEGIN {
state = "header"
- if (ECLASSDIR == "")
- ECLASSDIR = "/usr/portage/eclass"
- eclassdir = ECLASSDIR
reporting_bugs = "Please report bugs via http://bugs.gentoo.org/"
vcs_url = "https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/@ECLASS@"
}
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.sh b/app-portage/eclass-manpages/files/eclass-to-manpage.sh
index 186a712e806..5f389390d60 100755
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.sh
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.sh
@@ -25,7 +25,6 @@ ret=0
for e in "$@" ; do
set -- \
${AWK} \
- -vECLASSDIR="${ECLASSDIR}" \
-f "${FILESDIR}"/eclass-to-manpage.awk \
${e}
if [[ ${AWK} == "gawk" ]] ; then
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2017-03-21 18:22 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-03-21 18:22 UTC (permalink / raw
To: gentoo-commits
commit: feae936d4eed8e5294dca4048fe8d5a5b3650401
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 14 15:52:44 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 18:22:43 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=feae936d
app-portage/eclass-manpages: Remove unused PORTDIR from the script
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 2 +-
app-portage/eclass-manpages/files/eclass-to-manpage.sh | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 81241014ca3..02eb4c82581 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# 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
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.sh b/app-portage/eclass-manpages/files/eclass-to-manpage.sh
index 7706afa7ae6..186a712e806 100755
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.sh
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-: ${PORTDIR:=/usr/portage}
: ${ECLASSDIR:=${0%/*}/../../../eclass}
: ${FILESDIR:=${ECLASSDIR}/../app-portage/eclass-manpages/files}
@@ -27,7 +26,6 @@ for e in "$@" ; do
set -- \
${AWK} \
-vECLASSDIR="${ECLASSDIR}" \
- -vPORTDIR="${PORTDIR}" \
-f "${FILESDIR}"/eclass-to-manpage.awk \
${e}
if [[ ${AWK} == "gawk" ]] ; then
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2016-08-15 14:09 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2016-08-15 14:09 UTC (permalink / raw
To: gentoo-commits
commit: 6bf56bbc7505c5302bac82864c43377ef9b2e28a
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 14:09:10 2016 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 14:09:10 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bf56bbc
app-portage/eclass-manpages: add a note about @DEAD
Package-Manager: portage-2.3.0_p16
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 78dd0a6..a6af1ba 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -53,6 +53,9 @@
# <required; blurb about this variable>
# foo="<default value>"
+# Disable manpage generation:
+# @DEAD
+
# Common features:
# @CODE
# In multiline paragraphs, you can create chunks of unformatted
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2015-08-14 4:26 Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2015-08-14 4:26 UTC (permalink / raw
To: gentoo-commits
commit: c2af4e0908ddaf86a16bc10853534f16e02ff52a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 14 04:25:15 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Aug 14 04:25:15 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2af4e09
app-portage/eclass-manpages: pass up exit codes to the caller
This will let us make errors in the docs fatal in the ebuild if we want.
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 12 ++++++++++--
app-portage/eclass-manpages/files/eclass-to-manpage.sh | 12 +++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 979ad10..cc21a73 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -79,6 +79,10 @@ function fail(text) {
_stderr_msg(text, "error")
exit(1)
}
+function xfail(text) {
+ _stderr_msg(text, "error (ignoring)")
+ exit(77)
+}
function eat_line() {
ret = $0
@@ -392,8 +396,12 @@ BEGIN {
state = "funcvar"
} else if ($0 == "# @DEAD") {
eclass = "dead"
- exit(10)
+ 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)
@@ -414,7 +422,7 @@ BEGIN {
#
END {
if (eclass == "")
- fail("eclass not documented yet (no @ECLASS found)")
+ 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
index da97e37..d41de42 100755
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.sh
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.sh
@@ -22,6 +22,7 @@ fi
[[ $# -eq 0 ]] && set -- "${ECLASSDIR}"/*.eclass
+ret=0
for e in "$@" ; do
set -- \
${AWK} \
@@ -29,8 +30,17 @@ for e in "$@" ; do
-f "${FILESDIR}"/eclass-to-manpage.awk \
${e}
if [[ ${AWK} == "gawk" ]] ; then
- "$@" > ${e##*/}.5 || rm -f ${e##*/}.5
+ "$@" > ${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}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/
@ 2015-08-14 4:07 Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2015-08-14 4:07 UTC (permalink / raw
To: gentoo-commits
commit: af7a9cb899d8f0451e2249efb505c3f95c5f81c0
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 14 04:03:18 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Aug 14 04:05:35 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af7a9cb8
app-portage/eclass-manpages: add a check for the @ECLASS name #537392
app-portage/eclass-manpages/files/eclass-to-manpage.awk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
index 11ece1f..ee42810 100644
--- a/app-portage/eclass-manpages/files/eclass-to-manpage.awk
+++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk
@@ -145,6 +145,10 @@ function handle_eclass() {
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"
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-17 16:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-14 4:07 [gentoo-commits] repo/gentoo:master commit in: app-portage/eclass-manpages/files/ Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2017-11-17 16:49 Michał Górny
2017-11-17 16:49 Michał Górny
2017-03-21 18:22 Michał Górny
2017-03-21 18:22 Michał Górny
2016-08-15 14:09 Mike Gilbert
2015-08-14 4:26 Mike Frysinger
2015-08-14 4:07 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox