All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
@ 2019-10-29  9:51 Mickaël Tansorier
  2019-10-29 22:40 ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Mickaël Tansorier @ 2019-10-29  9:51 UTC (permalink / raw)
  To: buildroot

`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.

Signed-off-by: Micka?l Tansorier <mickael.tansorier@smile.fr>
---
 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

diff --git a/Makefile b/Makefile
index bab34ab9b5..4553a24564 100644
--- a/Makefile
+++ b/Makefile
@@ -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))
diff --git a/docs/manual/legal-notice.txt b/docs/manual/legal-notice.txt
index 69753282ec..1e3509c1d2 100644
--- a/docs/manual/legal-notice.txt
+++ b/docs/manual/legal-notice.txt
@@ -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
 
diff --git a/support/scripts/web-legal-info b/support/scripts/web-legal-info
new file mode 100755
index 0000000000..fc0aebd080
--- /dev/null
+++ b/support/scripts/web-legal-info
@@ -0,0 +1,189 @@
+#!/usr/bin/env python
+
+# Usage:
+#  ./support/scirpts/web-legal-info <path-to-legal-info>
+#
+# 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
+# files:
+#   - `manifest.csv`
+#   - `host-manifest.csv`
+#   - `buildroot.config` 
+# and folders:
+#   - `sources`
+#   - `host-sources`
+#
+# Copyright (C) 2019 Micka?l TANSORIER <mickael.tansorier@smile.fr>
+
+
+import sys
+import csv
+import datetime
+
+
+# Get path to legal-info files
+
+if len(sys.argv)<2:
+    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
+
+html_header = """
+<!DOCTYPE html>
+<html>
+
+<head>
+<style type="text/css">
+    body{
+      margin: 1em 5% 1em 5%;
+    }
+      h1, h2, h3, h4, h5, h6 {
+      color: #527bbd;
+      margin-top: 1.2em;
+      margin-bottom: 0.5em;
+      line-height: 1.3;
+    }
+    h2, h3 {
+      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;
+      padding: 4px;
+    }
+    footer {
+      font-size: small;
+      border-top: 2px solid silver;
+      padding-top: 0.5em;
+      margin-top: 4.0em;
+    }
+</style>
+<title>Redistributable licenses</title>
+</head>
+
+<body>
+
+<header>
+</header>
+
+<main>
+"""
+
+html_footer = """
+</main>
+
+<footer>
+    Last updated : """+datetime.date.today().isoformat()+"""
+</footer>
+
+</body>
+</html>
+"""
+
+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>
+<th align="left" valign="top">VERSION</th>
+<th align="left" valign="top">LICENSE</th>
+<th align="left" valign="top">SOURCES</th>
+</tr>
+</thead>
+<tbody>
+"""
+
+html_table_end = """
+</tbody>
+</table>
+"""
+
+
+# Functions and main
+
+def write_title(title,size, htmlfile):
+    htmlfile.write('<' + size + '>' + title + '</' + size + '>\n')
+
+
+def fill_html_table(csvfile, htmlfile, sources_path):
+    spamreader = csv.DictReader(csvfile)
+    for row in spamreader:
+        htmlfile.write('<tr>\n')
+        htmlfile.write('<td align="left" valign="top"><p class="table">' + row["PACKAGE"] + '</p></td>\n')
+        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"> \
+                        <a href="' + sources_path + '/' + row["PACKAGE"] + '-' + row["VERSION"] + '">' + \
+                            row["PACKAGE"] + '-' + row["VERSION"] + '\
+                        </a> \
+                        </p></td>\n')
+        htmlfile.write('</tr>\n')
+
+
+def __main__():
+    # Open html output file
+    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')
+        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:
+            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)
+        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__()
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-29  9:51 [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info Mickaël Tansorier
@ 2019-10-29 22:40 ` Arnout Vandecappelle
  2019-10-30  9:09   ` Yann E. MORIN
  2019-10-31 21:38   ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2019-10-29 22:40 UTC (permalink / raw)
  To: buildroot

 Hi Mickae?l,

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

On 29/10/2019 10:51, Micka?l Tansorier wrote:
> `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.
> 
> Signed-off-by: Micka?l Tansorier <mickael.tansorier@smile.fr>

 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.

> ---
>  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
> 
> diff --git a/Makefile b/Makefile
> index bab34ab9b5..4553a24564 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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.

> +	@$(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))
> diff --git a/docs/manual/legal-notice.txt b/docs/manual/legal-notice.txt
> index 69753282ec..1e3509c1d2 100644
> --- a/docs/manual/legal-notice.txt
> +++ b/docs/manual/legal-notice.txt
> @@ -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

> +and sources you car run:

and sources you can 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 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.

> +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.

> +
> +
>  [[legal-info-buildroot]]
>  === Complying with the Buildroot license
>  
> diff --git a/support/scripts/web-legal-info b/support/scripts/web-legal-info
> new file mode 100755
> index 0000000000..fc0aebd080
> --- /dev/null
> +++ b/support/scripts/web-legal-info
> @@ -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.

> +
> +# Usage:
> +#  ./support/scirpts/web-legal-info <path-to-legal-info>
                ^^^^^^^scripts

> +#
> +# 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

> +# files:
> +#   - `manifest.csv`
> +#   - `host-manifest.csv`
> +#   - `buildroot.config` 

 You have trailing whitespace here.

> +# and folders:
> +#   - `sources`
> +#   - `host-sources`
> +#
> +# Copyright (C) 2019 Micka?l TANSORIER <mickael.tansorier@smile.fr>

 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 <mickael.tansorier@smile.fr>


> +
> +
> +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.

> +    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
> +
> +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.

> +      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.

> +      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;
> +      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"?

> +</head>
> +
> +<body>
> +
> +<header>
> +</header>

 Does it make sense to have an empty header?

