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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3C140138334 for ; Sun, 15 Dec 2019 17:25:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78DACE0828; Sun, 15 Dec 2019 17:25:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 60604E0828 for ; Sun, 15 Dec 2019 17:25:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3367434D500 for ; Sun, 15 Dec 2019 17:25:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D81F38AF for ; Sun, 15 Dec 2019 17:25:43 +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: <1576430460.1a48b2360b0be82bd6f2c828142859235c44a0b3.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: bin/ X-VCS-Repository: proj/devmanual X-VCS-Files: bin/gen-eclass-html.sh X-VCS-Directories: bin/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 1a48b2360b0be82bd6f2c828142859235c44a0b3 X-VCS-Branch: master Date: Sun, 15 Dec 2019 17:25:43 +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: a13d5c0c-2375-48b8-87bb-93ad56c07938 X-Archives-Hash: bc3883b19e02b59168f28f86c4c5e08a commit: 1a48b2360b0be82bd6f2c828142859235c44a0b3 Author: Ulrich Müller gentoo org> AuthorDate: Sun Dec 15 17:21:00 2019 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Dec 15 17:21:00 2019 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=1a48b236 bin/gen-eclass-html.sh: Fix regexp for link substitution. The previous regexp was too greedy and combined several links into one, if they were on the same line. Remove dead relative links (i.e., not pointing to other eclasses). Replace the complicated "tail" command by a simple "1,4d" in sed. This also makes the temporary file unnecessary. Signed-off-by: Ulrich Müller gentoo.org> bin/gen-eclass-html.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh index 5ccfc71..b557093 100755 --- a/bin/gen-eclass-html.sh +++ b/bin/gen-eclass-html.sh @@ -98,20 +98,17 @@ for i in $(/usr/bin/qlist eclass-manpages) /usr/share/man/man5/ebuild.5*; do BASENAME="${FILEBASE%.5*}" [[ ${BASENAME} != "${FILEBASE}" ]] || continue DIRNAME="${OUTPUTDIR}/${BASENAME}" - TMP="${DIRNAME}/index.html.tmp" FINAL="${DIRNAME}/index.html" DECOMPRESS=$(guesscompress "${i}") [[ -d ${DIRNAME} ]] || mkdir -p ${DIRNAME} # rebuild the man page each time echo -n "${HEADER//@TITLE@/${BASENAME}}" > "${FINAL}" - # generate html pages and fix hyperlinks for eclass and ebuild man pages - $DECOMPRESS "$i" | /usr/bin/man2html -r - | \ - sed -e "/:=../\1/index.html>:" \ - -e "/<\/BODY>/d" -e "/<\/HTML>/d" \ - -e "/:=../\1/\index.html>:" >> ${TMP} - # The first 4 lines are cruft for devmanual - tail -n $(($(wc -l ${TMP} | awk '{print $1}') - 4)) ${TMP} >> ${FINAL} - rm -f ${TMP} + # generate html pages and fix hyperlinks for eclass and ebuild man pages + ${DECOMPRESS} "${i}" | /usr/bin/man2html -r - \ + | sed -e "1,4d;/<\/BODY>/d;/<\/HTML>/d" \ + -e '/\([^<>]*\):\1:g' \ + >> "${FINAL}" echo -n "${FOOTER}" >> "${FINAL}" done