Bugzilla – Attachment 153924 Details for
Bug 29324
Some files still don't have the correct license statement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29324: (QA follow-up) Polishing
Bug-29324-QA-follow-up-Polishing.patch (text/plain), 3.09 KB, created by
Marcel de Rooy
on 2023-07-26 13:05:44 UTC
(
hide
)
Description:
Bug 29324: (QA follow-up) Polishing
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-07-26 13:05:44 UTC
Size:
3.09 KB
patch
obsolete
>From c9c345246c53f852c2c1915e1c8c0cdd9a33066a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 26 Jul 2023 13:04:25 +0000 >Subject: [PATCH] Bug 29324: (QA follow-up) Polishing >Content-Type: text/plain; charset=utf-8 > >Making the verbose output a bit more manageable with -v option. >If we just run the test, we get the total of files with license >problems. >--- > xt/find-license-problems.t | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > >diff --git a/xt/find-license-problems.t b/xt/find-license-problems.t >index 0e1323c5ef..5d70902e75 100755 >--- a/xt/find-license-problems.t >+++ b/xt/find-license-problems.t >@@ -24,16 +24,17 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More; >+use Test::More tests => 1; > > use File::Spec; > use File::Find; > > my @files; >+ > sub wanted { > my $name = $File::Find::name; > push @files, $name >- unless $name =~ /\/(\.git|koha-tmpl|node_modules|swagger-ui)(\/.*)?$/ || >+ unless $name =~ /\/(\.git|installer\/data\/mysql\/db_revs|koha-tmpl|node_modules|swagger-ui)(\/.*)?$/ || > $name =~ /\.(gif|jpg|odt|ogg|pdf|png|po|psd|svg|swf|zip|patch)$/ || > $name =~ m[(xt/find-license-problems|xt/fix-old-fsf-address|misc/translator/po2json)] || > ! -f $name; >@@ -41,6 +42,7 @@ sub wanted { > > find({ wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir()); > >+my @fails; > foreach my $name (@files) { > open( my $fh, '<', $name ) || die "cannot open file $name $!"; > my ( $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, >@@ -58,13 +60,19 @@ foreach my $name (@files) { > $needs_copyright = 1 if $line =~ m|This file is part of Koha| || $name =~ /(.*).pl/ || $name =~ /(.*).pm/; > } > close $fh; >- next unless $hascopyright || $needs_copyright; >+ next unless $needs_copyright &&!$hascopyright; > next if $is_not_us; >- is( $hascopyright >- && $hasgpl >- && $hasv3 >- && $hasorlater >- && $haslinktolicense >- && !$hasfranklinst, 1 ) or diag(sprintf "File %s has wrong copyright: hascopyright=%s, hasgpl=%s, hasv3=%s, hasorlater=%s, haslinktolicense=%s, hasfranklinst=%s", $name, $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst); >+ my $diagnostics = license_info( $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst ); >+ push @fails, [ $name, $diagnostics ] if $diagnostics; >+} >+is( scalar @fails, 0, 'No files without license problems anymore!' ); >+ >+if( grep { $_ eq '-v' } @ARGV ) { >+ map { print "File ". $_->[0]. ": ". $_->[1]. "\n"; } @fails; >+} >+ >+sub license_info { >+ my ( $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst ) = @_; >+ return sprintf( "hascopyright=%s, hasgpl=%s, hasv3=%s, hasorlater=%s, haslinktolicense=%s, hasfranklinst=%s", $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst ) unless $hascopyright && $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst; >+ return; > } >-done_testing; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29324
:
126916
|
153309
|
153310
|
153555
|
153556
|
153680
|
153681
|
153861
|
153899
|
153924
|
154240
|
156256
|
156257
|
156258
|
156259
|
156260
|
156261
|
156262