Skip to contentSkip to conversation

utils: add a csv to xml conversion script for legal info, rendering as html

PATCH New Nicolas Carrier 3 participants 4 messages Oct 27, 2019 – Apr 25, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils: add a csv to xml conversion script for legal info, rendering as html

An xsl file is provided alongside the python script, which is referenced by the generated xml.
This xsl file can be customized at will by users if they want to add, say extra information, styling or even a logo...
When the xml file is served in http, browsers like firefox can render it as if it was pure HTML.

Otherwise, the following command-line can generate actual HTML from this xml:

    xsltproc --output manifest.html manifest.xml

The current script version passes flake8 with no warning.

---

This is an alternative to the original proposal made by Mickael Tansorier in this patch: https://patchwork.ozlabs.org/patch/1184118/
But which adds no extra dependency yet still offers a nice looking rendering.

---
 DEVELOPERS              |  4 ++++
 utils/legal-info-to-xml | 42 ++++++++++++++++++++++++++++++++++++++++
 utils/legal-info.xsl    | 43 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+)
 create mode 100755 utils/legal-info-to-xml
 create mode 100644 utils/legal-info.xsl
DEVELOPERS +4 -0
index f41ac5f096..c8e8970ab1 100644
@@ -1726,6 +1726,10 @@ F:	package/libevdev/
 N:	Nicola Di Lieto <[email protected]>
 F:	package/uacme/
 
+N:	Nicolas Carrier <[email protected]>
+F:	utils/legal-info-to-xml
+F:	utils/legal-info.xsl
+
 N:	Nicolas Cavallari <[email protected]>
 F:	package/libgit2/
 
utils/legal-info-to-xml new file +42 -0

42 lines not on this page · raw message

utils/legal-info.xsl new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 utils: add a csv to xml conversion script for legal info, rendering as html

Nicolas, All,

On 2019-10-27 16:15 +0000, Nicolas Carrier spake thusly:

Quoted 6 lines

An xsl file is provided alongside the python script, which is referenced by the generated xml.
This xsl file can be customized at will by users if they want to add, say extra information, styling or even a logo...
When the xml file is served in http, browsers like firefox can render it as if it was pure HTML.

It does not work for me, unfortunately. From a clean tree:

    $ make defconfig
    $ make legal-info
    $ ./utils/legal-info-to-xml output/legal-info/manifest.csv \
                               >output/legal-info/legal-info.xml
    $ cp utils/legal-info.xsl output/legal-info/legal-info.xsl
    $ python2 -m SimpleHTTPServer 1234

And then in firefox:

    http://127.0.0.1:1234/output/legal-info/legal-info.xml

Then firefox will never stop "loading" the page (the boucing loading symbol in the tab will never stop). However, opening the console (F12) will indeed show the HTML page with the expected content (see attached HTML page). But the firefox page stays blank...

Regards,
Yann E. MORIN.

Signature · 9 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191102/998360f0/attachment-0001.html>

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 utils: add a csv to xml conversion script for legal info, rendering as html

Hello Yann,
Thank you for taking the time to review this proposal.

I tried the very same sequence of commands and it worked for me with Firefox 70.0, Chrome 77.0.3865.120 and Chromium 76.0.3809.100.

I suspect something related to your particular installation / configuration of Firefox.
Have you been able to test with another web browser by chance?

Can you please try to launch Firefox with a blank profile? Something like the following should work:

     $ mkdir output/temp-profile
     $ firefox -profile output/temp-profile/ -no-remote -new-instance
http://127.0.0.1:1234/output/legal-info/legal-info.xml

Can you also try to generate the html file with the xsltproc command- line and check if you have the same issue? As a reminder:

     $ xsltproc --output output/legal-info/legal-info.html
output/legal-info/legal-info.xml

You can then try to open output/legal-info/legal-info.html either directly in firefox and via the HTTP server you launched via python.

And then, last, can you please try using the attached xsl file instead, which has neither styling nor javascript?

PS: this is a resend to the busybox ML which I originally forgot to add to the recipients list.

Quoted 47 lines · Yann E. MORIN

Nicolas, All,

On 2019-10-27 16:15 +0000, Nicolas Carrier spake thusly:

Quoted 9 lines

An xsl file is provided alongside the python script, which is referenced
by the generated xml.
This xsl file can be customized at will by users if they want to add, say
extra information, styling or even a logo...
When the xml file is served in http, browsers like firefox can render it
as if it was pure HTML.

It does not work for me, unfortunately. From a clean tree:

    $ make defconfig
    $ make legal-info
    $ ./utils/legal-info-to-xml output/legal-info/manifest.csv \
                               >output/legal-info/legal-info.xml
    $ cp utils/legal-info.xsl output/legal-info/legal-info.xsl
    $ python2 -m SimpleHTTPServer 1234

And then in firefox:

    http://127.0.0.1:1234/output/legal-info/legal-info.xml

Then firefox will never stop "loading" the page (the boucing loading symbol in the tab will never stop). However, opening the console (F12)
will indeed show the HTML page with the expected content (see attached
HTML page). But the firefox page stays blank...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------
------------.

Quoted 8 lines

Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
+33 662 376 056 | Software Designer | \ /
CAMPAIGN | ___ |
+33 561 099 427 `------------.-------
: X AGAINST | \e/ There is no |
http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML
MAIL | v conspiracy. |

Quoted 5 lines

'------------------------------^-------^------------------^-------- ------------'
ATTENTION: This email came from an external source.
Do not open attachments or click on links from unknown senders or unexpected emails.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191105/92abfc41/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: legal-info.xsl
Type: application/xslt+xml
Size: 750 bytes
Desc: legal-info.xsl
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191105/92abfc41/attachment.xslt>

#4 lore raw

PATCH 1/1 utils: add a csv to xml conversion script for legal info, rendering as html

In reply to Nicolas Carrier

Hello,

+Cc the other Buildroot maintainers, as I'm taking a decision on this.

Quoted 7 lines · On Sun, 27 Oct 2019 16:15:30 +0000 Nicolas Carrier…

An xsl file is provided alongside the python script, which is referenced by the generated xml.
This xsl file can be customized at will by users if they want to add, say extra information, styling or even a logo...
When the xml file is served in http, browsers like firefox can render it as if it was pure HTML.

Quoted 7 lines

Otherwise, the following command-line can generate actual HTML from this xml:

    xsltproc --output manifest.html manifest.xml

The current script version passes flake8 with no warning.

So, I'm not thrilled by this, for several reasons:

- Why generate a CSV, and then convert to it to XML ? If anything, let's generate the XML directly.

- Why XML ? We already have CSV information for legal-info, and JSON output for "make show-info". Let's not add another data description "language".

- We know have "make show-info", which pretty much gives the same information as what is in the legal-info manifest. If not, we can probably extend the "show-info" output.

So, I'm going to mark this patch as rejected.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com