Skip to contentSkip to conversation

core/web-legal-info: Generate html page with minimal legal info

PATCH New Mickaël Tansorier 4 participants 8 messages Oct 29, 2019 – Nov 1, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

web-legal-info depend on legal-info, because it use output of legal info to generate html web page.
This page contain informations about:
- buildroot config
- target packages: package name, version, licenses and sources
- host packages: package name, version, licenses and sources
Output is index.html in legal-info subdirectory.
Html page is generate by python script in support/scripts/web-legal-info. It is called from Makefile.

This script need legal-info output path in arguments. This script use files:
- buildroot.config
- manifest.csv
- host-manifest.csv
Html page need file buildroot.config, folders sources and host-sources.
So only packages used to build image from config are listed.

Limitation: web-legal-info depend of legal-info manifest format, output sources folder structure and host-sources folder structure.

---
 Makefile                       |   7 ++
 docs/manual/legal-notice.txt   |  14 +++
 support/scripts/web-legal-info | 189 +++++++++++++++++++++++++++++++++
 3 files changed, 210 insertions(+)
 create mode 100755 support/scripts/web-legal-info
Makefile +7 -0
index bab34ab9b5..4553a24564 100644
@@ -849,6 +849,13 @@ legal-info: legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all
 		mv .legal-info.sha256 legal-info.sha256)
 	@echo "Legal info produced in $(LEGAL_INFO_DIR)"
 
+.PHONY: web-legal-info
+web-legal-info: legal-info
+	@$(call MESSAGE,"Generate Web legal info")
+	@cd "$(CONFIG_DIR)"; \
+	$(TOPDIR)/support/scripts/web-legal-info $(LEGAL_INFO_DIR)
+	@echo "Web legal info produced in $(LEGAL_INFO_DIR)"
+
 .PHONY: show-targets
 show-targets:
 	@echo $(sort $(PACKAGES)) $(sort $(TARGETS_ROOTFS))
docs/manual/legal-notice.txt +14 -0
index 69753282ec..1e3509c1d2 100644
@@ -83,6 +83,20 @@ of +make legal-info+ before using it as your own compliance delivery. See
 the _NO WARRANTY_ clauses (clauses 11 and 12) in the +COPYING+ file at the
 root of the Buildroot distribution.
 
+To produce minimal html web page informations with package, version, license
+and sources you car run:
+
+--------------------
+make web-legal-info
+--------------------
+
+This command depend of +legal-info+ command so it will run each time you run
++web-legal-info+. Output +index.html+ can be find under +legal-info+
+subdirectory.
+This +index.html+ use file +buildroot.config+, folders +sources+ and
++host-sources+.
+
+
 [[legal-info-buildroot]]
 === Complying with the Buildroot license
 
support/scripts/web-legal-info new file +189 -0

189 lines not on this page · raw message

Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

Hi Mickae?l,

Thank you for this v2. I have a few more suggestions for improvements.

Quoted 19 lines · Micka?l Tansorier

web-legal-info depend on legal-info, because it use output of legal info to generate html web page.
This page contain informations about:
- buildroot config
- target packages: package name, version, licenses and sources
- host packages: package name, version, licenses and sources
Output is index.html in legal-info subdirectory.
Html page is generate by python script in support/scripts/web-legal-info. It is called from Makefile.

This script need legal-info output path in arguments. This script use files:
- buildroot.config
- manifest.csv
- host-manifest.csv
Html page need file buildroot.config, folders sources and host-sources.
So only packages used to build image from config are listed.

Quoted 4 lines

Limitation: web-legal-info depend of legal-info manifest format, output sources folder structure and host-sources folder structure.

It is looking pretty good. I just have one major comment: it has to be flake8
compliant.

Since you'll anyway be making changes, I have a number of additional comments
below. But all of them are optional.

Quoted 12 lines
---
 Makefile                       |   7 ++
 docs/manual/legal-notice.txt   |  14 +++
 support/scripts/web-legal-info | 189 +++++++++++++++++++++++++++++++++
 3 files changed, 210 insertions(+)
 create mode 100755 support/scripts/web-legal-info
