Re: spdxcheck.py complains about the second OR?

Joe Perches <[email protected]>
Newsgroups org.kernel.vger.linux-spdx,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, 2019-11-05 at 10:11 +0000, Zavras, Alexios wrote:
> This is not correct.
> Since the grammar includes the production "expr: expr OR expr",
> there is absolutely no need to add a rule with more than two operands --
> it will be handled recursively.

You sure about the recursion?

It does work and spdxcheck no longer emits a message for
these two files.

> -- zvr
> 
> -----Original Message-----
> From: [email protected] <[email protected]> On Behalf Of Joe Perches
> Sent: Monday, 4 November, 2019 23:24
> To: Thomas Gleixner <[email protected]>; Masahiro Yamada <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>; [email protected]; Linux Kernel Mailing List <[email protected]>
> Subject: Re: spdxcheck.py complains about the second OR?
> 
> On Mon, 2019-11-04 at 23:11 +0100, Thomas Gleixner wrote:
> > On Fri, 1 Nov 2019, Masahiro Yamada wrote:
> > > scripts/spdxcheck.py warns the following two files.
> > > 
> > > $ ./scripts/spdxcheck.py
> > > drivers/net/ethernet/pensando/ionic/ionic_if.h: 1:52 Syntax error: 
> > > OR
> > > drivers/net/ethernet/pensando/ionic/ionic_regs.h: 1:52 Syntax error: 
> > > OR
> > > 
> > > I do not understand what is wrong with them.
> > > 
> > > I think "A OR B OR C" is sane.
> > 
> > Yes it is, but obviously we did not expect files with 3 possible 
> > alternative licenses.
> 
> Perhaps just this, but the generic logic obviously isn't complete.
> ---
>  scripts/spdxcheck.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index 6374e0..00be34 100755
> --- a/scripts/spdxcheck.py
> +++ b/scripts/spdxcheck.py
> @@ -150,6 +150,7 @@ class id_parser(object):
>                  | ID WITH EXC
>                  | expr AND expr
>                  | expr OR expr
> +                | expr OR expr OR expr
>                  | LPAR expr RPAR'''
>          pass
>  
> 
> 
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Gary Kershaw
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.