]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Prevent splitting GitLab identifiers across lines
authorMichał Kępień <michal@isc.org>
Fri, 3 Jan 2020 08:08:09 +0000 (09:08 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 3 Jan 2020 08:08:09 +0000 (09:08 +0100)
GitLab issue and merge request numbers placed in release notes (in the
form of "#1234" for issues and "!5678" for merge requests) should not be
split across two lines.  Extend the shell pipeline generating
doc/arm/notes.txt with a sed invocation which prevents such splitting.

(cherry picked from commit 2d00143ab161aba573649c445603bab72ad82e25)

doc/arm/Makefile.in

index f1d493567a4f38d9c5f46ec74a9f28ca5e2e6a4b..0a9f7d94d2a18f48e30ecfd8d7436f0f23d20f84 100644 (file)
@@ -56,10 +56,16 @@ notes.pdf: notes-wrapper.xml ${NOTESXML} releaseinfo.xml pkgversion.xml notevers
        ${XSLTPROC} ${top_srcdir}/doc/xsl/pre-latex.xsl notes-wrapper.xml | \
        ${DBLATEX} -c notes.conf -Pdoc.layout="mainmatter" -o notes.pdf -
 
+# Produce notes.txt from notes.html using w3m, with some post-processing:
+#
+#  - remove trailing spaces from every line,
+#  - remove empty lines from the end of the document,
+#  - prevent GitLab issue/MR identifiers from being split across two lines.
 notes.txt: notes.html
        ${W3M} -dump -cols 75 -O ascii -T text/html < notes.html | \
                sed 's/  *$$//' | \
-               sed -e :a -e '/^\n*$$/{$$d;N;};/\n$$/ba' > notes.txt
+               sed -e :a -e '/^\n*$$/{$$d;N;};/\n$$/ba' | \
+               sed '/ [!#]$$/{N;s| \([!#]\)\(\n\s*\)\([0-9][0-9]*\)|\2\1\3|;};' > notes.txt
 
 # use xmllint to process include
 Bv9ARM.html: Bv9ARM-book.xml ${NOTESXML} releaseinfo.xml pkgversion.xml noteversion.xml