Makefile +0 -0
index bab34ab9b5..4553a24564 100644

Makefile legal-info: legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all · line 853

Quoted 5 lines
Makefile +2 -0
@@ -849,6 +849,13 @@ legal-info: legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all
 		mv .legal-info.sha256 legal-info.sha256)
 	@echo "Legal info produced in $(LEGAL_INFO_DIR)"
 
+.PHONY: web-legal-info
+web-legal-info: legal-info

I was going to suggest to put this directly into the legal-info target.
However, since we no longer have a dependency on Python, we shouldn't rely on Python scripts in our "normal" path, so it's OK as is.

Quoted 13 lines
Makefile +5 -0
+	@$(call MESSAGE,"Generate Web legal info")
+	@cd "$(CONFIG_DIR)"; \
+	$(TOPDIR)/support/scripts/web-legal-info $(LEGAL_INFO_DIR)
+	@echo "Web legal info produced in $(LEGAL_INFO_DIR)"
+
 .PHONY: show-targets
 show-targets:
 	@echo $(sort $(PACKAGES)) $(sort $(TARGETS_ROOTFS))
docs/manual/legal-notice.txt +0 -0
index 69753282ec..1e3509c1d2 100644

docs/manual/legal-notice.txt of +make legal-info+ before using it as your own compliance delivery. See · line 86

Quoted 4 lines
docs/manual/legal-notice.txt +1 -0
@@ -83,6 +83,20 @@ of +make legal-info+ before using it as your own compliance delivery. See
 the _NO WARRANTY_ clauses (clauses 11 and 12) in the +COPYING+ file at the
 root of the Buildroot distribution.
 
+To produce minimal html web page informations with package, version, license

To produce a minimal web page with information about package, version, license

docs/manual/legal-notice.txt of +make legal-info+ before using it as your own compliance delivery. See · line 87

Quoted 1 line
docs/manual/legal-notice.txt +1 -0
+and sources you car run:

and sources you can run:

docs/manual/legal-notice.txt of +make legal-info+ before using it as your own compliance delivery. See · line 95

Quoted 8 lines
docs/manual/legal-notice.txt +8 -0
+
+--------------------
+make web-legal-info
+--------------------
+
+This command depend of +legal-info+ command so it will run each time you run
++web-legal-info+. Output +index.html+ can be find under +legal-info+
+subdirectory.

This command also runs the normal legal-info. It requires Python 2 or 3 to be installed.

The output is in +legal-info/index.html+ in the output directory.

docs/manual/legal-notice.txt of +make legal-info+ before using it as your own compliance delivery. See · line 97

Quoted 2 lines
docs/manual/legal-notice.txt +2 -0
+This +index.html+ use file +buildroot.config+, folders +sources+ and
++host-sources+.

I'm not sure what you want to say here. Perhaps you mean that there are hrefs
to those files/directories? In that case, rephrase it as:

It refers to other files in the +legal-info+ directory, so the entire directory must be packaged for distribution.

support/scripts/web-legal-info line 1

Quoted 12 lines
docs/manual/legal-notice.txt +2 -0
+
+
 [[legal-info-buildroot]]
 === Complying with the Buildroot license
 
support/scripts/web-legal-info new file +1 -0
new file mode 100755
index 0000000000..fc0aebd080
@@ -0,0 +1,189 @@
+#!/usr/bin/env python

Can you check that it also runs on python3? We're converting all our scripts to
support either both python2 and python3, or (if not) python3 only.

support/scripts/web-legal-info line 4

Quoted 3 lines
support/scripts/web-legal-info new file +3 -0
+
+# Usage:
+#  ./support/scirpts/web-legal-info <path-to-legal-info>
                ^^^^^^^scripts

support/scripts/web-legal-info line 10

