From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: bin/
Date: Fri, 28 Feb 2020 06:20:46 +0000 (UTC) [thread overview]
Message-ID: <1582870667.e01ceaed422f53a782300feaebf252773e78c2e4.ulm@gentoo> (raw)
commit: e01ceaed422f53a782300feaebf252773e78c2e4
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 18:10:17 2020 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 06:17:47 2020 +0000
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e01ceaed
bin/gen-eclass-html.sh: New option -n to create a placeholder file.
The new strict dependencies will cause the build to fail if
eclass-reference/text.xml is missing, because it is needed as
a dependency for index.html of the previous and next documents.
Add an option that makes it possible to create the file, even if
the eclass documentation is missing.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
bin/gen-eclass-html.sh | 50 +++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 43 insertions(+), 7 deletions(-)
diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh
index 10292eb..ed43090 100755
--- a/bin/gen-eclass-html.sh
+++ b/bin/gen-eclass-html.sh
@@ -100,8 +100,35 @@ guesscompress() {
esac
}
-# We also need the ebuild man page
-for i in $(/usr/bin/qlist eclass-manpages) /usr/share/man/man5/ebuild.5*; do
+usage() {
+ cat <<- EOF >&2
+ Usage: $0 [OPTION]...
+ Convert eclass man pages to HTML.
+
+ -n do not build anything, only create a placeholder index
+ -h display this help and exit
+ EOF
+}
+
+while getopts 'nh' opt; do
+ case ${opt} in
+ n) NOMAN=true ;;
+ h) usage; exit 0 ;;
+ *) usage; exit 1 ;;
+ esac
+done
+shift $((OPTIND-1))
+
+MANPAGES=()
+[[ -n ${NOMAN} ]] || MANPAGES=(
+ $(/usr/bin/qlist eclass-manpages)
+ # We also need the ebuild man page
+ /usr/share/man/man5/ebuild.5*
+)
+
+[[ -d ${OUTPUTDIR} ]] || mkdir -p "${OUTPUTDIR}" || exit 1
+
+for i in "${MANPAGES[@]}"; do
FILEBASE=${i##*/}
BASENAME="${FILEBASE%.5*}"
[[ ${BASENAME} != "${FILEBASE}" ]] || continue
@@ -150,15 +177,24 @@ installed by emerging <c>app-doc/eclass-manpages</c>.
<section>
<title>Contents</title>
<body>
-<ul class="list-group">
EOF
-for i in $(find $OUTPUTDIR/ -maxdepth 1 -mindepth 1 -type d | sort); do
- echo "<li><uri link=\"$(basename $i)/index.html\">$(basename $i)</uri></li>" >> ${OUTPUTDIR}/text.xml
-done
+if [[ -n ${NOMAN} ]]; then
+ cat <<- EOF >> "${OUTPUTDIR}"/text.xml
+ <warning>
+ This is only a placeholder. If you see this text in the output document,
+ then the eclass documentation is missing.
+ </warning>
+ EOF
+else
+ echo '<ul class="list-group">' >> "${OUTPUTDIR}"/text.xml
+ for i in $(find "${OUTPUTDIR}" -maxdepth 1 -mindepth 1 -type d | sort); do
+ echo "<li><uri link=\"$(basename $i)/index.html\">$(basename $i)</uri></li>" >> "${OUTPUTDIR}"/text.xml
+ done
+ echo '</ul>' >> "${OUTPUTDIR}"/text.xml
+fi
cat << EOF >> ${OUTPUTDIR}/text.xml
-</ul>
</body>
</section>
</chapter>
next reply other threads:[~2020-02-28 6:20 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 6:20 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-29 11:41 [gentoo-commits] proj/devmanual:master commit in: bin/ Ulrich Müller
2024-10-29 11:41 Ulrich Müller
2024-10-29 11:19 Ulrich Müller
2024-10-29 11:41 ` Ulrich Müller
2024-10-29 11:19 Ulrich Müller
2022-04-26 7:41 Ulrich Müller
2021-02-25 19:30 Ulrich Müller
2020-10-26 15:42 Ulrich Müller
2020-02-28 6:58 Ulrich Müller
2020-02-13 12:28 Ulrich Müller
2020-02-03 0:05 Ulrich Müller
2020-01-29 18:00 Ulrich Müller
2020-01-27 20:55 Ulrich Müller
2020-01-18 10:15 Ulrich Müller
2020-01-16 18:53 Ulrich Müller
2020-01-12 9:23 Ulrich Müller
2020-01-09 21:25 Ulrich Müller
2020-01-02 23:59 Göktürk Yüksek
2019-12-26 22:44 Göktürk Yüksek
2019-12-26 1:56 Göktürk Yüksek
2019-12-26 1:56 Göktürk Yüksek
2019-12-26 1:56 Göktürk Yüksek
2019-12-25 4:36 Göktürk Yüksek
2019-12-21 5:19 Ulrich Müller
2019-12-15 18:05 Ulrich Müller
2019-12-15 17:25 Ulrich Müller
2019-12-15 17:25 Ulrich Müller
2019-12-14 13:19 Ulrich Müller
2019-12-14 12:01 Ulrich Müller
2019-12-09 21:39 Ulrich Müller
2019-11-07 15:06 Brian Evans
2019-11-07 14:09 Brian Evans
2019-08-25 8:43 Ulrich Müller
2019-03-22 19:46 Brian Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1582870667.e01ceaed422f53a782300feaebf252773e78c2e4.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox