<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/spdxcheck.py, branch v5.18.3</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.3</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.3'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-02-04T15:43:01Z</updated>
<entry>
<title>spdxcheck.py: Fix a type error</title>
<updated>2022-02-04T15:43:01Z</updated>
<author>
<name>Ding Xiang</name>
<email>dingxiang@cmss.chinamobile.com</email>
</author>
<published>2022-01-14T02:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=28c9f3f9a01d954d8357bdb68fbe36255997bf14'/>
<id>urn:sha1:28c9f3f9a01d954d8357bdb68fbe36255997bf14</id>
<content type='text'>
remove unused variable "col", otherwise there will be a type error
as below:

typeerror: not all arguments converted during string formatting

Signed-off-by: Ding Xiang &lt;dingxiang@cmss.chinamobile.com&gt;
Link: https://lore.kernel.org/r/20220114024058.74536-1-dingxiang@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: Strictly read license files in utf-8</title>
<updated>2021-07-12T15:56:50Z</updated>
<author>
<name>Nishanth Menon</name>
<email>nm@ti.com</email>
</author>
<published>2021-07-07T20:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=40751c6c9bea6a5cfede7c61ee5f3cb1ab857029'/>
<id>urn:sha1:40751c6c9bea6a5cfede7c61ee5f3cb1ab857029</id>
<content type='text'>
Commit bc41a7f36469 ("LICENSES: Add the CC-BY-4.0 license")
unfortunately introduced LICENSES/dual/CC-BY-4.0 in UTF-8 Unicode text
While python will barf at it with:

FAIL: 'ascii' codec can't decode byte 0xe2 in position 2109: ordinal not in range(128)
Traceback (most recent call last):
  File "scripts/spdxcheck.py", line 244, in &lt;module&gt;
    spdx = read_spdxdata(repo)
  File "scripts/spdxcheck.py", line 47, in read_spdxdata
    for l in open(el.path).readlines():
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2109: ordinal not in range(128)

While it is indeed debatable if 'Licensor.' used in the license file
needs unicode quotes, instead, force spdxcheck to read utf-8.

Reported-by: Rahul T R &lt;r-ravikumar@ti.com&gt;
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210707204840.30891-1-nm@ti.com
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: Fix a typo</title>
<updated>2021-03-28T12:41:49Z</updated>
<author>
<name>Bhaskar Chowdhury</name>
<email>unixbhaskar@gmail.com</email>
</author>
<published>2021-03-26T09:14:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=40635128fee8c762b4b3e8ab805a15f01d60b859'/>
<id>urn:sha1:40635128fee8c762b4b3e8ab805a15f01d60b859</id>
<content type='text'>
s/Initilize/Initialize/

Signed-off-by: Bhaskar Chowdhury &lt;unixbhaskar@gmail.com&gt;
Link: https://lore.kernel.org/r/20210326091443.26525-1-unixbhaskar@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spdxcheck.py: Use Python 3</title>
<updated>2021-01-27T13:50:12Z</updated>
<author>
<name>Bert Vermeulen</name>
<email>bert@biot.com</email>
</author>
<published>2021-01-21T08:54:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d0259c42abff51b586496a0594933e394efefbc5'/>
<id>urn:sha1:d0259c42abff51b586496a0594933e394efefbc5</id>
<content type='text'>
Python 2.x has been officially EOL'ed for some time, and in any case
the git module for it is hard to come by.