Quoted 6 lines
support/scripts/web-legal-info new file +6 -0
+#
+# Options:
+#   -`path-to-legal-info`: This mandatory argument is used to find legal-info
+#       output files.
+#
+# This script cr?ate `index.html` file in `path-to-legal-info` dir, based on
                 ^^^^^^creates

support/scripts/web-legal-info line 14

Quoted 4 lines
support/scripts/web-legal-info new file +4 -0
+# files:
+#   - `manifest.csv`
+#   - `host-manifest.csv`
+#   - `buildroot.config` 

You have trailing whitespace here.

support/scripts/web-legal-info line 19

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+# and folders:
+#   - `sources`
+#   - `host-sources`
+#
+# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Small nit: copyright statement should come before the rest.

I would also like to this opportunity to start using SPDX license identifiers
in our code. So it should start with

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

support/scripts/web-legal-info line 29

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+
+
+import sys
+import csv
+import datetime
+
+
+# Get path to legal-info files
+
+if len(sys.argv)<2:

E225 missing whitespace around operator

Please run flake8 on the code.

Quoted 12 lines
support/scripts/web-legal-info new file +12 -0
+    print("Error: This script need path to legal-info argument")
+    sys.exit(2)
+
+LEGAL_INFO_DIR = str(sys.argv[1])
+
+HTML_FILE_NAME = LEGAL_INFO_DIR + "/index.html"
+TARGET_CSV_FILE_NAME = LEGAL_INFO_DIR + "/manifest.csv"
+HOST_CSV_FILE_NAME = LEGAL_INFO_DIR + "/host-manifest.csv"
+
+
+# HTML templates
+

support/scripts/web-legal-info line 51

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+html_header = """
+<!DOCTYPE html>
+<html>
+
+<head>
+<style type="text/css">
+    body{
+      margin: 1em 5% 1em 5%;
+    }
+      h1, h2, h3, h4, h5, h6 {

Could you use consistent indentation please?

Also, maybe it's cleaner to have this in a separate file. This would make it
possible to have decent syntax highlighting and indentation. But that's really just nitpicking so not important.

support/scripts/web-legal-info line 57

Quoted 6 lines
support/scripts/web-legal-info new file +6 -0
+      color: #527bbd;
+      margin-top: 1.2em;
+      margin-bottom: 0.5em;
+      line-height: 1.3;
+    }
+    h2, h3 {

AFAICS, you're only using h1 and h2, so it doesn't ake much sense to define
styles for h3-h6. Again, not very important though.

Quoted 22 lines
support/scripts/web-legal-info new file +22 -0
+      padding-top: 0.5em;
+      border-bottom: 2px solid silver;
+    }
+    h1 {
+      text-align: center;
+    }
+    table {
+      width: 100%;
+      border-collapse: collapse;
+      border: 3px solid #527bbd;
+      frame="border";
+    }
+    thead {
+      font-weight: bold;
+      color: #527bbd;
+    }
+    th {
+      border: 1px solid #527bbd;
+      padding: 4px;
+    }
+    td {
+      border: 1px solid #527bbd;

support/scripts/web-legal-info line 89

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+      padding: 4px;
+    }
+    footer {
+      font-size: small;
+      border-top: 2px solid silver;
+      padding-top: 0.5em;
+      margin-top: 4.0em;
+    }
+</style>
+<title>Redistributable licenses</title>

Why "Redistributable"?

support/scripts/web-legal-info line 95

Quoted 6 lines
support/scripts/web-legal-info new file +6 -0
+</head>
+
+<body>
+
+<header>
+</header>

Does it make sense to have an empty header?

support/scripts/web-legal-info line 104

Quoted 9 lines
support/scripts/web-legal-info new file +9 -0
+
+<main>
+"""
+
+html_footer = """
+</main>
+
+<footer>
+    Last updated : """+datetime.date.today().isoformat()+"""

Instead of "last updated", it should probably be "Generated on".

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+</footer>
+
+</body>
+</html>
+"""

