From 04f44ec7e60753ed8030e601f184630982f93dc3 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 16 Jul 2025 14:56:43 -0300 Subject: [PATCH] Bug 40419: Remove check for Copyright line The Copyright line should not be mandatory. And if missing, is not a reason to skip the GPL-related checks anyway. This 'fix' will highlight existing errors that were skipped until now. To test: 1. Run: $ ktd --shell k$ prove xt/find-license-problems.t => FAIL: Tests pass! Some files should make them fail! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests fail! --- xt/find-license-problems.t | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xt/find-license-problems.t b/xt/find-license-problems.t index 5f93516aa54..9a1322b7242 100755 --- a/xt/find-license-problems.t +++ b/xt/find-license-problems.t @@ -45,14 +45,13 @@ find( { wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir() ); foreach my $name (@files) { open( my $fh, '<', $name ) || die "cannot open file $name $!"; my ( - $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, + $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst, $is_not_us ) = (0) x 7; while ( my $line = <$fh> ) { - $hascopyright = 1 if ( $line =~ /^(#|--)?\s*Copyright.*\d\d/ ); - $hasgpl = 1 if ( $line =~ /GNU General Public License/ ); - $hasv3 = 1 if ( $line =~ /either version 3/ ); - $hasorlater = 1 + $hasgpl = 1 if ( $line =~ /GNU General Public License/ ); + $hasv3 = 1 if ( $line =~ /either version 3/ ); + $hasorlater = 1 if ( $line =~ /any later version/ || $line =~ /at your option/ ); $haslinktolicense = 1 if $line =~ m|http://www\.gnu\.org/licenses|; @@ -60,8 +59,8 @@ foreach my $name (@files) { $is_not_us = 1 if $line =~ m|This file is part of the Zebra server|; } close $fh; - next unless $hascopyright; next if $is_not_us; + next if !$hasgpl; is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 ) or diag( sprintf -- 2.50.1