Bugzilla – Attachment 104039 Details for
Bug 21395
Make perlcritic happy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21395: Fix QA errors
Bug-21395-Fix-QA-errors.patch (text/plain), 6.70 KB, created by
Bernardo Gonzalez Kriegel
on 2020-04-30 14:28:57 UTC
(
hide
)
Description:
Bug 21395: Fix QA errors
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-04-30 14:28:57 UTC
Size:
6.70 KB
patch
obsolete
>From 63481207cf8bfff658e3d01bb5914ec205c48e0b Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 27 Apr 2020 10:31:19 +0200 >Subject: [PATCH] Bug 21395: Fix QA errors > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > docs/CAS/CASProxy/examples/proxy_cas_data.pl | 2 +- > misc/migration_tools/22_to_30/export_Authorities.pl | 4 +++- > .../22_to_30/export_Authorities_xml.pl | 4 +++- > .../22_to_30/move_marc_to_biblioitems.pl | 5 ++--- > reports/reserves_stats.pl | 4 ++-- > rewrite-config.PL | 11 +++++++---- > t/db_dependent/Record/Record.t | 2 +- > 7 files changed, 19 insertions(+), 13 deletions(-) > >diff --git a/docs/CAS/CASProxy/examples/proxy_cas_data.pl b/docs/CAS/CASProxy/examples/proxy_cas_data.pl >index 70ea24cfe6..4c72a63217 100755 >--- a/docs/CAS/CASProxy/examples/proxy_cas_data.pl >+++ b/docs/CAS/CASProxy/examples/proxy_cas_data.pl >@@ -23,7 +23,7 @@ > > =head1 CGI PARAMETERS > >-=item PGTIOU >+=head2 PGTIOU > > The Proxy Granting Ticket IOU the CAS Server returned to us when we gave him the Service Ticket > This PGTIOU will allow us to retrive the matching PGTID >diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl >index 956805a2d9..479981c94e 100755 >--- a/misc/migration_tools/22_to_30/export_Authorities.pl >+++ b/misc/migration_tools/22_to_30/export_Authorities.pl >@@ -31,7 +31,9 @@ while (my ($authid,$authtypecode)=$rq->fetchrow){ > > if (C4::Context->preference('marcflavour') eq "UNIMARC"){ > $record->leader(' nac 22 1u 4500'); >- my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef >+ my @time = localtime(time); >+ my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]); >+ my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef; > $string=~s/\-//g; > $string = sprintf("%-*s",26, $string); > substr($string,9,6,"frey50"); >diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl >index c8a5aa9d63..6c917088a7 100755 >--- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl >+++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl >@@ -30,7 +30,9 @@ open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unab > > # if (C4::Context->preference('marcflavour') eq "UNIMARC"){ > $record->leader(' nac 22 1u 4500'); >- my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef >+ my @time = localtime(time); >+ my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]); >+ my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef; > $string=~s/\-//g; > $string = sprintf("%-*s",26, $string); > substr($string,9,6,"frey50"); >diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl >index 38ea2897c2..386831e8b9 100755 >--- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl >+++ b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl >@@ -26,7 +26,7 @@ $dbh->do('ALTER TABLE `biblioitems` CHANGE `marc` `marc` LONGBLOB NULL DEFAULT N > # adding marc xml, just for convenience > $dbh->do('ALTER TABLE `biblioitems` ADD `marcxml` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL '); > # moving data from marc_subfield_value to biblio >-$sth = $dbh->prepare('select bibid,biblionumber from marc_biblio'); >+my $sth = $dbh->prepare('select bibid,biblionumber from marc_biblio'); > $sth->execute; > my $sth_update = $dbh->prepare('update biblioitems set marc=?, marcxml=? where biblionumber=?'); > my $totaldone=0; >@@ -46,7 +46,7 @@ while (my ($bibid,$biblionumber) = $sth->fetchrow) { > $sth_update->execute($record->as_usmarc(),$record->as_xml_record($marcflavour),$biblionumber); > $totaldone++; > print "."; >- print "\r$totaldone / $totaltodo" unless ($totaldone % 100); >+ print "\r$totaldone" unless ($totaldone % 100); > } > print "\rdone\n"; > >@@ -149,7 +149,6 @@ sub LocalMARCgetbiblio { > } > if (C4::Context->preference('marcflavour')=~/unimarc/i){ > $record->leader(' nac 22 1u 4500'); >- $update=1; > my $string; > if ($record->field(100)) { > $string = substr($record->subfield(100,"a")." ",0,35); >diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl >index c034d46339..1d22561b19 100755 >--- a/reports/reserves_stats.pl >+++ b/reports/reserves_stats.pl >@@ -38,11 +38,11 @@ use YAML; > > =head1 NAME > >- reports/reserve_stats.pl >+reports/reserve_stats.pl > > =head1 DESCRIPTION > >- Plugin that shows reserve stats >+Plugin that shows reserve stats > > =cut > >diff --git a/rewrite-config.PL b/rewrite-config.PL >index 3047f8d2f6..f907a039da 100644 >--- a/rewrite-config.PL >+++ b/rewrite-config.PL >@@ -60,6 +60,8 @@ also need to override WEBSERVER_IP. > > =cut > >+my $myhost; >+my $mydomain; > if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) { > ( $mydomain = $myhost ) =~ s/.*?\.//; > } else { >@@ -67,6 +69,7 @@ if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) { > $mydomain = 'localdomain'; > } > >+my $myip; > unless ( $myip = $ENV{WEBSERVER_IP} ) { > my $byname = gethostbyname( $myhost ) > or die "Could not get the IP address of $myhost, DNS fault? ($!)"; >@@ -75,12 +78,12 @@ unless ( $myip = $ENV{WEBSERVER_IP} ) { > } > > >-$prefix = $ENV{'INSTALL_BASE'} || "/usr"; >+my $prefix = $ENV{'INSTALL_BASE'} || "/usr"; > > # These are our configuration guesses > # Keys were extracted by > # <grep -o '__.*__' etc/* | cut -f2 -d: | sort -u | sed -e 's/^/ "/;s/$/" => "",/' >-%configuration = ( >+my %configuration = ( > "__KOHA_INSTALLED_VERSION__" => "no_version_found", > "__LOG_DIR__" => "/var/log", > "__PLUGINS_DIR__" => "/var/lib/koha/plugins", >@@ -172,8 +175,8 @@ if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') { > $configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = ''; > } > >-$fname = $ARGV[0]; >-$file = &read_file($fname); >+my $fname = $ARGV[0]; >+my $file = &read_file($fname); > $file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg; > > # At this point, file is in 'blib' and by default >diff --git a/t/db_dependent/Record/Record.t b/t/db_dependent/Record/Record.t >index 6fb335fa22..384588d66e 100755 >--- a/t/db_dependent/Record/Record.t >+++ b/t/db_dependent/Record/Record.t >@@ -61,7 +61,7 @@ foreach my $line (<$MARC21UTF8>) { > $marc21_utf8 =~ s/\n$//; > close $MARC21UTF8; > >-open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat" or die $!; >+open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat") or die $!; > my $marc21_marc8_combining_chars; > foreach my $line(<$MARC21MARC8COMBCHARS>) { > $marc21_marc8_combining_chars.=$line; >-- >2.17.1
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 21395
:
79239
|
103666
|
103740
|
104038
|
104039
|
106293
|
106294
|
106295
|
106296
|
106390
|
106393
|
106394
|
106395
|
106398