Bugzilla – Attachment 156260 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.56 KB, created by
Philip Orr
on 2023-09-27 09:09:25 UTC
(
hide
)
Description:
Bug 29324: (QA follow-up) Polishing
Filename:
MIME Type:
Creator:
Philip Orr
Created:
2023-09-27 09:09:25 UTC
Size:
3.56 KB
patch
obsolete
>From edc061d05f5d242a078e18bd93f9e1b8844b5149 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 > >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. > >Added Koha/Schema/Result as exception. > >Sorts results on file name. >--- > xt/find-license-problems.t | 31 ++++++++++++++++++++++++------- > 1 file changed, 24 insertions(+), 7 deletions(-) > >diff --git a/xt/find-license-problems.t b/xt/find-license-problems.t >index 0e1323c5ef..eb21cc1b14 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|Koha.Schema.Result)(\/.*)?$/ || > $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,7 +42,8 @@ sub wanted { > > find({ wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir()); > >-foreach my $name (@files) { >+my @fails; >+foreach my $name (sort @files) { > open( my $fh, '<', $name ) || die "cannot open file $name $!"; > my ( $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, > $hasfranklinst, $is_not_us, $needs_copyright ) = (0)x8; >@@ -55,16 +57,31 @@ foreach my $name (@files) { > $haslinktolicense = 1 if $line =~ m|http://www\.gnu\.org/licenses|; > $hasfranklinst = 1 if ( $line =~ /51 Franklin Street/ ); > $is_not_us = 1 if $line =~ m|This file is part of the Zebra server|; >- $needs_copyright = 1 if $line =~ m|This file is part of Koha| || $name =~ /(.*).pl/ || $name =~ /(.*).pm/; >+ $needs_copyright = 1 if $line =~ m|This file is part of Koha| || $name =~ /\.(pl|pm)/; > } > close $fh; > next unless $hascopyright || $needs_copyright; > next if $is_not_us; >- is( $hascopyright >+ my $diagnostics = license_info( $hascopyright, $needs_copyright, $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, $needs_copyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst ) = @_; >+ return sprintf( >+ "hascopyright=%s, needs_copyright=%s, hasgpl=%s, hasv3=%s, hasorlater=%s, haslinktolicense=%s, hasfranklinst=%s", >+ $hascopyright, $needs_copyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst >+ ) >+ unless $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); >+ && !$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