From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6BB5215807B for ; Tue, 29 Oct 2024 11:19:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2A37EE081E; Tue, 29 Oct 2024 11:19:37 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0D03AE0819 for ; Tue, 29 Oct 2024 11:19:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DBDFC3430D0 for ; Tue, 29 Oct 2024 11:19:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4BDEF1737 for ; Tue, 29 Oct 2024 11:19:34 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1730200638.f9abc1d4273dc6dc2a61e13105f435c61a8f24ba.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: /, bin/ X-VCS-Repository: proj/devmanual X-VCS-Files: Makefile bin/gen-eclass-html.sh X-VCS-Directories: / bin/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: f9abc1d4273dc6dc2a61e13105f435c61a8f24ba X-VCS-Branch: master Date: Tue, 29 Oct 2024 11:19:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5f70a222-aa0a-430b-aa5b-c808fd18226a X-Archives-Hash: ec2352ed6e58fafd9fdb1bb6a29a9ec3 commit: f9abc1d4273dc6dc2a61e13105f435c61a8f24ba Author: Ulrich Müller gentoo org> AuthorDate: Tue Oct 29 11:17:18 2024 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Oct 29 11:17:18 2024 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=f9abc1d4 bin/gen-eclass-html.sh: Add eclasses fallback for the offline version Signed-off-by: Ulrich Müller gentoo.org> Makefile | 2 +- bin/gen-eclass-html.sh | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4fbbd90..a94361f 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ eclass-reference/text.xml: @echo "Install app-doc/eclass-manpages and" >&2 @echo "run bin/gen-eclass-html.sh before calling make." >&2 @echo "Creating a placeholder index as fallback." >&2 - bin/gen-eclass-html.sh -n + OFFLINE="$(OFFLINE)" bin/gen-eclass-html.sh -n appendices/todo-list/index.html: $(XMLS) diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh index b17fbc5..9dd6a56 100755 --- a/bin/gen-eclass-html.sh +++ b/bin/gen-eclass-html.sh @@ -180,31 +180,48 @@ Note that most eclasses have an accompanying manual page. These man pages can be installed by emerging app-doc/eclass-manpages.

- - -
-Contents - EOF -if [[ -n ${NOMAN} ]]; then +if [[ -z ${NOMAN} ]]; then + cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1 + + +
+ Contents + + +
    + EOF + for i in $(find "${OUTPUTDIR}" -maxdepth 1 -mindepth 1 -type d | sort); do + echo "
  • $(basename $i)
  • " \ + >> "${OUTPUTDIR}"/text.xml || exit 1 + done + cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1 +
+ +
+ EOF +elif [[ ${OFFLINE} -ne 0 ]]; then + # Offline version, absence of eclasses is expected => note + cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1 + + The offline version of the devmanual does not include the documentation + for the eclasses. + + + EOF +else + # Otherwise, presumably something went wrong => warning cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1 This is only a placeholder. If you see this text in the output document, then the eclass documentation is missing. + EOF -else - echo '
    ' >> "${OUTPUTDIR}"/text.xml || exit 1 - for i in $(find "${OUTPUTDIR}" -maxdepth 1 -mindepth 1 -type d | sort); do - echo "
  • $(basename $i)
  • " >> "${OUTPUTDIR}"/text.xml || exit 1 - done - echo '
' >> "${OUTPUTDIR}"/text.xml || exit 1 fi cat << 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1 - -
EOF