From f700cead8b5b3005032323cb2074f40aff412942 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 23 Mar 2018 11:18:01 -0700 Subject: [PATCH 1/4] Nokia-Qt-exception-1.1: Fix doubled quote ("") typos We've had these in this repository since the exception landed in e3555218 (Adding exception: Nokia-Qt-exception-1.1, 2017-02-05, #354), and they've been in license-list-data since the exception landed there in spdx/license-list-data@cec28dc7 (Updated JSON exception files, 2016-04-16). I haven't bothered with an tag because the matching guidelines have [1]: 5.1.3 Guideline: Quotes Any variation of quotations (single, double, curly, etc.) should be considered equivalent. That doesn't explicitly say that you can add/remove quotes in the general case. And maybe that's intentional. But if we treat the whole unit as a quote (going from quad-quotes to double-quotes) then this change should have no impact on matching. In practice, I think it's unlikely that folks copied the exception with the quad-quotes. And the upstream linked from our XML is pinned to a specific revision and only uses double-quotes. [1]: https://spdx.org/spdx-license-list/matching-guidelines --- src/exceptions/Nokia-Qt-exception-1.1.xml | 4 ++-- test/simpleTestForGenerator/Nokia-Qt-exception-1.1.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/exceptions/Nokia-Qt-exception-1.1.xml b/src/exceptions/Nokia-Qt-exception-1.1.xml index 48f159ae9..1c176865a 100644 --- a/src/exceptions/Nokia-Qt-exception-1.1.xml +++ b/src/exceptions/Nokia-Qt-exception-1.1.xml @@ -10,8 +10,8 @@

Nokia Qt LGPL Exception version 1.1

As an additional permission to the GNU Lesser General Public - License version 2.1, the object code form of a ""work that - uses the Library"" may incorporate material from a header file + License version 2.1, the object code form of a "work that + uses the Library" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that:

diff --git a/test/simpleTestForGenerator/Nokia-Qt-exception-1.1.txt b/test/simpleTestForGenerator/Nokia-Qt-exception-1.1.txt index f2be32c01..cbf4518af 100644 --- a/test/simpleTestForGenerator/Nokia-Qt-exception-1.1.txt +++ b/test/simpleTestForGenerator/Nokia-Qt-exception-1.1.txt @@ -1,6 +1,6 @@ Nokia Qt LGPL Exception version 1.1 -As an additional permission to the GNU Lesser General Public License version 2.1, the object code form of a ""work that uses the Library"" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that: +As an additional permission to the GNU Lesser General Public License version 2.1, the object code form of a "work that uses the Library" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that: (i) the header files of the Library have not been modified; and (ii) the incorporated material is limited to numerical parameters, data structure layouts, accessors, macros, inline functions and templates; and From a20c078c7efd551a0d5fa93c2dc1f299991c5c24 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 23 Mar 2018 11:39:07 -0700 Subject: [PATCH 2/4] Qt-LGPL-exception-1.1: Add new ID for Nokia-Qt-exception-1.1 And deprecate the old ID, which had two problems [1]: * Qt no longer belongs to Nokia, and they've changed the title upstream to reflect that. * Qt has another exception for GPL3, and the old ID didn't mention the target license. This commit adds the new identifier and deprecates the old one in its favor. I've used Qt-LGPL-exception-1.1 instead of Kai's suggested Qt-exception-LGPL-1.1 to match the {name}-{target}-exception-{version} pattern suggested by the existing i2p-gpl-java-exception. I've set an in the exception title so it will match the old "Nokia " prefix, the current "The Qt Company " prefix, or no prefix at all. I've used "The Qt Company " prefix in the test file to match the upstream text (the test is a copy/paste of the upstream text with trailing whitespace removed). [1]: https://lists.spdx.org/pipermail/spdx-legal/2018-March/002511.html Subject: New License/Exception Request: Qt-LGPL-exception-1.1 Date: Fri, 23 Mar 2018 15:39:54 +0000 Message-ID: --- src/exceptions/Nokia-Qt-exception-1.1.xml | 7 ++- src/exceptions/Qt-LGPL-exception-1.1.xml | 62 +++++++++++++++++++ .../Qt-LGPL-exception-1.1.txt | 22 +++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/exceptions/Qt-LGPL-exception-1.1.xml create mode 100644 test/simpleTestForGenerator/Qt-LGPL-exception-1.1.txt diff --git a/src/exceptions/Nokia-Qt-exception-1.1.xml b/src/exceptions/Nokia-Qt-exception-1.1.xml index 1c176865a..551831764 100644 --- a/src/exceptions/Nokia-Qt-exception-1.1.xml +++ b/src/exceptions/Nokia-Qt-exception-1.1.xml @@ -1,10 +1,13 @@ - + + + Qt-LGPL-exception-1.1 + https://www.keepassx.org/dev/projects/keepassx/repository/revisions/b8dfb9cc4d5133e0f09cd7533d15a4f1c19a40f2/entry/LICENSE.NOKIA-LGPL-EXCEPTION - Typically used by Nokia Qt to apply an exception to LGPL-2.1 + DEPRECATED: Use Qt-LGPL-exception-1.1

