Bugzilla – Attachment 69466 Details for
Bug 19735
Move Perl deps definitions into a cpanfile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19735: Move Perl deps definitions into a cpanfile
Bug-19735-Move-Perl-deps-definitions-into-a-cpanfi.patch (text/plain), 52.06 KB, created by
Julian Maurice
on 2017-12-02 08:58:18 UTC
(
hide
)
Description:
Bug 19735: Move Perl deps definitions into a cpanfile
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-12-02 08:58:18 UTC
Size:
52.06 KB
patch
obsolete
>From ddc346f0012645135977b9e44a2f9d560ed87825 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 26 Oct 2017 16:28:02 +0000 >Subject: [PATCH] Bug 19735: Move Perl deps definitions into a cpanfile > >cpanfile is a format for describing CPAN dependencies for Perl >applications. >It is more concise - thus easier to read and maintain - than >C4::Installer::PerlDependencies, and allows to describe requirements >more accurately (using version ranges or features for instance) >Additionally it can be read by tools such as cpanm or carton for an >easy way to install dependencies on non-Debian-based systems. > >For more information on cpanfile, see >http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod > >This patch replace C4::Installer::PerlDependencies by an equivalent >cpanfile and update all scripts/modules that were using PerlDependencies >It also removes dead code from C4::Installer::PerlModules (some >subroutines were not used at all, except in unit tests) > >Added dependencies: > - Module::CPANfile > - CPAN::Meta (dependency of Module::CPANfile, but we need a more recent > version than the one Module::CPANfile requires) > >Test plan: > 1. Go to About page, tab Perl modules and keep this browser tab open > 2. Apply patch > 3. Install Module::CPANfile and CPAN::Meta > a. On Debian-based systems: > # will install libcpan-meta-perl as a dependency > sudo apt install libmodule-cpanfile-perl > b. Others: > # will install CPAN::Meta as a dependency > sudo cpanm Module::CPANfile > 4. In a new browser tab, go to About page, tab Perl modules and compare > the table with the one in the previous browser tab > They should be identical, except for newly added dependencies > (Module::CPANfile and CPAN::Meta) > 5. Do a 'standard' install > a. perl Makefile.PL (select 'standard') > b. make > c. sudo make install > d. Configure your database, web server, ... and go through the web > install process > 6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which > should be /usr/share/koha/lib) > 7. Go to the about page of this fresh install and compare it with your > dev install > 8. Verify that debian/list-deps still works > This takes a lot of time and it may not be necessary to wait until > the end. If you see some Debian package names that correspond to > modules in cpanfile, it means it still works > (you need apt-file for this script to work) > 9. Verify that koha_perl_deps.pl still works > 10. prove t/Installer_pm.t t/Installer_PerlModules.t >--- > C4/Installer.pm | 1 - > C4/Installer/PerlDependencies.pm | 919 --------------------------------------- > C4/Installer/PerlModules.pm | 179 +++----- > Makefile.PL | 3 +- > about.pl | 2 +- > cpanfile | 172 ++++++++ > debian/list-deps | 112 ++--- > installer/install.pl | 1 + > t/Installer_PerlDependencies.t | 14 - > t/Installer_PerlModules.t | 42 +- > t/Installer_pm.t | 12 +- > 11 files changed, 292 insertions(+), 1165 deletions(-) > delete mode 100644 C4/Installer/PerlDependencies.pm > create mode 100644 cpanfile > delete mode 100755 t/Installer_PerlDependencies.t > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 1a5c037a42..054fa6b651 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -22,7 +22,6 @@ use Modern::Perl; > use Encode qw( encode is_utf8 ); > use DBIx::RunSQL; > use C4::Context; >-use C4::Installer::PerlModules; > use DBI; > use Koha; > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >deleted file mode 100644 >index 3cacafc756..0000000000 >--- a/C4/Installer/PerlDependencies.pm >+++ /dev/null >@@ -1,919 +0,0 @@ >-package C4::Installer::PerlDependencies; >- >-use warnings; >-use strict; >- >-our $PERL_DEPS = { >- 'Try::Tiny' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.22' >- }, >- 'Plack::Middleware::ReverseProxy' => { >- 'usage' => 'Plack', >- 'required' => '1', >- 'min_ver' => '0.14' >- }, >- 'XML::LibXSLT' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.59' >- }, >- 'Text::CSV::Encoded' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.09' >- }, >- 'Storable' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.20' >- }, >- 'PDF::API2' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2' >- }, >- 'Text::CSV_XS' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.32' >- }, >- 'Schedule::At' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.06' >- }, >- 'MIME::Lite' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3' >- }, >- 'GD' => { >- 'usage' => 'Patron Images Feature', >- 'required' => '0', >- 'min_ver' => '2.39' >- }, >- 'List::MoreUtils' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.21' >- }, >- 'DBI' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.53' >- }, >- 'DBIx::Class::Schema::Loader' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.07039' >- }, >- 'Net::Z3950::ZOOM' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.16' >- }, >- 'Biblio::EndnoteStyle' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.05' >- }, >- 'Date::Calc' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '5.4' >- }, >- 'Mail::Sendmail' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.79' >- }, >- 'DBD::mysql' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '4.004' >- }, >- 'XML::LibXML' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.59' >- }, >- 'Email::Date' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.103' >- }, >- 'Exception::Class' => { >- 'usage' => 'Core', >- 'required' => '1.38', >- 'min_ver' => '1.38' >- }, >- 'HTML::Scrubber' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.08' >- }, >- 'XML::Dumper' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.81' >- }, >- 'URI::Escape' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3.31' >- }, >- 'Unicode::Normalize' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.32' >- }, >- 'Text::Wrap' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2005.082401' >- }, >- 'Test' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.25' >- }, >- 'Locale::PO' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.17' >- }, >- 'LWP::Simple' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.41' >- }, >- 'DBD::SQLite2' => { >- 'usage' => 'Offline Circulation Feature', >- 'required' => '0', >- 'min_ver' => '0.33' >- }, >- 'SMS::Send' => { >- 'usage' => 'SMS Messaging Feature', >- 'required' => '0', >- 'min_ver' => '0.05' >- }, >- 'XML::SAX::ParserFactory' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.01' >- }, >- 'PDF::API2::Util' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2' >- }, >- 'Class::Accessor' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.3' >- }, >- 'HTTP::OAI' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3.2' >- }, >- 'LWP::UserAgent' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.033' >- }, >- 'MIME::Base64' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3.07' >- }, >- 'Algorithm::CheckDigits' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.5' >- }, >- 'Net::LDAP' => { >- 'usage' => 'LDAP Interface Feature', >- 'required' => '0', >- 'min_ver' => '0.33' >- }, >- 'PDF::Reuse' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.36' >- }, >- 'Text::PDF' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.29', >- # We don't use this directly, but it's not a required dependency for >- # PDF::Reuse however we need it via that or tests fail. >- }, >- 'Font::TTF' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.45', >- # Also needed for our use of PDF::Reuse >- }, >- 'DateTime' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.58' >- }, >- 'DateTime::TimeZone' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.20' >- }, >- 'DateTime::Format::MySQL' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.04' >- }, >- 'DateTime::Set' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.28' >- }, >- 'DateTime::Event::ICal' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.08' >- }, >- 'Graphics::Magick' => { >- 'usage' => 'Patron Card Creator Feature', >- 'required' => '0', >- 'min_ver' => '1.3.05' >- }, >- 'MARC::Charset' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.98' >- }, >- 'Cache::Memcached' => { >- 'usage' => 'Caching', >- 'required' => '0', >- 'min_ver' => '1.30' >- }, >- 'Cache::Memcached::Fast' => { >- 'usage' => 'Caching', >- 'required' => '0', >- 'min_ver' => '0.17' >- }, >- 'Cache::FastMmap' => { >- 'usage' => 'Caching', >- 'required' => '0', >- 'min_ver' => '1.34' >- }, >- 'Cache::Memory' => { >- 'usage' => 'Caching', >- 'required' => '0', >- 'min_ver' => '2.04' >- }, >- 'Net::LDAP::Filter' => { >- 'usage' => 'LDAP Interface Feature', >- 'required' => '0', >- 'min_ver' => '0.14' >- }, >- 'Text::CSV' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.01' >- }, >- 'PDF::Table' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.9.3' >- }, >- 'CGI' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3.15' >- }, >- 'Class::Factory::Util' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.6' >- }, >- 'List::Util' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.18' >- }, >- 'Lingua::Stem::Snowball' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.952' >- }, >- 'Time::localtime' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.02' >- }, >- 'Digest::SHA' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '5.43' >- }, >- 'CGI::Session::Serialize::yaml' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '4.2' >- }, >- 'CGI::Carp' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.29' >- }, >- 'Getopt::Long' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.35' >- }, >- 'Term::ANSIColor' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.1' >- }, >- 'Getopt::Std' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.05' >- }, >- 'Data::Dumper' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.121' >- }, >- 'Lingua::Stem' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.82' >- }, >- 'MIME::QuotedPrint' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '3.07' >- }, >- 'IPC::Cmd' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.46' >- }, >- 'HTTP::Cookies' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.39' >- }, >- 'HTTP::Request::Common' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.26' >- }, >- 'PDF::Reuse::Barcode' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.05' >- }, >- 'GD::Barcode::UPCE' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.1' >- }, >- 'Text::Iconv' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.7' >- }, >- 'File::Temp' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.16' >- }, >- 'Date::Manip' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '5.44' >- }, >- 'Locale::Language' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.07' >- }, >- 'PDF::API2::Simple' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1' >- }, >- 'XML::RSS' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.31' >- }, >- 'XML::Simple' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.14' >- }, >- 'PDF::API2::Page' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2' >- }, >- 'CGI::Session' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '4.2' >- }, >- 'CGI::Session::Driver::memcached' => { >- 'usage' => 'Memcached Feature (Experimental)', >- 'required' => '0', >- 'min_ver' => '0.04', >- }, >- 'POSIX' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.09' >- }, >- 'Digest::MD5' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.36' >- }, >- 'Authen::CAS::Client' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.05' >- }, >- 'Data::ICal' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.13' >- }, >- 'MARC::Record' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.0.6' >- }, >- 'Locale::Currency::Format' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.28' >- }, >- 'Number::Format' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.52' >- }, >- 'YAML::Syck' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.71' >- }, >- 'Time::HiRes' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.86' >- }, >- 'MARC::File::XML' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.0.1' >- }, >- 'XML::SAX::Writer' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.44' >- }, >- 'JSON' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.07' >- }, >- 'YAML' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.71' >- }, >- 'UNIVERSAL::require' => { >- 'usage' => 'SipServer', >- 'required' => '0', >- 'min_ver' => '0.13', >- }, >- 'Net::Server' => { >- 'usage' => 'SipServer', >- 'required' => '0', >- 'min_ver' => '0.97', >- }, >- 'Business::ISBN' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.05', >- }, >- 'Business::ISSN' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.91', >- }, >- 'Template' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.22', >- }, >- 'Template::Plugin::Stash' => { >- 'usage' => 'Debugging', >- 'required' => '0', >- 'min_ver' => '1.006', >- }, >- 'Gravatar::URL' => { >- 'usage' => 'Photos in OPAC reviews', >- 'required' => '0', >- 'min_ver' => '1.03', >- }, >- 'Modern::Perl' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.03', >- }, >- 'DateTime::Format::ICal' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.09', >- }, >- 'Template::Plugin::HtmlToText' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.03', >- }, >- 'Template::Plugin::JSON::Escape' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.02', >- }, >- 'DBD::Mock' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.39' >- }, >- 'Text::Bidi' => { >- 'usage' => 'Label batch PDF', >- 'required' => '1', >- 'min_ver' => '0.03', >- }, >- 'Test::DBIx::Class' => { >- 'usage' => 'Testing modules utilising DBIx::Class', >- 'required' => '0', >- 'min_ver' => '0.42', >- }, >- 'Test::Deep' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '0.106', >- }, >- 'Test::Exception' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '0.35', >- }, >- 'Test::Harness' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '2.56' >- }, >- 'Test::MockModule' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.05', >- }, >- 'Test::MockObject' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '1.09', >- }, >- 'Test::More' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.8' >- }, >- 'Test::Strict' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '0.14', >- }, >- 'Test::Warn' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '0.21', >- }, >- 'Test::YAML::Valid' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '0.04', >- }, >- 'Text::Unaccent' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.08', >- }, >- 'Test::WWW::Mechanize' => { >- 'usage' => 'Testing suite', >- 'required' => '0', >- 'min_ver' => '1.42', >- }, >- 'HTML::FormatText' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.23', >- }, >- 'AnyEvent' => { >- 'usage' => 'Command line scripts', >- 'required' => '0', >- 'min_ver' => '5.0', >- }, >- 'AnyEvent::HTTP' => { >- 'usage' => 'Command line scripts', >- 'required' => '0', >- 'min_ver' => '2.13', >- }, >- 'Moo' => { >- 'usage' => 'Core', >- 'required' => '0', >- 'min_ver' => '1', >- }, >- 'String::Random' => { >- 'usage' => 'OpacSelfRegistration', >- 'required' => '1', >- 'min_ver' => '0.22', >- }, >- 'File::Temp' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '0.22', >- }, >- 'File::Copy' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '2.08', >- }, >- 'File::Path' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '2.07', >- }, >- 'Archive::Extract' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '0.60', >- }, >- 'Archive::Zip' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '1.30', >- }, >- 'Module::Load::Conditional' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '0.38', >- }, >- 'Module::Bundled::Files' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '0.03', >- }, >- 'Module::Pluggable' => { >- 'usage' => 'Plugins', >- 'required' => '0', >- 'min_ver' => '3.9', >- }, >- 'File::Slurp' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '9999.13', >- }, >- 'Library::CallNumber::LC' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.22', >- }, >- 'Crypt::Eksblowfish::Bcrypt' => { >- 'usage' => 'Password storage', >- 'required' => '1', >- 'min_ver' => '0.008', >- }, >- 'HTTPD::Bench::ApacheBench' => { >- 'usage' => 'Load testing', >- 'required' => '0', >- 'min_ver' => '0.73', >- }, >- 'Email::Valid' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.190', >- }, >- 'OpenOffice::OODoc' => { >- usage => 'Export', >- required => 1, >- min_ver => '2.125', >- }, >- 'Locale::Maketext' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.19', >- }, >- 'Locale::Maketext::Lexicon' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '0.91', >- }, >- 'LWP::Protocol::https' => { >- 'usage' => 'OverDrive integration', >- 'required' => '0', >- 'min_ver' => '5.836', >- }, >- 'SOAP::Lite' => { >- 'usage' => 'Norwegian national library card', >- 'required' => '0', >- 'min_ver' => '0.712', >- }, >- 'Crypt::GCrypt' => { >- 'usage' => 'Norwegian national library card', >- 'required' => '0', >- 'min_ver' => '1.24', >- }, >- 'Convert::BaseN' => { >- 'usage' => 'Norwegian national library card', >- 'required' => '0', >- 'min_ver' => '0.01', >- }, >- 'Digest::SHA' => { >- 'usage' => 'Norwegian national library card', >- 'required' => '0', >- 'min_ver' => '5.61', >- }, >- 'PDF::FromHTML' => { >- 'usage' => 'Discharge generation', >- 'required' => '0', >- 'min_ver' => '0.31', >- }, >- 'Devel::Cover' => { >- 'usage' => 'Test code coverage', >- 'required' => '0', >- 'min_ver' => '0.89', >- }, >- 'Log::Log4perl' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.29', >- }, >- 'XML::Writer' => { >- 'usage' => 'Command line scripts', >- 'required' => '0', >- 'min_ver' => '0.614', >- }, >- 'UUID' => { >- 'usage' => 'Professional cataloging interface', >- 'required' => '1', >- 'min_ver' => '0.05', >- }, >- 'Mojolicious' => { >- 'usage' => 'REST API', >- 'required' => '1', >- 'min_ver' => '7.21', >- }, >- 'Mojolicious::Plugin::OpenAPI' => { >- 'usage' => 'REST API', >- 'required' => '1', >- 'min_ver' => '1.15', >- }, >- 'JSON::Validator' => { >- 'usage' => 'REST API', >- 'required' => '1', >- 'min_ver' => '0.97', >- }, >- 'UNIVERSAL::can' => { >- 'usage' => 'SIP', >- 'required' => '1', >- 'min_ver' => '1.10', >- }, >- 'WWW::YouTube::Download' => { >- 'usage' => 'HTML5Media streaming from YouTube', >- 'required' => '0', >- 'min_ver' => '0.56', >- }, >- 'Net::SFTP::Foreign' => { >- 'usage' => 'Edifact', >- 'required' => '0', >- 'min_ver' => '1.73', >- }, >- 'Text::Unidecode' => { >- 'usage' => 'Edifact', >- 'required' => '0', >- 'min_ver' => '0.04', >- }, >- 'Time::Fake' => { >- 'usage' => 'Test code coverage', >- 'required' => '0', >- 'min_ver' => '0.11', >- }, >- 'DBIx::RunSQL' => { >- 'usage' => 'Load SQL files', >- 'required' => '1', >- 'min_ver' => '0.14', >- }, >- 'Lingua::Ispell' => { >- 'usage' => 'Enhanced Content - Tagging', >- 'required' => '0', >- 'min_ver' => '0.07' >- }, >- 'WWW::CSRF' => { >- usage => 'Core', >- required => 1, >- min_ver => '1.00', >- }, >- 'Sereal::Encoder' => { >- 'usage' => 'Caching', >- 'required' => '1', >- 'min_ver' => '3.0', >- }, >- 'Sereal::Decoder' => { >- 'usage' => 'Caching', >- 'required' => '1', >- 'min_ver' => '3.0', >- }, >- 'HTML::Entities' => { >- usage => 'Core', >- required => 1, >- min_ver => '3.69', # same for Wheezy/Jessie >- }, >- 'Readonly' => { >- 'usage' => 'Make script happy', >- 'required' => '0', >- 'min_ver' => '0.01' >- }, >- 'Readonly::XS' => { >- 'usage' => 'Make script happy', >- 'required' => '0', >- 'min_ver' => '0.01' >- }, >- 'Bytes::Random::Secure' => { >- usage => 'Core', >- required => 1, >- min_ver => '0.28', >- }, >- 'WebService::ILS' => { >- 'usage' => 'Interface third party systems', >- 'required' => '0', >- 'min_ver' => '0.07', >- }, >-}; >- >-1; >- >-__END__ >- >-=head1 NAME >- >-C4::Installer::PerlDependencies >- >-=head1 ABSTRACT >- >-A module for cataloging Koha Perl dependencies. >- >-=head1 SYNOPSIS >- >-This module's sole purpose for existence is to provide a single location to catalog all Koha Perl dependencies. New dependencies should be added to the >-end of the outer hash and follow the key/value pattern used in the other dependencies. >- >-=head2 Debian >- >-If you change the list of dependencies, and you use Debian, please also >-run the debian/update-control script and commit the modified version of >-debian/control into git as well. If you're not running Debian, don't >-worry about it. >- >-=head1 AUTHOR >- >-Chris Nighswonger <cnighswonger AT foundations DOT edu> >- >-=head1 COPYRIGHT >- >-Copyright 2010 Foundations Bible College. >- >-=head1 LICENSE >- >-This file is part of Koha. >- >-Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software >-Foundation; either version 2 of the License, or (at your option) any later version. >- >-You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, >-Fifth Floor, Boston, MA 02110-1301 USA. >- >-=head1 DISCLAIMER OF WARRANTY >- >-Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-A PARTICULAR PURPOSE. See the GNU General Public License for more details. >- >-=cut >diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm >index 35cbfebeea..3fa81c266b 100644 >--- a/C4/Installer/PerlModules.pm >+++ b/C4/Installer/PerlModules.pm >@@ -4,11 +4,8 @@ use warnings; > use strict; > > use File::Spec; >- >-use C4::Installer::PerlDependencies; >- >- >-our $PERL_DEPS = $C4::Installer::PerlDependencies::PERL_DEPS; >+use File::Basename; >+use Module::CPANfile; > > sub new { > my $invocant = shift; >@@ -17,44 +14,34 @@ sub new { > upgrade_pm => [], > current_pm => [], > }; >+ > my $type = ref($invocant) || $invocant; > bless ($self, $type); > return $self; > } > >-sub prereq_pm { >+sub prereqs { > my $self = shift; >- my $prereq_pm = {}; >- for (keys %$PERL_DEPS) { >- $prereq_pm->{$_} = $PERL_DEPS->{$_}->{'min_ver'}; >+ >+ unless (defined $self->{prereqs}) { >+ my $filename = $INC{'C4/Installer/PerlModules.pm'}; >+ my $path = dirname(dirname(dirname($filename))); >+ $self->{prereqs} = Module::CPANfile->load("$path/cpanfile")->prereqs; > } >- return $prereq_pm; >+ >+ return $self->{prereqs}; > } > >-sub required { >+sub prereq_pm { > my $self = shift; >- my %params = @_; >- if ($params{'module'}) { >- return -1 unless grep {m/$params{'module'}/} keys(%$PERL_DEPS); >- return $PERL_DEPS->{$params{'module'}}->{'required'}; >- } >- elsif ($params{'required'}) { >- my $required_pm = []; >- for (keys %$PERL_DEPS) { >- push (@$required_pm, $_) if $PERL_DEPS->{$_}->{'required'} == 1; >- } >- return $required_pm; >- } >- elsif ($params{'optional'}) { >- my $optional_pm = []; >- for (keys %$PERL_DEPS) { >- push (@$optional_pm, $_) if $PERL_DEPS->{$_}->{'required'} == 0; >- } >- return $optional_pm; >- } >- else { >- return -1; # unrecognized parameter passed in >+ >+ my $prereq_pm = {}; >+ my $reqs = $self->prereqs->merged_requirements; >+ foreach my $module ($reqs->required_modules) { >+ $prereq_pm->{$module} = $reqs->requirements_for_module($module); > } >+ >+ return $prereq_pm; > } > > sub versions_info { >@@ -65,57 +52,43 @@ sub versions_info { > $self->{'upgrade_pm'} = []; > $self->{'current_pm'} = []; > >- for my $module ( sort keys %$PERL_DEPS ) { >- my $module_infos = $self->version_info($module); >- my $status = $module_infos->{status}; >- push @{ $self->{"${status}_pm"} }, { $module => $module_infos }; >+ foreach my $phase ($self->prereqs->phases) { >+ foreach my $type ($self->prereqs->types_in($phase)) { >+ my $reqs = $self->prereqs->requirements_for($phase, $type); >+ foreach my $module ($reqs->required_modules) { >+ no warnings; # perl throws warns for invalid $VERSION numbers which some modules use >+ >+ my $module_infos = { >+ cur_ver => 0, >+ min_ver => $reqs->requirements_for_module($module), >+ required => $type eq 'requires', >+ }; >+ >+ my $attr; >+ >+ eval "require $module"; >+ if ($@) { >+ $attr = 'missing_pm'; >+ } else { >+ my $pkg_version = $module->can("VERSION") ? $module->VERSION : 0; >+ $module_infos->{cur_ver} = $pkg_version; >+ if ($reqs->accepts_module($module => $pkg_version)) { >+ $attr = 'current_pm'; >+ } else { >+ $attr = 'upgrade_pm'; >+ } >+ } >+ >+ push @{ $self->{$attr} }, { $module => $module_infos }; >+ } >+ } > } > } > >-sub version_info { >- no warnings >- ; # perl throws warns for invalid $VERSION numbers which some modules use >- my ( $self, $module ) = @_; >- return -1 unless grep { /^$module$/ } keys(%$PERL_DEPS); >- >- eval "require $module"; >- my $pkg_version = $module->can("VERSION") ? $module->VERSION : 0; >- my $min_version = $PERL_DEPS->{$module}->{'min_ver'} // 0; >- >- my ( $cur_ver, $upgrade, $status ); >- if ($@) { >- ( $cur_ver, $upgrade, $status ) = ( 0, 0, 'missing' ); >- } >- elsif ( version->parse("$pkg_version") < version->parse("$min_version") ) { >- ( $cur_ver, $upgrade, $status ) = ( $module->VERSION, 1, 'upgrade' ); >- } >- else { >- ( $cur_ver, $upgrade, $status ) = ( $module->VERSION, 0, 'current' ); >- } >- >- return { >- cur_ver => $cur_ver, >- min_ver => $PERL_DEPS->{$module}->{min_ver}, >- required => $PERL_DEPS->{$module}->{required}, >- usage => $PERL_DEPS->{$module}->{usage}, >- upgrade => $upgrade, >- status => $status, >- }; >-} >- >- > sub get_attr { > return $_[0]->{$_[1]}; > } > >-sub module_count { >- return scalar(keys(%$PERL_DEPS)); >-} >- >-sub module_list { >- return keys(%$PERL_DEPS); >-} >- > 1; > __END__ > >@@ -147,39 +120,16 @@ A module for manipulating Koha Perl dependency list objects. > > PREREQ_PM => $perl_modules->prereq_pm,> > >-=head2 required() >- >- This method accepts a single parameter with three possible values: a module name, the keyword 'required,' the keyword 'optional.' If passed the name of a module, a boolean value is returned indicating whether the module is required (1) or not (0). If on of the two keywords is passed in, it returns an arrayref to an array who's elements are the names of the modules specified either required or optional. >- >- example: >- C<my $is_required = $perl_modules->required(module => 'CGI::Carp');> >- >- C<my $optional_pm_names = $perl_modules->required(optional => 1);> >- >-=head2 version_info() >- >- Depending on the parameters passed when invoking, this method will give the current status of modules currently used in Koha as well as the currently installed version if the module is installed, the current minimum required version, and the upgrade status. If passed C<module => module_name>, the method evaluates only that module. If passed C<all => 1>, all modules are evaluated. > >- example: >- C<my $module_status = $perl_modules->version_info('foo');> >- >- This usage returns a hashref with a single key/value pair. The key is the module name. The value is an anonymous hash with the following keys: >- >- cur_ver = version number of the currently installed version (This is 0 if the module is not currently installed.) >- min_ver = minimum version required by Koha >- upgrade = upgrade status of the module relative to Koha's requirements (0 if the installed module does not need upgrading; 1 if it does) >- required = 0 of the module is optional; 1 if required >- >- { >- 'required' => 1, >- 'cur_ver' => '1.30_01', >- 'upgrade' => 0, >- 'min_ver' => '1.29' >- }; >+=head2 versions_info > >- C<$perl_modules->version_info;> >+ C<$perl_modules->versions_info;> > >- This usage loads the same basic data as the previous usage into three accessors: missing_pm, upgrade_pm, and current_pm. Each of these may be accessed by using the C<get_attr> method. Each accessor returns an anonymous array who's elements are anonymous hashes. They follow this format (NOTE: Upgrade status is indicated by the accessor name.): >+ This loads info of required modules into three accessors: missing_pm, >+ upgrade_pm, and current_pm. Each of these may be accessed by using the >+ C<get_attr> method. Each accessor returns an anonymous array who's >+ elements are anonymous hashes. They follow this format (NOTE: Upgrade >+ status is indicated by the accessor name.): > > [ > { >@@ -211,23 +161,6 @@ A module for manipulating Koha Perl dependency list objects. > example: > C<my $missing_pm = $perl_modules->get_attr('missing_pm');> > >-=head2 module_count >- >- Returns a scalar value representing the current number of Perl modules used by Koha. >- >- example: >- C<my $module_count = $perl_modules->module_count;> >- >-=head2 module_list >- >- Returns an array who's elements are the names of the Perl modules used by Koha. >- >- example: >- C<my @module_list = $perl_modules->module_list;> >- >- This is useful for commandline exercises such as: >- >- perl -MC4::Installer::PerlModules -e 'my $deps = C4::Installer::PerlModule->new; print (join("\n",$deps->module_list));' > > =head1 AUTHOR > >diff --git a/Makefile.PL b/Makefile.PL >index ada42246ff..2a26d18d1e 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -29,7 +29,7 @@ use FindBin; # we need to enforce which C4::Installer::PerlModule is used in cas > > use lib $FindBin::Bin; > >-use C4::Installer; >+use C4::Installer::PerlModules; > > my $koha_pm = C4::Installer::PerlModules->new; > >@@ -305,6 +305,7 @@ my $target_map = { > './circ' => 'INTRANET_CGI_DIR', > './clubs' => 'INTRANET_CGI_DIR', > './course_reserves' => 'INTRANET_CGI_DIR', >+ './cpanfile' => 'PERL_MODULE_DIR', > './docs/history.txt' => { target => 'DOC_DIR', trimdir => -1 }, > './offline_circ' => 'INTRANET_CGI_DIR', > './edithelp.pl' => 'INTRANET_CGI_DIR', >diff --git a/about.pl b/about.pl >index 5e481738c7..bc9962f899 100755 >--- a/about.pl >+++ b/about.pl >@@ -31,7 +31,7 @@ use Config; > use C4::Output; > use C4::Auth; > use C4::Context; >-use C4::Installer; >+use C4::Installer::PerlModules; > > use Koha; > use Koha::Acquisition::Currencies; >diff --git a/cpanfile b/cpanfile >new file mode 100644 >index 0000000000..1fa284dbe0 >--- /dev/null >+++ b/cpanfile >@@ -0,0 +1,172 @@ >+requires 'Algorithm::CheckDigits', '0.5'; >+requires 'Authen::CAS::Client', '0.05'; >+requires 'Biblio::EndnoteStyle', '0.05'; >+requires 'Business::ISBN', '2.05'; >+requires 'Business::ISSN', '0.91'; >+requires 'Bytes::Random::Secure', '0.28'; >+requires 'CGI', '3.15'; >+requires 'CGI::Carp', '1.29'; >+requires 'CGI::Session', '4.2'; >+requires 'CGI::Session::Serialize::yaml', '4.2'; >+requires 'CPAN::Meta', '2.150006'; >+requires 'Class::Accessor', '0.3'; >+requires 'Class::Factory::Util', '1.6'; >+requires 'Crypt::Eksblowfish::Bcrypt', '0.008'; >+requires 'DBD::Mock', '1.39'; >+requires 'DBD::mysql', '4.004'; >+requires 'DBI', '1.53'; >+requires 'DBIx::Class::Schema::Loader', '0.07039'; >+requires 'DBIx::RunSQL', '0.14'; >+requires 'Data::Dumper', '2.121'; >+requires 'Data::ICal', '0.13'; >+requires 'Date::Calc', '5.4'; >+requires 'Date::Manip', '5.44'; >+requires 'DateTime', '0.58'; >+requires 'DateTime::Event::ICal', '0.08'; >+requires 'DateTime::Format::ICal', '0.09'; >+requires 'DateTime::Format::MySQL', '0.04'; >+requires 'DateTime::Set', '0.28'; >+requires 'DateTime::TimeZone', '1.20'; >+requires 'Digest::MD5', '2.36'; >+requires 'Email::Date', '1.103'; >+requires 'Email::Valid', '0.190'; >+requires 'Exception::Class', '1.38'; >+requires 'File::Slurp', '9999.13'; >+requires 'Font::TTF', '0.45'; >+requires 'GD::Barcode::UPCE', '1.1'; >+requires 'Getopt::Long', '2.35'; >+requires 'Getopt::Std', '1.05'; >+requires 'HTML::Entities', '3.69'; >+requires 'HTML::FormatText', '1.23'; >+requires 'HTML::Scrubber', '0.08'; >+requires 'HTTP::Cookies', '1.39'; >+requires 'HTTP::OAI', '3.2'; >+requires 'HTTP::Request::Common', '1.26'; >+requires 'IPC::Cmd', '0.46'; >+requires 'JSON', '2.07'; >+requires 'JSON::Validator', '0.97'; >+requires 'LWP::Simple', '1.41'; >+requires 'LWP::UserAgent', '2.033'; >+requires 'Library::CallNumber::LC', '0.22'; >+requires 'Lingua::Stem', '0.82'; >+requires 'Lingua::Stem::Snowball', '0.952'; >+requires 'List::MoreUtils', '0.21'; >+requires 'List::Util', '1.18'; >+requires 'Locale::Currency::Format', '1.28'; >+requires 'Locale::Language', '2.07'; >+requires 'Locale::Maketext', '1.19'; >+requires 'Locale::Maketext::Lexicon', '0.91'; >+requires 'Locale::PO', '0.17'; >+requires 'Log::Log4perl', '1.29'; >+requires 'MARC::Charset', '0.98'; >+requires 'MARC::File::XML', 'v1.0.1'; >+requires 'MARC::Record', 'v2.0.6'; >+requires 'MIME::Base64', '3.07'; >+requires 'MIME::Lite', '3'; >+requires 'MIME::QuotedPrint', '3.07'; >+requires 'Mail::Sendmail', '0.79'; >+requires 'Modern::Perl', '1.03'; >+requires 'Module::CPANfile', '1.1000'; >+requires 'Mojolicious', '7.21'; >+requires 'Mojolicious::Plugin::OpenAPI', '1.15'; >+requires 'Net::Z3950::ZOOM', '1.16'; >+requires 'Number::Format', '1.52'; >+requires 'OpenOffice::OODoc', '2.125'; >+requires 'PDF::API2', '2'; >+requires 'PDF::API2::Page', '2'; >+requires 'PDF::API2::Simple', '1'; >+requires 'PDF::API2::Util', '2'; >+requires 'PDF::Reuse', '0.36'; >+requires 'PDF::Reuse::Barcode', '0.05'; >+requires 'PDF::Table', 'v0.9.3'; >+requires 'POSIX', '1.09'; >+requires 'Plack::Middleware::ReverseProxy', '0.14'; >+requires 'Schedule::At', '1.06'; >+requires 'Sereal::Decoder', '3.0'; >+requires 'Sereal::Encoder', '3.0'; >+requires 'Storable', '2.20'; >+requires 'String::Random', '0.22'; >+requires 'Template', '2.22'; >+requires 'Template::Plugin::HtmlToText', '0.03'; >+requires 'Template::Plugin::JSON::Escape', '0.02'; >+requires 'Term::ANSIColor', '1.1'; >+requires 'Test', '1.25'; >+requires 'Test::Harness', '2.56'; >+requires 'Test::MockModule', '0.05'; >+requires 'Test::More', '0.8'; >+requires 'Text::Bidi', '0.03'; >+requires 'Text::CSV', '0.01'; >+requires 'Text::CSV::Encoded', '0.09'; >+requires 'Text::CSV_XS', '0.32'; >+requires 'Text::Iconv', '1.7'; >+requires 'Text::PDF', '0.29'; >+requires 'Text::Unaccent', '1.08'; >+requires 'Text::Wrap', '2005.082401'; >+requires 'Time::HiRes', '1.86'; >+requires 'Time::localtime', '1.02'; >+requires 'Try::Tiny', '0.22'; >+requires 'UNIVERSAL::can', '1.10'; >+requires 'URI::Escape', '3.31'; >+requires 'UUID', '0.05'; >+requires 'Unicode::Normalize', '0.32'; >+requires 'WWW::CSRF', '1.00'; >+requires 'XML::Dumper', '0.81'; >+requires 'XML::LibXML', '1.59'; >+requires 'XML::LibXSLT', '1.59'; >+requires 'XML::RSS', '1.31'; >+requires 'XML::SAX::ParserFactory', '1.01'; >+requires 'XML::SAX::Writer', '0.44'; >+requires 'XML::Simple', '2.14'; >+requires 'YAML', '0.71'; >+requires 'YAML::Syck', '0.71'; >+recommends 'AnyEvent', '5.0'; >+recommends 'AnyEvent::HTTP', '2.13'; >+recommends 'Archive::Extract', '0.60'; >+recommends 'Archive::Zip', '1.30'; >+recommends 'CGI::Session::Driver::memcached', '0.04'; >+recommends 'Cache::FastMmap', '1.34'; >+recommends 'Cache::Memcached', '1.30'; >+recommends 'Cache::Memcached::Fast', '0.17'; >+recommends 'Cache::Memory', '2.04'; >+recommends 'Convert::BaseN', '0.01'; >+recommends 'Crypt::GCrypt', '1.24'; >+recommends 'DBD::SQLite2', '0.33'; >+recommends 'Devel::Cover', '0.89'; >+recommends 'Digest::SHA', '5.61'; >+recommends 'File::Copy', '2.08'; >+recommends 'File::Path', '2.07'; >+recommends 'File::Temp', '0.22'; >+recommends 'GD', '2.39'; >+recommends 'Graphics::Magick', 'v1.3.5'; >+recommends 'Gravatar::URL', '1.03'; >+recommends 'HTTPD::Bench::ApacheBench', '0.73'; >+recommends 'LWP::Protocol::https', '5.836'; >+recommends 'Lingua::Ispell', '0.07'; >+recommends 'Module::Bundled::Files', '0.03'; >+recommends 'Module::Load::Conditional', '0.38'; >+recommends 'Module::Pluggable', '3.9'; >+recommends 'Moo', '1'; >+recommends 'Net::LDAP', '0.33'; >+recommends 'Net::LDAP::Filter', '0.14'; >+recommends 'Net::SFTP::Foreign', '1.73'; >+recommends 'Net::Server', '0.97'; >+recommends 'PDF::FromHTML', '0.31'; >+recommends 'Readonly', '0.01'; >+recommends 'Readonly::XS', '0.01'; >+recommends 'SMS::Send', '0.05'; >+recommends 'SOAP::Lite', '0.712'; >+recommends 'Template::Plugin::Stash', '1.006'; >+recommends 'Test::DBIx::Class', '0.42'; >+recommends 'Test::Deep', '0.106'; >+recommends 'Test::Exception', '0.35'; >+recommends 'Test::MockObject', '1.09'; >+recommends 'Test::Strict', '0.14'; >+recommends 'Test::WWW::Mechanize', '1.42'; >+recommends 'Test::Warn', '0.21'; >+recommends 'Test::YAML::Valid', '0.04'; >+recommends 'Text::Unidecode', '0.04'; >+recommends 'Time::Fake', '0.11'; >+recommends 'UNIVERSAL::require', '0.13'; >+recommends 'WWW::YouTube::Download', '0.56'; >+recommends 'WebService::ILS', '0.07'; >+recommends 'XML::Writer', '0.614'; >diff --git a/debian/list-deps b/debian/list-deps >index a1b37cf251..aac924dc70 100755 >--- a/debian/list-deps >+++ b/debian/list-deps >@@ -1,6 +1,6 @@ > #!/usr/bin/perl > # >-# Write dependency list from Koha PerlDependencies.pm, in Debian format. >+# Write dependency list from Koha cpanfile, in Debian format. > # > # Copyright 2010 Catalyst IT, Ltd > # >@@ -20,7 +20,7 @@ > use strict; > use warnings; > >-use C4::Installer::PerlDependencies; >+use C4::Installer::PerlModules; > > # These are packages that may not be in the apt archive in a way that > # apt-file can find, e.g. in the Koha repo rather than the regular >@@ -39,61 +39,65 @@ my %ignore = ( > 'CHI::Driver::Memcached' => 1, > ); > >-my $deps = $C4::Installer::PerlDependencies::PERL_DEPS; >- > my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl5/[0-9.]+)"; > >-foreach my $module ( keys %$deps ) { >- next if $ignore{$module}; >- my $ver = $deps->{$module}->{'min_ver'}; >- my $subpath = $module; >- $subpath =~ s,::,/,g; >- my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$"); >- my @temp = split( /\n/, $output ); >- my @lines = (); >+my $modules = C4::Installer::PerlModules->new(); >+my $prereqs = $modules->prereqs; >+foreach my $phase ($prereqs->phases) { >+ foreach my $type ($prereqs->types_in($phase)) { >+ my $reqs = $prereqs->requirements_for($phase, $type); >+ foreach my $module ( $reqs->required_modules ) { >+ next if $ignore{$module}; >+ my $subpath = $module; >+ $subpath =~ s,::,/,g; >+ my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$"); >+ my @temp = split( /\n/, $output ); >+ my @lines = (); > >- # Remove packages that are required/essential and always installed on >- # a Debian system. Debian packages should not have unversioned >- # dependencies on such packages. >- foreach my $line (@temp) { >- if ( $line ne "perl-base" ) { >- @lines = ( @lines, $line ); >- } >- } >- if ( exists $overrides{$module} ) { >- print "$overrides{$module}\n"; >- } >- elsif ( scalar(@lines) == 1 && $lines[0] ne "" ) { >- my $pkg = $lines[0]; >- print "$pkg\n"; >- } >- elsif ( scalar(@lines) > 1 ) { >- foreach my $pkg (@lines) { >- print " | " if ( $pkg ne $lines[0] ); >- print "$pkg"; >- print " | $pkg" . "-5.22" if ( $pkg eq "perl-modules" ); >- print " | $pkg" . "-5.24" if ( $pkg eq "perl-modules" ); >- } >- print "\n"; >- } >- elsif ( scalar(@temp) != 0 ) { >+ # Remove packages that are required/essential and always installed on >+ # a Debian system. Debian packages should not have unversioned >+ # dependencies on such packages. >+ foreach my $line (@temp) { >+ if ( $line ne "perl-base" ) { >+ @lines = ( @lines, $line ); >+ } >+ } >+ if ( exists $overrides{$module} ) { >+ print "$overrides{$module}\n"; >+ } >+ elsif ( scalar(@lines) == 1 && $lines[0] ne "" ) { >+ my $pkg = $lines[0]; >+ print "$pkg\n"; >+ } >+ elsif ( scalar(@lines) > 1 ) { >+ foreach my $pkg (@lines) { >+ print " | " if ( $pkg ne $lines[0] ); >+ print "$pkg"; >+ print " | $pkg" . "-5.22" if ( $pkg eq "perl-modules" ); >+ print " | $pkg" . "-5.24" if ( $pkg eq "perl-modules" ); >+ } >+ print "\n"; >+ } >+ elsif ( scalar(@temp) != 0 ) { > >- # I'm an Essential and I'm OK, >- # I install all night, and work all day. >- # I chomp up strings. I eat my bugs. >- # I go to the base install. >- # On Fridays I go drinking, >- # and have buttered commits for git. >- # (Beer O'Clock is more than two hours >- # away. I don't even drink beer. There >- # is no reason to be suspicious of this >- # commit.) >- # RM note: suspicious? me? always! >- } >- elsif ( ! $deps->{$module}->{'required'} ) { >- # Ignore because we don't have it and we don't care. >- } >- else { >- print "EEEK: unknown package for $module\n"; >+ # I'm an Essential and I'm OK, >+ # I install all night, and work all day. >+ # I chomp up strings. I eat my bugs. >+ # I go to the base install. >+ # On Fridays I go drinking, >+ # and have buttered commits for git. >+ # (Beer O'Clock is more than two hours >+ # away. I don't even drink beer. There >+ # is no reason to be suspicious of this >+ # commit.) >+ # RM note: suspicious? me? always! >+ } >+ elsif ( $type ne 'requires' ) { >+ # Ignore because we don't have it and we don't care. >+ } >+ else { >+ print "EEEK: unknown package for $module\n"; >+ } >+ } > } > } >diff --git a/installer/install.pl b/installer/install.pl >index ac432148ed..e1fbd24e2f 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -30,6 +30,7 @@ use C4::Output; > use C4::Templates; > use C4::Languages qw(getAllLanguages getTranslatedLanguages); > use C4::Installer; >+use C4::Installer::PerlModules; > > use Koha; > >diff --git a/t/Installer_PerlDependencies.t b/t/Installer_PerlDependencies.t >deleted file mode 100755 >index 45dc1f1659..0000000000 >--- a/t/Installer_PerlDependencies.t >+++ /dev/null >@@ -1,14 +0,0 @@ >-#!/usr/bin/perl >-# >-# This Koha test module is a stub! >-# Add more tests here!!! >- >-use strict; >-use warnings; >- >-use Test::More tests => 1; >- >-BEGIN { >- use_ok('C4::Installer::PerlDependencies'); >-} >- >diff --git a/t/Installer_PerlModules.t b/t/Installer_PerlModules.t >index dad968fed6..ea1002b9bb 100755 >--- a/t/Installer_PerlModules.t >+++ b/t/Installer_PerlModules.t >@@ -5,58 +5,18 @@ > > use Modern::Perl; > >-use Test::More tests => 22; >+use Test::More tests => 6; > > BEGIN { > use_ok('C4::Installer::PerlModules'); > } > >-$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::Upgraded'} = { >- 'required' => '1', >- 'min_ver' => '0.9.3', >- 'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", >-}; >-$Local::Module::Upgraded::VERSION = '0.9.13'; >-$INC{"Local/Module/Upgraded.pm"} = 1; >-use_ok("Local::Module::Upgraded"); >- >-$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::NotUpgraded'} = { >- 'required' => '1', >- 'min_ver' => '0.9.3', >- 'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", >-}; >-$Local::Module::NotUpgraded::VERSION = '0.9.1'; >-$INC{"Local/Module/NotUpgraded.pm"} = 1; >-use_ok("Local::Module::NotUpgraded"); >- > my $modules; > ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); > my $prereq_pm = $modules->prereq_pm(); > ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run'); > ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' ); > ok (exists($prereq_pm->{"YAML"}), 'YAML required for installer to run'); >-is ($modules->required('module'=>"DBI"),1, 'DBI should return 1 since required'); >-is ($modules->required('module'=>"thisdoesn'texist"),-1, 'string should return -1 since not in hash'); >-my $required = $modules->required('required'=>1); >-my %params = map { $_ => 1 } @$required; >-ok (exists($params{"DBI"}), 'DBI required for installer to run'); >-my $optional = $modules->required('optional'=>1); >-%params = map { $_ => 1 } @$optional; >-ok (exists($params{"Test::Strict"}), 'test::strict optional for installer to run'); >-is ($optional = $modules->required('spaghetti'=>1),-1, '-1 returned when parsing in unknown parameter'); >-my $version_info = $modules->version_info('DBI'); >-ok (exists($version_info->{"required"}), 'required exists'); >-ok (exists($version_info->{"upgrade"}), 'upgrade exists'); >-is ($modules->version_info("thisdoesn'texist"),-1, 'thisdoesntexist should return -1'); >-ok ($modules->module_count() >10 , 'count should be greater than 10'); >-my @module_list = $modules->module_list; >-%params = map { $_ => 1 } @module_list; >-ok (exists($params{"DBI"}), 'DBI exists in array'); >-is ($modules->required('module'=>"String::Random"),1, 'String::Random should return 1 since required'); >-is ($modules->version_info(), -1, "Testing empty modules"); >- >-is($modules->version_info("Local::Module::Upgraded")->{"upgrade"},0,"Version 0.9.13 is greater than 0.9.3, so no upgrade needed"); >-is($modules->version_info("Local::Module::NotUpgraded")->{"upgrade"},1,"Version 0.9.1 is smaller than 0.9.1, so no upgrade needed"); > > subtest 'versions_info' => sub { > plan tests => 4; >diff --git a/t/Installer_pm.t b/t/Installer_pm.t >index 73781724fb..0ed28ee0e5 100755 >--- a/t/Installer_pm.t >+++ b/t/Installer_pm.t >@@ -3,7 +3,7 @@ > use strict; > use warnings; > >-use Test::More tests => 4; >+use Test::More tests => 2; > use Data::Dumper; > > BEGIN { >@@ -13,13 +13,3 @@ BEGIN { > my $obj = C4::Installer::PerlModules->new; > > isa_ok($obj,'C4::Installer::PerlModules'); >- >-my $module_info = $obj->version_info('Test::More'); >- >-my $control = $Test::More::VERSION; >- >-like($module_info->{cur_ver}, qr/\d/, 'returns numeric version'); >- >-is($module_info->{cur_ver}, $control, 'returns correct version'); >- >- >-- >2.11.0
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 19735
:
69465
|
69466
|
73837
|
73838
|
81612
|
97484
|
97485
|
98568
|
98569
|
98570
|
98576
|
98577
|
98636
|
98637
|
98638
|
98639
|
98640
|
98743
|
98744
|
98745
|
98746
|
98747
|
98748