From 226d6cd8529062829bf95f81ac1d47b9adc9d253 Mon Sep 17 00:00:00 2001 From: Eljees <3.14hell@gmail.com> Date: Tue, 28 Jul 2026 12:10:41 +0300 Subject: [PATCH 1/2] Add required phrases to lgpl-3.0_16.RULE The rule is an LGPL-3.0 notice, but nothing in it was required, so a partial sequence match reported LGPL-3.0 for LGPL-2.x notices of the same shape that never mention version 3. Mark the two version-bearing phrases as required. Reported in #4995. Signed-off-by: Eljees <3.14hell@gmail.com> --- src/licensedcode/data/rules/lgpl-3.0_16.RULE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/licensedcode/data/rules/lgpl-3.0_16.RULE b/src/licensedcode/data/rules/lgpl-3.0_16.RULE index 75355d740ca..df8c54b922a 100644 --- a/src/licensedcode/data/rules/lgpl-3.0_16.RULE +++ b/src/licensedcode/data/rules/lgpl-3.0_16.RULE @@ -4,7 +4,7 @@ is_license_notice: yes --- * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 as + * it under the terms of the {{GNU Lesser General Public License version 3}} as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -12,6 +12,6 @@ is_license_notice: yes * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License version 3 + * You should have received a copy of the {{GNU Lesser General Public License version 3}} * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \ No newline at end of file + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA From bf999f7823a9d48dbc09083502c68ff03aa55260 Mon Sep 17 00:00:00 2001 From: Eljees <3.14hell@gmail.com> Date: Tue, 28 Jul 2026 22:01:12 +0300 Subject: [PATCH 2/2] test: add regression test for lgpl-3.0_16 required phrases Add a lic4 datadriven fixture with the LGPL-2-or-later notice header from KDE libqzeitgeist src/logbrowser.cpp (issue #4995): it must detect as lgpl-2.0-plus only and no longer match lgpl-3.0_16.RULE now that the rule requires its GNU Lesser General Public License version 3 phrases. Signed-off-by: Eljees <3.14hell@gmail.com> --- .../lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp | 18 ++++++++++++++++++ .../4995-lgpl-2.0-plus-not-lgpl-3.0.cpp.yml | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp create mode 100644 tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp.yml diff --git a/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp b/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp new file mode 100644 index 00000000000..7fc69545663 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp @@ -0,0 +1,18 @@ +/** + * Copyright (C) 2012 Trever Fischer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ diff --git a/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp.yml b/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp.yml new file mode 100644 index 00000000000..0ae65b2ba3f --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic4/4995-lgpl-2.0-plus-not-lgpl-3.0.cpp.yml @@ -0,0 +1,10 @@ +license_expressions: + - lgpl-2.0-plus + - lgpl-2.0-plus +notes: | + LGPL "either version 2 of the License, or (at your option) any later + version" notice header from KDE libqzeitgeist src/logbrowser.cpp as + reported in https://github.com/aboutcode-org/scancode-toolkit/issues/4995 + This notice never mentions version 3 and must not be detected as lgpl-3.0: + it used to match lgpl-3.0_16.RULE by a partial sequence match before that + rule got required phrases.