Bugzilla – Attachment 54540 Details for
Bug 16685
Use eval instead of do for .perl atomicupdates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp
PATCH-Bug-16685-QA-Followup---Use-PathTinyslurp-in.patch (text/plain), 1.95 KB, created by
Mark Tompsett
on 2016-08-17 14:59:39 UTC
(
hide
)
Description:
Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-08-17 14:59:39 UTC
Size:
1.95 KB
patch
obsolete
>From 165c8dbf652a507d1320198b0042321c1ee5449b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 27 Jun 2016 15:56:58 +0000 >Subject: [PATCH] [PATCH] Bug 16685 [QA Followup] - Use Path::Tiny::slurp > instead of File::Slurp > >File::Slurp is considered better to use than File::Slurp. > >RM Note: The package version in wheezy is too old, the package version > in jessie is just fine and should be added to the community > repo if wheezy will be supported for the coming release. >--- > C4/Installer/PerlDependencies.pm | 5 +++++ > installer/data/mysql/updatedatabase.pl | 4 ++-- > 2 files changed, 7 insertions(+), 2 deletions(-) > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >index a064307..13aa012 100644 >--- a/C4/Installer/PerlDependencies.pm >+++ b/C4/Installer/PerlDependencies.pm >@@ -837,6 +837,11 @@ our $PERL_DEPS = { > required => 1, > min_ver => '0.28', > }, >+ 'Path::Tiny' => { >+ usage => 'core', >+ required => 1, >+ min_ver => '0.058', >+ } > }; > > 1; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 838d12e..627674c 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -47,7 +47,7 @@ use MARC::File::XML ( BinaryEncoding => 'utf8' ); > > use File::Path qw[remove_tree]; # perl core module > use File::Spec; >-use File::Slurp; >+use Path::Tiny; > > # FIXME - The user might be installing a new database, so can't rely > # on /etc/koha.conf anyway. >@@ -12823,7 +12823,7 @@ foreach my $file ( sort readdir $dirh ) { > my $installer = C4::Installer->new(); > my $rv = $installer->load_sql( $update_dir . $file ) ? 0 : 1; > } elsif ( $file =~ /\.perl$/ ) { >- my $code = read_file( $update_dir . $file ); >+ my $code = path( $update_dir . $file )->slurp_utf8; > eval $code; > say "Atomic update generated errors: $@" if $@; > } >-- >2.1.4
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 16685
:
52132
|
52901
|
52902
|
54540
|
54541
|
54729
|
54730
|
54758
|
54759
|
56219