Bugzilla – Attachment 16118 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), 2.28 KB, created by
Jonathan Druart
on 2013-03-14 10:31:59 UTC
(
hide
)
Description:
Bug 9328, 7167: Remove the File::Find::Rule dependency
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-03-14 10:31:59 UTC
Size:
2.28 KB
patch
obsolete
>From d0fbe24ae8da1dda5eed0135e898ea868b9d4f72 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/Installer/PerlDependencies.pm | 5 ----- > C4/Update/Database.pm | 20 +++++++++++++++++--- > 2 files changed, 17 insertions(+), 8 deletions(-) > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >index 22c12ed..83ba962 100644 >--- a/C4/Installer/PerlDependencies.pm >+++ b/C4/Installer/PerlDependencies.pm >@@ -634,11 +634,6 @@ our $PERL_DEPS = { > 'required' => '1', > 'min_ver' => '0.22', > }, >- 'File::Find::Rule' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.33', >- }, > }; > > 1; >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