Nokia Qt LGPL Exception version 1.1

diff --git a/src/exceptions/Qt-LGPL-exception-1.1.xml b/src/exceptions/Qt-LGPL-exception-1.1.xml new file mode 100644 index 000000000..310f328db --- /dev/null +++ b/src/exceptions/Qt-LGPL-exception-1.1.xml @@ -0,0 +1,62 @@ + + + + + http://code.qt.io/cgit/qt/qtbase.git/tree/LGPL_EXCEPTION.txt + + Used with the LGPL-2.1, which is mentioned explicitly in the exception text. + + +

The Qt Company Qt LGPL Exception version 1.1

+
+

As an additional permission to the GNU Lesser General Public + License version 2.1, the object code form of a "work that + uses the Library" may incorporate material from a header file + that is part of the Library. You may distribute such object + code under terms of your choice, provided that:

+ + + (i) + the header files of the Library have not been modified; and + + + (ii) + the incorporated material is limited to numerical + parameters, data structure layouts, accessors, macros, + inline functions and templates; and + + + (iii) + you comply with the terms of Section 6 of the GNU Lesser + General Public License version 2.1. + + +

Moreover, you may apply this exception to a modified + version of the Library, provided that such + modification does not involve copying material from + the Library into the modified Library's header files + unless such material is limited to

+ + + (i) + numerical parameters; + + + (ii) + data structure layouts; + + + (iii) + accessors; and + + + (iv) + small macros, templates and inline functions of five + lines or less in length. + + +

Furthermore, you are not required to apply this additional + permission to a modified version of the Library.

+
+
+
diff --git a/test/simpleTestForGenerator/Qt-LGPL-exception-1.1.txt b/test/simpleTestForGenerator/Qt-LGPL-exception-1.1.txt new file mode 100644 index 000000000..bd94b5538 --- /dev/null +++ b/test/simpleTestForGenerator/Qt-LGPL-exception-1.1.txt @@ -0,0 +1,22 @@ +The Qt Company Qt LGPL Exception version 1.1 + +As an additional permission to the GNU Lesser General Public License version +2.1, the object code form of a "work that uses the Library" may incorporate +material from a header file that is part of the Library. You may distribute +such object code under terms of your choice, provided that: + (i) the header files of the Library have not been modified; and + (ii) the incorporated material is limited to numerical parameters, data + structure layouts, accessors, macros, inline functions and + templates; and + (iii) you comply with the terms of Section 6 of the GNU Lesser General + Public License version 2.1. + +Moreover, you may apply this exception to a modified version of the Library, +provided that such modification does not involve copying material from the +Library into the modified Library's header files unless such material is +limited to (i) numerical parameters; (ii) data structure layouts; +(iii) accessors; and (iv) small macros, templates and inline functions of +five lines or less in length. + +Furthermore, you are not required to apply this additional permission to a +modified version of the Library. From 8fc9a4b73edff2281bb32fac4c6bd90c51794bcd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 24 Mar 2018 17:03:06 -0700 Subject: [PATCH 3/4] Qt-LGPL-exception-1.1: Drop the trailing space from the alt match spdx-tools can't handle this at the moment: On Fri, Mar 23, 2018 at 11:36:30PM +0000, Gary O'Neall wrote [1]: > The second problem is including the trailing space in the matching > text. Since the matching software tokenizes and removes white > space, it doesn't include the space in the match. To work around > this, just don't include any preceding or trailing white space in > the match. And while the extra leading whitespace in the no-prefix case isn't very elegant, it's not a problem either. [1]: https://github.com/spdx/license-list-XML/pull/627#issuecomment-375825244 --- src/exceptions/Qt-LGPL-exception-1.1.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exceptions/Qt-LGPL-exception-1.1.xml b/src/exceptions/Qt-LGPL-exception-1.1.xml index 310f328db..ba0888715 100644 --- a/src/exceptions/Qt-LGPL-exception-1.1.xml +++ b/src/exceptions/Qt-LGPL-exception-1.1.xml @@ -7,7 +7,7 @@ Used with the LGPL-2.1, which is mentioned explicitly in the exception text. -

