summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-08-14 00:25:15 -0400
committerMike Frysinger <vapier@gentoo.org>2015-08-14 00:25:15 -0400
commitc2af4e0908ddaf86a16bc10853534f16e02ff52a (patch)
tree84bd44c778a9cca92efb917d33800d6b2404334c /app-portage
parenteclass: more misc doc fixes (diff)
downloadgentoo-c2af4e0908ddaf86a16bc10853534f16e02ff52a.tar.gz
gentoo-c2af4e0908ddaf86a16bc10853534f16e02ff52a.tar.bz2
gentoo-c2af4e0908ddaf86a16bc10853534f16e02ff52a.zip
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.
Diffstat (limited to 'app-portage')
-rw-r--r--app-portage/eclass-manpages/files/eclass-to-manpage.awk12
-rwxr-xr-xapp-portage/eclass-manpages/files/eclass-to-manpage.sh12
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 979ad10a6a88..cc21a73933a2 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 da97e3772735..d41de426debd 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}