[libvirt] [PATCH 1/3] NEWS: Improve building pipeline

Martin Kletzander mkletzan at redhat.com
Thu Jan 5 09:39:34 UTC 2017


On Wed, Jan 04, 2017 at 04:49:07PM +0100, Andrea Bolognani wrote:
>Currently, building the NEWS file involves using a XSLT stylesheet
>to extract information from the same HTML file that's used on the
>libvirt website.
>
>The process works, but it's quite fiddly in that it requires the
>source HTML to be formatted in a very precise way, and a single
>missing newline can mess up the resulting plain text considerably.
>
>Moreover, the XSLT stylesheet itself encodes a lot of the details
>of converting to plain text in a way that's not necessarily easy
>to understand, tweak or fix.
>
>To improve the process, move all existing entries to a new XML
>file that contains exactly the information we care about in a
>simple structured format, and start generating both the HTML and
>plain text versions of the release notes using XSLT stylesheets
>that can now afford to be almost trivial.
>---
>With this patch applied, the generated NEWS file is actually
>much worse off. That's fixed by the next one.
>
> .gitignore        |   1 +
> Makefile.am       |   6 +-
> docs/Makefile.am  |  20 ++++-
> docs/NEWS.xsl     |  61 ++++++++++++++
> docs/news.html.in | 157 -----------------------------------
> docs/news.xml     | 241 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> docs/news.xsl     | 103 ++++++++++++++++-------

NEWS.xsl and news.xsl will be the same file on some filesystems.  I seem
to recall that we are trying to "support" such filesystems, so there
should be different naming.

> 7 files changed, 395 insertions(+), 194 deletions(-)
> create mode 100644 docs/NEWS.xsl
> delete mode 100644 docs/news.html.in
> create mode 100644 docs/news.xml
>
>diff --git a/.gitignore b/.gitignore
>index 984ad07..7b71bd1 100644
>--- a/.gitignore
>+++ b/.gitignore
>@@ -72,6 +72,7 @@
> /docs/libvirt-lxc-*.xml
> /docs/libvirt-qemu-*.xml
> /docs/libvirt-refs.xml
>+/docs/news.html.in

Since this is ignored now, it should have the "do not edit this file"
somewhere inside the file, in a comment.

>diff --git a/docs/news.xsl b/docs/news.xsl
>index 33506a9..a940026 100644
>--- a/docs/news.xsl
>+++ b/docs/news.xsl

[...]

>+        <p>Releases earlier than v2.5.0 detailed their changes using a
>+        different format and as such are excluded from the list above.
>+        You can read about those older release, starting from those made in
>+        <a href="news-2016.html">2016</a>.
>+        </p>

Maybe something similar would fit the NEWS file as well?  Not required,
though.

Summary:  The XSLT looks cleaner, although it's still XSL.  The result
          is easier to read than the diff as well (just a hint for
          someone looking at it as well).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170105/02d82075/attachment-0001.sig>


More information about the libvir-list mailing list