The Qt Company Qt LGPL Exception version 1.1

+

The Qt Company Qt LGPL Exception version 1.1

As an additional permission to the GNU Lesser General Public License version 2.1, the object code form of a "work that From b6b27fd6b3d92ea62e660d857482759ab4fcffbe Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 25 Mar 2018 15:24:28 -0700 Subject: [PATCH 4/4] Qt-LGPL-exception-1.1: Order match from longest to shortest The alternation operator (|) is commutative in the POSIX spec, which has [1]: > If the pattern permits a variable number of matching characters and > thus there is more than one such sequence starting at that point, > the longest such sequence is matched. Testing with a few engines, here are some that match POSIX: $ echo abc | grep -Eo '|a|ab' ab $ python -c 'import regex; print(regex.match("|a|ab", "abc", regex.POSIX).group(0))' ab # Background in https://bitbucket.org/mrabarnett/mrab-regex/issues/150 $ psql -Atc "select substring('abc' from '|a|ab')" ab The docs for PostgreSQL are somewhat complicated, but for two or more branches connected by the | operator they are always greedy [2]. Here are some engines that prefer the left-most branch: $ python -c 'import re; print(re.match("|a|ab", "abc").group(0))' $ python -c 'import regex; print(regex.match("|a|ab", "abc").group(0))' $ node -e 'console.log("abc".match(/|a|ab/)[0])' # [3] $ ruby -e 'print "abc".match(/|a|ab/); print "\n"' # [4] Go's stdlib provides both left-most-branch [5] and longest-match [6] implementations. So the old order was compliant with POSIX EREs (as referenced in schema/ListedLicense.xsd), but this commit sorts the branches for longest-match-first for compatibility with engines that break POSIX and prefer the left-most branch. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_01_02 [2]: https://www.postgresql.org/docs/10/static/functions-matching.html#POSIX-MATCHING-RULES [3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-or [4]: https://ruby-doc.org/core-2.5.0/Regexp.html#class-Regexp-label-Alternation Although these docs don't have much to say on longest-match vs. left-most branch. [5]: https://golang.org/pkg/regexp/#Compile [6]: https://golang.org/pkg/regexp/#CompilePOSIX --- src/exceptions/Qt-LGPL-exception-1.1.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exceptions/Qt-LGPL-exception-1.1.xml b/src/exceptions/Qt-LGPL-exception-1.1.xml index ba0888715..290ebd51b 100644 --- a/src/exceptions/Qt-LGPL-exception-1.1.xml +++ b/src/exceptions/Qt-LGPL-exception-1.1.xml @@ -7,7 +7,7 @@ Used with the LGPL-2.1, which is mentioned explicitly in the exception text. -

The Qt Company Qt LGPL Exception version 1.1

+

The Qt Company Qt LGPL Exception version 1.1

As an additional permission to the GNU Lesser General Public License version 2.1, the object code form of a "work that