Signed-off-by: Bert Vermeulen &lt;bert@biot.com&gt;
Link: https://lore.kernel.org/r/20210121085412.265400-1-bert@biot.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: handle license identifiers in XML comments</title>
<updated>2020-10-02T09:31:26Z</updated>
<author>
<name>Lukas Bulwahn</name>
<email>lukas.bulwahn@gmail.com</email>
</author>
<published>2020-09-26T19:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c5c553850899e2662ecf749ac21fff95d17f59a4'/>
<id>urn:sha1:c5c553850899e2662ecf749ac21fff95d17f59a4</id>
<content type='text'>
Commit cc9539e7884c ("media: docs: use the new SPDX header for GFDL-1.1 on
*.svg files") adds SPDX-License-Identifiers enclosed in XML comments,
i.e., &lt;!-- ... --&gt;, for svg files.

Unfortunately, ./scripts/spdxcheck.py does not handle
SPDX-License-Identifiers in XML comments, so it simply fails on checking
these files with 'Invalid License ID: --'.

Strip the XML comment ending simply by copying how it was done for comments
in C. With that, ./scripts/spdxcheck.py handles the svg files properly.

Signed-off-by: Lukas Bulwahn &lt;lukas.bulwahn@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spdxcheck.py: fix directory structures</title>
<updated>2019-06-01T22:51:31Z</updated>
<author>
<name>Vincenzo Frascino</name>
<email>vincenzo.frascino@arm.com</email>
</author>
<published>2019-06-01T05:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8d7a7abfc6b42621adc070c7c29b013d7727ed6f'/>
<id>urn:sha1:8d7a7abfc6b42621adc070c7c29b013d7727ed6f</id>
<content type='text'>
The LICENSE directory has recently changed structure and this makes
spdxcheck fails as per below:

FAIL: "Blob or Tree named 'other' not found"
Traceback (most recent call last):
  File "scripts/spdxcheck.py", line 240, in &lt;module&gt;
spdx = read_spdxdata(repo)
  File "scripts/spdxcheck.py", line 41, in read_spdxdata
for el in lictree[d].traverse():
[...]
KeyError: "Blob or Tree named 'other' not found"

Fix the script to restore the correctness on checkpatch License checking.

References: 62be257e986d ("LICENSES: Rename other to deprecated")
References: 8ea8814fcdcb ("LICENSES: Clearly mark dual license only licenses")
Link: http://lkml.kernel.org/r/20190523084755.56739-1-vincenzo.frascino@arm.com
Signed-off-by: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jeremy Cline &lt;jcline@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: Add dual license subdirectory</title>
<updated>2019-05-21T15:29:41Z</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2019-05-11T20:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29077bc5b7a4644dd8b536a327fa63c88e6f872e'/>
<id>urn:sha1:29077bc5b7a4644dd8b536a327fa63c88e6f872e</id>
<content type='text'>
The licenses from the other directory were partially moved to the dual
directory in commit 8ea8814fcdcb ("LICENSES: Clearly mark dual license only
licenses"). checkpatch therefore rejected files like
drivers/staging/android/ashmem.h with

  WARNING: 'SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */' is not supported in LICENSES/...
  #1: FILE: drivers/staging/android/ashmem.h:1:
  +/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */

Fixes: 8ea8814fcdcb ("LICENSES: Clearly mark dual license only licenses")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: Fix path to deprecated licenses</title>
<updated>2019-05-20T19:25:21Z</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2019-05-11T20:19:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e6d319f68d4dcf355e89a7b21368c47c004a14c2'/>
<id>urn:sha1:e6d319f68d4dcf355e89a7b21368c47c004a14c2</id>
<content type='text'>
The directory name for other licenses was changed to "deprecated" in
commit 62be257e986d ("LICENSES: Rename other to deprecated"). But it was
not changed for spdxcheck.py. As result, checkpatch failed with

  FAIL: "Blob or Tree named 'other' not found"
  Traceback (most recent call last):
    File "scripts/spdxcheck.py", line 240, in &lt;module&gt;
      spdx = read_spdxdata(repo)
    File "scripts/spdxcheck.py", line 41, in read_spdxdata
      for el in lictree[d].traverse():
    File "/usr/lib/python2.7/dist-packages/git/objects/tree.py", line 298, in __getitem__
      return self.join(item)
    File "/usr/lib/python2.7/dist-packages/git/objects/tree.py", line 244, in join
      raise KeyError(msg % file)
  KeyError: "Blob or Tree named 'other' not found"

Fixes: 62be257e986d ("LICENSES: Rename other to deprecated")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: fix C++ comment style detection</title>
<updated>2019-02-22T15:47:05Z</updated>
<author>
<name>Aurélien Cedeyn</name>
<email>aurelien.cedeyn@gmail.com</email>
</author>
<published>2019-02-20T21:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a5f4cb4288e548ab415bbfebd1105c7b29ba9f8c'/>
<id>urn:sha1:a5f4cb4288e548ab415bbfebd1105c7b29ba9f8c</id>
<content type='text'>
With the last commit to support the SuperH boot code files, we have the
following regression:

$ ./scripts/checkpatch.pl -f &lt;(echo '/* SPDX-License-Identifier: MIT */')
WARNING: 'SPDX-License-Identifier: MIT */' is not supported in LICENSES/..
+/* SPDX-License-Identifier: MIT */

total: 0 errors, 1 warnings, 1 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/dev/fd/63 has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

This is not obvious, but spdxcheck.py is launched in checkpatch.pl with :
    ...
    } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) {
        my $spdx_license = $1;
        if (!is_SPDX_License_valid($spdx_license)) {
            WARN("SPDX_LICENSE_TAG",
                 "'$spdx_license' is not supported in LICENSES/...\n" . \
                 $herecurr);
        }
    ...
    sub is_SPDX_License_valid {
        my ($license) = @_;
        ...
        my $status = `cd "$root_path"; echo "$license" |
                      python scripts/spdxcheck.py -`;
        ...
    }

The first chars before 'SPDX-License-Identifier:' are ignored.
This commit fixes this regression.

Fixes:959b49687838 (scripts/spdxcheck.py: Handle special quotation mark comments)
Signed-off-by:Aurélien Cedeyn &lt;aurelien.cedeyn@gmail.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>scripts/spdxcheck.py: Handle special quotation mark comments</title>
<updated>2019-01-16T21:54:51Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-01-16T10:26:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=959b49687838c9eae38f19cb19d504ba880b6cd0'/>
<id>urn:sha1:959b49687838c9eae38f19cb19d504ba880b6cd0</id>
<content type='text'>
The SuperH boot code files use a magic format for the SPDX identifier
comment:

  LIST "SPDX-License-Identifier: .... "

The trailing quotation mark is not stripped before the token parser is
invoked and causes the scan to fail. Handle it gracefully.

Fixes: 6a0abce4c4cc ("sh: include: convert to SPDX identifiers")
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Cc: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: Rich Felker &lt;dalias@libc.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
</feed>