> +
> +<main>
> +"""
> +
> +html_footer = """
> +</main>
> +
> +<footer>
> +    Last updated : """+datetime.date.today().isoformat()+"""

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

> +</footer>
> +
> +</body>
> +</html>
> +"""
> +
> +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).

> +<th align="left" valign="top">VERSION</th>
> +<th align="left" valign="top">LICENSE</th>
> +<th align="left" valign="top">SOURCES</th>
> +</tr>
> +</thead>
> +<tbody>
> +"""
> +
> +html_table_end = """
> +</tbody>
> +</table>
> +"""
> +
> +
> +# Functions and main

 This comment is useless.

> +
> +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')

> +
> +
> +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):

> +    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))

> +        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 ().

> +                        <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.

> +                        </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.

> +
> +
> +def __main__():
> +    # Open html output file
> +    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>


> +        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.

> +            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)
> +        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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-29 22:40 ` Arnout Vandecappelle
@ 2019-10-30  9:09   ` Yann E. MORIN
  2019-10-30 10:19     ` Arnout Vandecappelle
  2019-10-30 16:16     ` Mickaël Tansorier
  2019-10-31 21:38   ` Thomas Petazzoni
  1 sibling, 2 replies; 8+ messages in thread
From: Yann E. MORIN @ 2019-10-30  9:09 UTC (permalink / raw)
  To: buildroot

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:
> On 29/10/2019 10:51, Micka?l Tansorier wrote:
> > `web-legal-info` depend on `legal-info`, because it use output
> > of legal info to generate html web page.
[--SNIP--]
> > +.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--]
> > +# and folders:
> > +#   - `sources`
> > +#   - `host-sources`
> > +#
> > +# Copyright (C) 2019 Micka?l TANSORIER <mickael.tansorier@smile.fr>
> 
>  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 <mickael.tansorier@smile.fr>

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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-30  9:09   ` Yann E. MORIN
@ 2019-10-30 10:19     ` Arnout Vandecappelle
  2019-10-30 22:21       ` Yann E. MORIN
  2019-10-30 16:16     ` Mickaël Tansorier
  1 sibling, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2019-10-30 10:19 UTC (permalink / raw)
  To: buildroot



On 30/10/2019 10:09, Yann E. MORIN wrote:
[snip]
> On 2019-10-29 23:40 +0100, Arnout Vandecappelle spake thusly:
>> On 29/10/2019 10:51, Micka?l Tansorier wrote:
>>> `web-legal-info` depend on `legal-info`, because it use output
>>> of legal info to generate html web page.
> [--SNIP--]
>>> +.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.

 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?


> 
> 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).

> 
> 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--]
>>> +# and folders:
>>> +#   - `sources`
>>> +#   - `host-sources`
>>> +#
>>> +# Copyright (C) 2019 Micka?l TANSORIER <mickael.tansorier@smile.fr>
>>
>>  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 <mickael.tansorier@smile.fr>
> 
> 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.


> 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


> 
> Regards,
> Yann E. MORIN.

[1] https://reuse.software/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-30  9:09   ` Yann E. MORIN
  2019-10-30 10:19     ` Arnout Vandecappelle
@ 2019-10-30 16:16     ` Mickaël Tansorier
  1 sibling, 0 replies; 8+ messages in thread
From: Mickaël Tansorier @ 2019-10-30 16:16 UTC (permalink / raw)
  To: buildroot

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?:
> 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:
>> On 29/10/2019 10:51, Micka?l Tansorier wrote:
>>> `web-legal-info` depend on `legal-info`, because it use output
>>> of legal info to generate html web page.
> [--SNIP--]
>>> +.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--]
>>> +# and folders:
>>> +#   - `sources`
>>> +#   - `host-sources`
>>> +#
>>> +# Copyright (C) 2019 Micka?l TANSORIER <mickael.tansorier@smile.fr>
>>
>>  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 <mickael.tansorier@smile.fr>
> 
> 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.
> 


-- 
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]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-30 10:19     ` Arnout Vandecappelle
@ 2019-10-30 22:21       ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2019-10-30 22:21 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2019-10-30 11:19 +0100, Arnout Vandecappelle spake thusly:
> On 30/10/2019 10:09, Yann E. MORIN wrote:
> >      * 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?

> > 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

> > 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.

> > 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.

>  Regards,
>  Arnout
> 
> 
> > 
> > Regards,
> > Yann E. MORIN.
> 
> [1] https://reuse.software/
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-29 22:40 ` Arnout Vandecappelle
  2019-10-30  9:09   ` Yann E. MORIN
@ 2019-10-31 21:38   ` Thomas Petazzoni
  2019-11-01 15:21     ` Yann E. MORIN
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2019-10-31 21:38 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 29 Oct 2019 23:40:07 +0100
Arnout Vandecappelle <arnout@mind.be> 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info
  2019-10-31 21:38   ` Thomas Petazzoni
@ 2019-11-01 15:21     ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2019-11-01 15:21 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2019-10-31 22:38 +0100, Thomas Petazzoni spake thusly:
> On Tue, 29 Oct 2019 23:40:07 +0100
> Arnout Vandecappelle <arnout@mind.be> 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 ?

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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-01 15:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-29  9:51 [Buildroot] [PATCH] core/web-legal-info: Generate html page with minimal legal info Mickaël Tansorier
2019-10-29 22:40 ` Arnout Vandecappelle
2019-10-30  9:09   ` Yann E. MORIN
2019-10-30 10:19     ` Arnout Vandecappelle
2019-10-30 22:21       ` Yann E. MORIN
2019-10-30 16:16     ` Mickaël Tansorier
2019-10-31 21:38   ` Thomas Petazzoni
2019-11-01 15:21     ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.