support/scripts/web-legal-info line 119

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+
+html_table_begin = """
+<table>
+<col width="25%" />
+<col width="25%" />
+<col width="25%" />
+<col width="25%" />
+<thead>
+<tr>
+<th align="left" valign="top">PACKAGE</th>

Please no all caps. If you really want caps, use the 'font-variant:
small-caps;' style.

I believe you can also move the alignment hints to the stylesheet (but my
HTML/CSS-fu is quite limited).

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+<th align="left" valign="top">VERSION</th>
+<th align="left" valign="top">LICENSE</th>
+<th align="left" valign="top">SOURCES</th>
+</tr>
+</thead>

support/scripts/web-legal-info line 134

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+<tbody>
+"""
+
+html_table_end = """
+</tbody>
+</table>
+"""
+
+
+# Functions and main

This comment is useless.

support/scripts/web-legal-info line 137

Quoted 3 lines
support/scripts/web-legal-info new file +3 -0
+
+def write_title(title,size, htmlfile):
+    htmlfile.write('<' + size + '>' + title + '</' + size + '>\n')

If you want to simplify creating HTML structures, this is a more useful function:

def html_tagify(tag, attrs, body):

    opening = tag
    if attrs:
        opening += ' ' + attrs
    return '<{}>{}</{}>'.format(opening, body, tag)

To be used as:

    htmlfile.write(html_tagify('h2', None, 'Target packages') + '\n')

support/scripts/web-legal-info line 141

Quoted 4 lines
support/scripts/web-legal-info new file +4 -0
+
+
+def fill_html_table(csvfile, htmlfile, sources_path):
+    spamreader = csv.DictReader(csvfile)

spamreader? :-)

The variable is not really useful here, you can just do

for row in csv.DictReader(csvfile):

support/scripts/web-legal-info line 144

Quoted 3 lines
support/scripts/web-legal-info new file +3 -0
+    for row in spamreader:
+        htmlfile.write('<tr>\n')
+        htmlfile.write('<td align="left" valign="top"><p class="table">' + row["PACKAGE"] + '</p></td>\n')

So this could also use the html_tagify:

