View | Details | Raw Unified | Return to bug 40419
Collapse All | Expand All

(-)a/xt/find-license-problems.t (-7 / +5 lines)
Lines 45-58 find( { wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir() ); Link Here
45
foreach my $name (@files) {
45
foreach my $name (@files) {
46
    open( my $fh, '<', $name ) || die "cannot open file $name $!";
46
    open( my $fh, '<', $name ) || die "cannot open file $name $!";
47
    my (
47
    my (
48
        $hascopyright,  $hasgpl, $hasv3, $hasorlater, $haslinktolicense,
48
        $hasgpl,        $hasv3, $hasorlater, $haslinktolicense,
49
        $hasfranklinst, $is_not_us
49
        $hasfranklinst, $is_not_us
50
    ) = (0) x 7;
50
    ) = (0) x 7;
51
    while ( my $line = <$fh> ) {
51
    while ( my $line = <$fh> ) {
52
        $hascopyright = 1 if ( $line =~ /^(#|--)?\s*Copyright.*\d\d/ );
52
        $hasgpl     = 1 if ( $line =~ /GNU General Public License/ );
53
        $hasgpl       = 1 if ( $line =~ /GNU General Public License/ );
53
        $hasv3      = 1 if ( $line =~ /either version 3/ );
54
        $hasv3        = 1 if ( $line =~ /either version 3/ );
54
        $hasorlater = 1
55
        $hasorlater   = 1
56
            if ( $line =~ /any later version/
55
            if ( $line =~ /any later version/
57
            || $line =~ /at your option/ );
56
            || $line =~ /at your option/ );
58
        $haslinktolicense = 1 if $line =~ m|http://www\.gnu\.org/licenses|;
57
        $haslinktolicense = 1 if $line =~ m|http://www\.gnu\.org/licenses|;
Lines 60-67 foreach my $name (@files) { Link Here
60
        $is_not_us        = 1 if $line =~ m|This file is part of the Zebra server|;
59
        $is_not_us        = 1 if $line =~ m|This file is part of the Zebra server|;
61
    }
60
    }
62
    close $fh;
61
    close $fh;
63
    next unless $hascopyright;
64
    next if $is_not_us;
62
    next if $is_not_us;
63
    next if !$hasgpl;
65
    is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 )
64
    is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 )
66
        or diag(
65
        or diag(
67
        sprintf
66
        sprintf
68
- 

Return to bug 40419