On 02/11/2022 11:28, Anthony PERARD wrote:
> The headers install in "/usr/include/xen/foreign/" are missing a
> licence.
>
> While we could probably just add the MIT licence to the generated
> file, this patch instead try to grab the licence from the original
> input file.
>
> Since licences are in the first multiline C comments, we just look for
> that. Also with this patch, the possible licences will not be in the
> "input" variable anymore, but it should be unnecessary to generate the
> foreign header.
>
> With this change, the licence will be copied 2 or 3 time in the
> install headers depending on the number of input headers.
>
> Reported-by: Andrew Cooper <andrew.coop...@citrix.com>
> Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
> ---
>
> Notes:
>     Maybe instead of this, we should just stamp this on the generated header
>         /* SPDX-License-Identifier: MIT */
>     
>     but we would be missing the "Copyright" informations. I guess we could
>     look for those line with Copyright and copy them.
>     
>     Or, we could replace the licence in the input header by a SPDX and have
>     the script parse that. (Probably still need to grab the Copyright lines)

All public headers (except one :-( ) are MIT.

We should SPDX the lot, not least because that removes all the
guestimation from this script; we can require that the SPDX line is the
first line, and sanity check it as we process it.

The headers also ought to say "automatically generated from $OTHER", and
include no other information.  That's now most autogen headers work.

So the generated files ought to end up looking like:

/* SPDX-License-Identifier: MIT */
/* Automatically generated from $FILE */

#ifndef $BLAH
...

~Andrew

Reply via email to