html_tagify('td', 'align="left" valign="top"',

              html_tagify('p', 'class="table", row["PACKAGE"])) + '\n'

Also, a more pythonesque (but maybe not easier to read) way would be to yield
the string here (which makes the function a generator), and in the caller do

htmlfile.writelines(fill_html_table(csvfile, sources_path))

support/scripts/web-legal-info line 147

Quoted 3 lines
support/scripts/web-legal-info new file +3 -0
+        htmlfile.write('<td align="left" valign="top"><p class="table">' + row["VERSION"] + '</p></td>\n')
+        htmlfile.write('<td align="left" valign="top"><p class="table">' + row["LICENSE"] + '</p></td>\n')
+        htmlfile.write('<td align="left" valign="top"><p class="table"> \

Backslash is not needed here since it's between ().

support/scripts/web-legal-info line 150

Quoted 3 lines
support/scripts/web-legal-info new file +3 -0
+                        <a href="' + sources_path + '/' + row["PACKAGE"] + '-' + row["VERSION"] + '">' + \
+                            row["PACKAGE"] + '-' + row["VERSION"] + '\
+                        </a> \

I don't think it makes much sense to put an extra column just for this link.
You can add the link around the package name, in the first column.

It would also be useful to add a href to the license files in the license
column entry.

support/scripts/web-legal-info line 152

Quoted 2 lines
support/scripts/web-legal-info new file +2 -0
+                        </p></td>\n')
+        htmlfile.write('</tr>\n')

I think it would make sense to define a template multiline string for all of
the above, with {PACKAGE} and {VERSION} etc. placeholders, and then format it with:

table_row_template.format(row)

Note that in that case, you probably can't use my html_tagify function.

Quoted 4 lines
support/scripts/web-legal-info new file +4 -0
+
+
+def __main__():
+    # Open html output file

support/scripts/web-legal-info line 166

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+    with open(HTML_FILE_NAME, 'w') as htmlfile:
+
+        # Header page
+        htmlfile.write(html_header)
+        write_title("Redistributable licenses", "h1", htmlfile)
+        htmlfile.write('\n')
+
+        # Buildroot config
+        write_title("Buildroot config", "h2", htmlfile)
+        htmlfile.write('<p><a href="buildroot.config">buildroot.config</a></p>\n')

I don't think a h2 looks so nice here. Better without header, just:

<p>Buildroot configuration: <a href="buildroot.config">buildroot.config</a></p>

support/scripts/web-legal-info line 172

Quoted 6 lines
support/scripts/web-legal-info new file +6 -0
+        htmlfile.write('\n')
+    
+        # Target packages
+        write_title("Target packages", "h2", htmlfile)
+        htmlfile.write(html_table_begin)
+        with open(TARGET_CSV_FILE_NAME, 'rt') as csvfile:

It would make more sense to push this inside the function.

Quoted 7 lines
support/scripts/web-legal-info new file +7 -0
+            fill_html_table(csvfile,htmlfile, "sources")
+        htmlfile.write(html_table_end)
+        htmlfile.write('\n')
+    
+        # Host target
+        write_title("Host packages", "h2", htmlfile)
+        htmlfile.write(html_table_begin)

support/scripts/web-legal-info line 189

Quoted 10 lines
support/scripts/web-legal-info new file +10 -0
+        with open(HOST_CSV_FILE_NAME, 'rt') as csvfile:
+            fill_html_table(csvfile, htmlfile, "host-sources")
+        htmlfile.write(html_table_end)
+        htmlfile.write('\n')
+    
+        # Footer page
+        htmlfile.write(html_footer)
+
+
+__main__()

The usual pattern is:

if __name__ == '__main__':

    __main__()

However, I don't think it makes sense to make a main function here, because
there are so many global variables.

Regards,
Arnout

#2 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

Micka?l, Arnout, All,

Since this is the second iteration of the patch, next time please add a 'v2' in the title.

Also, add a post-commit changelog of changes between v1 and v2. The post commit changelog is to be put after the '---' line:

[PATCH v2] blabla: short title

We do this and that, and not this

Signed-off-by You

---
Changes v1 -> v2:
- something changed
- some other thing changed

On 2019-10-29 23:40 +0100, Arnout Vandecappelle spake thusly:

Quoted 3 lines · Micka?l Tansorier
Quoted 2 lines

web-legal-info depend on legal-info, because it use output of legal info to generate html web page.

[--SNIP--]

Quoted 6 lines
Quoted 2 lines

+.PHONY: web-legal-info
+web-legal-info: legal-info

I was going to suggest to put this directly into the legal-info target.
However, since we no longer have a dependency on Python, we shouldn't rely on Python scripts in our "normal" path, so it's OK as is.

Well, this is not what we concluded during the devdays, and Thomas already replied that we wanted to have this included in the existing legal-info target. Also, the manual already states:

http://nightly.buildroot.org/#requirement-optional

Some features or utilities in Buildroot, like the legal-info, or the graph generation tools, have additional dependencies. Although they are not mandatory for a simple build, they are still highly recommended:

* python (version 2.7 or any later)

So, I agree with Thomas that this should be included in legal-info, and not a new separate target.

Also, have you had a look at Nicolas' alternate proposal, which is much more lightweight and simple:

    http://lists.busybox.net/pipermail/buildroot/2019-October/264344.html

Basically, it justs creates an xml file from the csv, and when one opens it in a browser, it is properly rendered thanks to the accompanying xsl template. We don't want to make it too complex

[--SNIP--]

Quoted 8 lines

support/scripts/web-legal-info line 19

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+# and folders:
+#   - `sources`
+#   - `host-sources`
+#
+# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Small nit: copyright statement should come before the rest.

Quoted 6 lines

I would also like to this opportunity to start using SPDX license identifiers
in our code. So it should start with

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Such copyright identifiers are not required: the Berne Convention states
that the copyright is implicit, that is, a work does not have to carry a copyright identifier to be properly copyrighted [https://en.wikipedia.org/wiki/Berne_Convention].

Also, as time passes, other contributors will modify this script. We do not want to have a copyright identifier for each and every contribution that will be made to this script. Especially since the git log keeps an accurate authorship of all contributors.

So I would suggest we do add such new copyright identifiers, and get rid of the existing ones (as time passes).

Regards,
Yann E. MORIN.

Signature · 6 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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

On 30/10/2019 10:09, Yann E. MORIN wrote:
[snip]

Quoted 23 lines

On 2019-10-29 23:40 +0100, Arnout Vandecappelle spake thusly:

Quoted 3 lines · Micka?l Tansorier
Quoted 2 lines

web-legal-info depend on legal-info, because it use output of legal info to generate html web page.

[--SNIP--]

Quoted 6 lines
Quoted 2 lines

+.PHONY: web-legal-info
+web-legal-info: legal-info

I was going to suggest to put this directly into the legal-info target.
However, since we no longer have a dependency on Python, we shouldn't rely on Python scripts in our "normal" path, so it's OK as is.

Well, this is not what we concluded during the devdays, and Thomas already replied that we wanted to have this included in the existing legal-info target. Also, the manual already states:

http://nightly.buildroot.org/#requirement-optional

Some features or utilities in Buildroot, like the legal-info, or the graph generation tools, have additional dependencies. Although they are not mandatory for a simple build, they are still highly recommended:

Quoted 4 lines

* python (version 2.7 or any later)

So, I agree with Thomas that this should be included in legal-info, and not a new separate target.

The problem is: I would like to have some autobuilders without installed
python. Since the autobuilders do run legal-info, that would not be possible...

Maybe we should autodetect if python is available and skip this if not?

Quoted 4 lines

Also, have you had a look at Nicolas' alternate proposal, which is much more lightweight and simple:

    http://lists.busybox.net/pipermail/buildroot/2019-October/264344.html

Ah, yes, I was conflating the two.

Mickae?l, could you look at Nicolas' proposal and check if it fits your needs?

Note that that patch is missing a documentation update (which could be done in
a separate patch).

Quoted 17 lines

Basically, it justs creates an xml file from the csv, and when one opens it in a browser, it is properly rendered thanks to the accompanying xsl template. We don't want to make it too complex

[--SNIP--]

Quoted 11 lines

support/scripts/web-legal-info line 19

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+# and folders:
+#   - `sources`
+#   - `host-sources`
+#
+# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Small nit: copyright statement should come before the rest.

I would also like to this opportunity to start using SPDX license identifiers
in our code. So it should start with

Quoted 7 lines
Quoted 3 lines

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Such copyright identifiers are not required: the Berne Convention states
that the copyright is implicit, that is, a work does not have to carry a copyright identifier to be properly copyrighted [https://en.wikipedia.org/wiki/Berne_Convention].

However, all open source licenses (GPL, BSD, MIT, ...) kind of require it,
because they require to mention the authors. Some projects (e.g. CMake) keep an explicit list of authors in the top-level LICENSE file. Other projects just say "the FOO contributors". Oh, and REUSE [1] requires it as well. And finally:
(almost?) all our existing scripts do have a copyright line.

Quoted 7 lines

Also, as time passes, other contributors will modify this script. We do not want to have a copyright identifier for each and every contribution that will be made to this script. Especially since the git log keeps an accurate authorship of all contributors.

So I would suggest we do add such new copyright identifiers, and get rid of the existing ones (as time passes).

We should decide on a convention and stick to it :-)

Regards,
Arnout

Quoted 3 lines

Regards,
Yann E. MORIN.

[1] https://reuse.software/

#4 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

Arnout, All,

On 2019-10-30 11:19 +0100, Arnout Vandecappelle spake thusly:

Quoted 4 lines · Yann E. MORIN
Quoted 1 line

* python (version 2.7 or any later)

The problem is: I would like to have some autobuilders without installed
python. Since the autobuilders do run legal-info, that would not be possible...

Didn't we also conclude that, given that the autobuild scripts are witten in python, it is thus forcibly present on an autobuilder instance?

Quoted 5 lines
Quoted 3 lines

Also, have you had a look at Nicolas' alternate proposal, which is much more lightweight and simple:

    http://lists.busybox.net/pipermail/buildroot/2019-October/264344.html

Note that that patch is missing a documentation update (which could be done in
a separate patch).

And did not actually work for me, so might need refinement, or maybe I was missing a few pre-requisites... Needs investigations

Quoted 9 lines
Quoted 3 lines

Such copyright identifiers are not required: the Berne Convention states
that the copyright is implicit, that is, a work does not have to carry a copyright identifier to be properly copyrighted [https://en.wikipedia.org/wiki/Berne_Convention].

However, all open source licenses (GPL, BSD, MIT, ...) kind of require it,
because they require to mention the authors. Some projects (e.g. CMake) keep an explicit list of authors in the top-level LICENSE file. Other projects just say "the FOO contributors". Oh, and REUSE [1] requires it as well. And finally:
(almost?) all our existing scripts do have a copyright line.

Which is sad, because it is definitely not exhaustive, far from it, while the git log is.

Quoted 9 lines
Quoted 7 lines

Also, as time passes, other contributors will modify this script. We do not want to have a copyright identifier for each and every contribution that will be made to this script. Especially since the git log keeps an accurate authorship of all contributors.

So I would suggest we do add such new copyright identifiers, and get rid of the existing ones (as time passes).

We should decide on a convention and stick to it :-)

Hey, I indeed meant "we should _not_ add any more". ;-)

But if the trend in the licensing galaxy is to require them, that's a shame that we have to abide to this limitation, when we have better technical solutions... :-(

Regards,
Yann E. MORIN.

Quoted 10 lines

Regards,
Arnout

Quoted 3 lines

Regards,
Yann E. MORIN.

[1] https://reuse.software/

Signature · 6 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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

In reply to Yann E. MORIN

Hi,

Thank you Arnout and Yann for advices.

I apply most of part of Arnout corrections.

I am not familiar with xml/xls, so I'll check that later. But it seems to be a good idea.
For now I stay with my first script model.

As you see I am novice in python and patch e-mail formalism, so thank for the pedagogy.

I'll send new patch v3.

Regards,
Tansorier Micka?l

Le 30/10/2019 ? 10:09, Yann E. MORIN a ?crit?:

Quoted 86 lines

Micka?l, Arnout, All,

Since this is the second iteration of the patch, next time please add a 'v2' in the title.

Also, add a post-commit changelog of changes between v1 and v2. The post commit changelog is to be put after the '---' line:

[PATCH v2] blabla: short title

We do this and that, and not this

Signed-off-by You

---
Changes v1 -> v2:
- something changed
- some other thing changed

On 2019-10-29 23:40 +0100, Arnout Vandecappelle spake thusly:

Quoted 3 lines · Micka?l Tansorier
Quoted 2 lines

web-legal-info depend on legal-info, because it use output of legal info to generate html web page.

[--SNIP--]

Quoted 6 lines
Quoted 2 lines

+.PHONY: web-legal-info
+web-legal-info: legal-info

I was going to suggest to put this directly into the legal-info target.
However, since we no longer have a dependency on Python, we shouldn't rely on Python scripts in our "normal" path, so it's OK as is.

Well, this is not what we concluded during the devdays, and Thomas already replied that we wanted to have this included in the existing legal-info target. Also, the manual already states:

http://nightly.buildroot.org/#requirement-optional

Some features or utilities in Buildroot, like the legal-info, or the graph generation tools, have additional dependencies. Although they are not mandatory for a simple build, they are still highly recommended:

* python (version 2.7 or any later)

So, I agree with Thomas that this should be included in legal-info, and not a new separate target.

Also, have you had a look at Nicolas' alternate proposal, which is much more lightweight and simple:

    http://lists.busybox.net/pipermail/buildroot/2019-October/264344.html

Basically, it justs creates an xml file from the csv, and when one opens it in a browser, it is properly rendered thanks to the accompanying xsl template. We don't want to make it too complex

[--SNIP--]

Quoted 8 lines

support/scripts/web-legal-info line 19

Quoted 5 lines
support/scripts/web-legal-info new file +5 -0
+# and folders:
+#   - `sources`
+#   - `host-sources`
+#
+# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Small nit: copyright statement should come before the rest.

Quoted 6 lines

I would also like to this opportunity to start using SPDX license identifiers
in our code. So it should start with

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 Micka?l TANSORIER <[email protected]>

Such copyright identifiers are not required: the Berne Convention states
that the copyright is implicit, that is, a work does not have to carry a copyright identifier to be properly copyrighted [https://en.wikipedia.org/wiki/Berne_Convention].

Also, as time passes, other contributors will modify this script. We do not want to have a copyright identifier for each and every contribution that will be made to this script. Especially since the git log keeps an accurate authorship of all contributors.

So I would suggest we do add such new copyright identifiers, and get rid of the existing ones (as time passes).

Regards,
Yann E. MORIN.

Signature · 7 lines
Tansorier Micka?l

Smile ECS / OpenWide Ing?nierie
D?l?gu? du Personnel pour l'agence de Nantes

[Pr?serve ta libert?: https://gafam.laquadrature.net/]
[L'Ortographe de moli?re: https://www.invidio.us/watch?v=5YO7Vg1ByA8]
#6 lore raw

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

In reply to Arnout Vandecappelle

Hello,

Quoted 2 lines · On Tue, 29 Oct 2019 23:40:07 +0100 Arnout Vandecappelle <[email protected]> wrote:

It is looking pretty good. I just have one major comment: it has to be flake8
compliant.

During the Buildroot Developers meeting, Nicolas Carrier worked on an alternate proposal that consists in generating an XML, and then use an XSLT stylesheet to have the browser render an HTML output:

http://patchwork.ozlabs.org/patch/1185080/

I am personally not a big fan of XML/XSLT technologies, and we already have stuff in Buildroot that generates just pure HTML, so I would tend to prefer an approach such as the one proposed by Micka?l in this patch. Should we formally reject the proposal from Nicolas ?

Best regards,

Thomas

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

PATCH 1/1 core/web-legal-info: Generate html page with minimal legal info

Thomas, All,

On 2019-10-31 22:38 +0100, Thomas Petazzoni spake thusly:

Quoted 9 lines
Quoted 2 lines · On Tue, 29 Oct 2019 23:40:07 +0100 Arnout Vandecappelle <[email protected]> wrote:

It is looking pretty good. I just have one major comment: it has to be flake8
compliant.

During the Buildroot Developers meeting, Nicolas Carrier worked on an alternate proposal that consists in generating an XML, and then use an XSLT stylesheet to have the browser render an HTML output:

Quoted 6 lines

http://patchwork.ozlabs.org/patch/1185080/

I am personally not a big fan of XML/XSLT technologies, and we already have stuff in Buildroot that generates just pure HTML, so I would tend to prefer an approach such as the one proposed by Micka?l in this patch. Should we formally reject the proposal from Nicolas ?

In fact, I still prefer that we expose unformatted, un-rendered data,and leave to the user the responsibility to inject that in whatever web framework they are using. So far, the legal-info/ directory contained only that: raw data. Arguably, the xml format is still kinda raw. The rendered web-page, not so much, and will mostly never fir into the user's web framework (and in my olpinion, does not bring much more than a directory listing would provide).

So, my preference would be for Nicolas' patch (if it can be made to work).

Regards,
Yann E. MORIN.

Signature · 6 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.  |
'------------------------------^-------^------------------^--------------------'