From b99916e9d8c1c447653c24709917c3236fe19a8d Mon Sep 17 00:00:00 2001 From: Isaac Parenteau Date: Fri, 4 Sep 2026 17:38:20 -0500 Subject: [PATCH] Added missing file --- .gitignore | 2 ++ scripts/release-notes.awk | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 scripts/release-notes.awk diff --git a/.gitignore b/.gitignore index 774e63a..d54337d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ tags /.run/ /out/ *.awk +# Required source for the Jenkins release-notes appendix. +!/scripts/release-notes.awk diff --git a/scripts/release-notes.awk b/scripts/release-notes.awk new file mode 100644 index 0000000..8b75665 --- /dev/null +++ b/scripts/release-notes.awk @@ -0,0 +1,38 @@ +# Convert the Markdown emitted by release-notes.sh to a safe LaTeX appendix. +# Escape character by character so commit messages cannot become TeX commands. +function tex(value, result, i, c) { + result = "" + for (i = 1; i <= length(value); i++) { + c = substr(value, i, 1) + if (c == "\\") result = result "\\textbackslash{}" + else if (c == "{" || c == "}" || c == "$" || c == "&" || c == "#" || c == "_" || c == "%") result = result "\\" c + else if (c == "~") result = result "\\textasciitilde{}" + else if (c == "^") result = result "\\textasciicircum{}" + else if (c == "`") result = result "\\textasciigrave{}" + else result = result c + } + return result +} +BEGIN { + print "% Generated by the Build LaTeX stage; do not edit." + print "\\chapter{Release Notes}" + print "\\label{release-notes}" + print "\\begingroup\\raggedright" +} +/^# Changes in / { + print "\\section*{" tex(substr($0, 3)) "}" + next +} +/^- / { + if (!items) { print "\\begin{itemize}"; items = 1 } + print "\\item " tex(substr($0, 3)) + next +} +{ + if (items) { print "\\end{itemize}"; items = 0 } + print tex($0) +} +END { + if (items) print "\\end{itemize}" + print "\\endgroup" +}