Thanks Trevor - you saved me some time analyzing this.

Although the copyright text is excluded from the matching, the template for
the license does not wrap the copyright text with the optional tags.

It uses the currently published license list at spdx.org/licenses - so it is
not using the new XML format.

This is the same issue for the MIT license not matching.

The good news is some of this will be fixed once we release the license list
based on the XML :)

Gary

> -----Original Message-----
> From: W. Trevor King [mailto:wk...@tremily.us]
> Sent: Friday, August 4, 2017 11:45 AM
> To: g...@sourceauditor.com
> Cc: 'Michael Dolan'; 'Philippe Ombredanne'; 'SPDX-legal'
> Subject: Re: License checking tool available
> 
> On Fri, Aug 04, 2017 at 11:12:54AM -0700, Gary wrote:
> > I feel we need another tool to compare text to a specific SPDX license
> > and indicate exactly where the 2 licenses do not match.
> 
> Having this be part of the online tool would be great.  But a
quick-and-dirty
> way to accomplish this is to use Git's --word-diff argument.  For example,
> from a local checkout of [1]:
> 
> Strip XML tags, leading space, and trailing space:
> 
>   $ sed -i 's/<[^>]*>//g;s/^[[:space:]]*//;s/[[:space:]]$//'
src/GPL-3.0.xml
> 
> Replace some XML entities:
> 
>   $ sed -i
>
"s/&gt;/>/g;s/&lt;/</g;s/&apos;/'/g;s/&quot;\|&#x201[CD];/\"/g;s/&#xA9;/C/g"
> src/GPL-3.0.xml
> 
> Replace newlines with spaces:
> 
>   $ CONTENT="$(tr '\n' ' ' <src/GPL-3.0.xml)"
>   $ echo "${CONTENT}" >src/GPL-3.0.xml
> 
> Stage those changes:
> 
>   $ git add src/GPL-3.0.xml
> 
> Clobber with the GNU text:
> 
>   $ curl -s https://www.gnu.org/licenses/gpl.txt >src/GPL-3.0.xml
> 
> Strip leading/trailing space again:
> 
>   $ sed -i 's/^[[:space:]]*//;s/[[:space:]]$//' src/GPL-3.0.xml
> 
> Replace newlines with spaces again:
> 
>   $ CONTENT="$(tr '\n' ' ' <src/GPL-3.0.xml)"
>   $ echo "${CONTENT}" >src/GPL-3.0.xml
> 
> See what's changed vs. the staged version:
> 
>   $ git diff --word-diff
> 
> The only difference that turned up in the license text is:
> 
>   Copyright [-C-]{+(C)+} 2007 Free Software Foundation, Inc.
> 
> Our guideline for equating copyright symbols includes (c) but not (C) [2].
> Maybe that's what's going on?
> 
> Or maybe the SPDX template you're using doesn't match the current license-
> list-XML master.  Or maybe there's some other problem I'm missing because
I'm
> ignoring the XML tags ;).
> 
> Cheers,
> Trevor
> 
> 
> [1]: https://github.com/spdx/license-list-XML
> [2]: https://spdx.org/spdx-license-list/matching-guidelines
> 
> --
> This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
> For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

_______________________________________________
Spdx-legal mailing list
Spdx-legal@lists.spdx.org
https://lists.spdx.org/mailman/listinfo/spdx-legal

Reply via email to