From da3629761b4af95cd444b12843a660b5dff6ca69 Mon Sep 17 00:00:00 2001 From: Kaushik Date: Thu, 2 Apr 2026 19:06:34 +0000 Subject: [PATCH] Fix #4513: Correct JCalendar LGPL false positive and add regression test Signed-off-by: Kaushik --- .../data/rules/gpl-2.0-plus_60.RULE | 6 +++--- .../data/rules/lgpl-2.0-plus_jcalendar_1.RULE | 20 +++++++++++++++++++ .../data/datadriven/lic1/jcalendar_header.txt | 13 ++++++++++++ .../datadriven/lic1/jcalendar_header.txt.yml | 3 +++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/licensedcode/data/rules/lgpl-2.0-plus_jcalendar_1.RULE create mode 100644 tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt create mode 100644 tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt.yml diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_60.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_60.RULE index 8c743532d45..9756885cd1c 100644 --- a/src/licensedcode/data/rules/gpl-2.0-plus_60.RULE +++ b/src/licensedcode/data/rules/gpl-2.0-plus_60.RULE @@ -6,15 +6,15 @@ notes: there are some confusing references to both LGPL and GPL --- This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by +it under the terms of the {{GNU 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. +{{GNU General Public License}} for more details. -You should have received a copy of the GNU Library Public License +You should have received a copy of the {{GNU Library Public License}} along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_jcalendar_1.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_jcalendar_1.RULE new file mode 100644 index 00000000000..1788710df16 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_jcalendar_1.RULE @@ -0,0 +1,20 @@ +--- +license_expression: lgpl-2.0-plus +is_license_notice: yes +relevance: 100 +notes: Matches a common variant where Lesser and version 2 are mixed up +--- + +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 Lesser 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., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt b/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt new file mode 100644 index 00000000000..16037e2e589 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt @@ -0,0 +1,13 @@ +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 Lesser 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., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt.yml b/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt.yml new file mode 100644 index 00000000000..b9ad6af52cc --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/jcalendar_header.txt.yml @@ -0,0 +1,3 @@ +license_expressions: + - lgpl-2.0-plus + \ No newline at end of file