Bugzilla – Attachment 14311 Details for
Bug 9328
File::Find::Rule should not be a mandatory dependency for installation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9328, 7167: Remove the File::Find::Rule dependency
Bug-9328-7167-Remove-the-FileFindRule-dependency.patch (text/plain), 1.80 KB, created by
Jonathan Druart
on 2012-12-28 13:25:39 UTC
(
hide
)
Description:
Bug 9328, 7167: Remove the File::Find::Rule dependency
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-28 13:25:39 UTC
Size:
1.80 KB
patch
obsolete
>From 8db8ab5595169ee7fb999c7bf16afd72244c7081 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 28 Dec 2012 14:23:28 +0100 >Subject: [PATCH] Bug 9328, 7167: Remove the File::Find::Rule dependency > >F::F::Rule doesn't introduce functionality that is not >available to File::Find, just some (admittedly useful) syntactical >sugar. >--- > C4/Update/Database.pm | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > >diff --git a/C4/Update/Database.pm b/C4/Update/Database.pm >index eaeb288..3104e4a 100644 >--- a/C4/Update/Database.pm >+++ b/C4/Update/Database.pm >@@ -22,7 +22,7 @@ use Modern::Perl; > use C4::Context; > > use File::Basename; >-use File::Find::Rule; >+use File::Find; > use Digest::MD5; > use List::MoreUtils qw/uniq/; > use YAML; >@@ -60,7 +60,14 @@ sub get_versions_path { > > sub get_filepath { > my ( $version ) = @_; >- my @files = File::Find::Rule->file->name( "$version.sql", "$version.pl" ) ->in( ( get_versions_path() ) ); >+ my @files; >+ find( >+ sub{ >+ return unless $_ =~ m|^$version\.pl$| or $_ =~ m|^$version\.sql$|; >+ push @files, $File::Find::name; >+ }, >+ ( get_versions_path() ) >+ ); > > if ( scalar @files != 1 ) { > die "This version ($version) returned has ".scalar @files." corresponding, need only 1"; >@@ -172,7 +179,14 @@ sub execute_version { > sub list_versions_available { > my @versions; > >- my @files = File::Find::Rule->file->name( "*.sql", "*.pl" ) ->in( ( get_versions_path() ) ); >+ my @files; >+ find( >+ sub{ >+ return unless $_ =~ m|\.pl$| or $_ =~ m|\.sql$|; >+ push @files, $File::Find::name; >+ }, >+ ( get_versions_path() ) >+ ); > > for my $f ( @files ) { > my @file_infos = fileparse( $f, qr/\.[^.]*/ ); >-- >1.7.10.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 9328
:
14311
|
16118
|
17715