From: dbs Date: Fri, 25 Jun 2010 03:54:46 +0000 (+0000) Subject: Provide support for Class::DBI::Frozen::301 via UNIVERSAL::require X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d252b2d019d00068efc8277447120704a5a4fa3e;p=evergreen%2Fpines.git Provide support for Class::DBI::Frozen::301 via UNIVERSAL::require Class::DBI changed its API interfaces after the 3.0.1 release, causing much pain (and incompatibility for existing applications like Evergreen). Some distributions package Class::DBI 0.96 or 3.0.1, but newer distributions package an incompatible 3.0.17. An alternative is to install the Class::DBI::Frozen::301 module from source; UNIVERSAL::require enables us to try loading both and use whichever one we find. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16811 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 7aab6a93de..cdd6ce62bc 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -167,10 +167,10 @@ FEDORA_13_RPMS = \ libssh2-devel \ libyaz \ libyaz-devel \ + mod_ssl \ ncurses-devel \ ncurses-libs \ perl-Business-CreditCard \ - perl-Class-DBI-Pg \ perl-Email-Send \ perl-GDGraph3d \ perl-MARC-Record \ @@ -190,7 +190,8 @@ FEDORA_13_RPMS = \ # Should be fixed in 3.22 FEDORA_13_CPAN = \ Business::OnlinePayment \ - Business::OnlinePayment::AuthorizeNet + Business::OnlinePayment::AuthorizeNet \ + Class::DBI::Frozen::301 PGSQL_84_RPMS = \ postgresql-8.4* \ diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm index a35d505873..fdf915b127 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm @@ -1,6 +1,9 @@ package OpenILS::Application::Storage::CDBI; +use UNIVERSAL::require; +BEGIN { + 'Class::DBI::Frozen::301'->use or 'Class::DBI'->use or die $@; +} use base qw/Class::DBI/; -use Class::DBI; use Class::DBI::AbstractSearch; use OpenILS::Application::Storage::CDBI::actor; @@ -23,8 +26,8 @@ our $VERSION = 1; my $log = 'OpenSRF::Utils::Logger'; if ($Class::DBI::VERSION gt '3.0.1') { - $log->error("Your version of Class::DBI, $Class::DBI::VERSION, is too new and incompatable with Evergreen. You will need to downgrade to version 3.0.1"); - die("Your version of Class::DBI, $Class::DBI::VERSION, is too new and incompatable with Evergreen. You will need to downgrade to version 3.0.1"); + $log->error("Your version of Class::DBI, $Class::DBI::VERSION, is too new and incompatible with Evergreen. You will need to downgrade to version 3.0.1 or install Class::DBI::Frozen::301"); + die("Your version of Class::DBI, $Class::DBI::VERSION, is too new and incompatible with Evergreen. You will need to downgrade to version 3.0.1 or install Class::DBI::Frozen::301"); } sub child_init { diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm index 565f2da366..8fd85155d3 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm @@ -14,7 +14,10 @@ use OpenILS::Application::Storage::Driver::Pg::fts; use OpenILS::Application::Storage::Driver::Pg::storage; use OpenILS::Application::Storage::Driver::Pg::dbi; - use Class::DBI; + use UNIVERSAL::require; + BEGIN { + 'Class::DBI::Frozen::301'->use or 'Class::DBI'->use or die $@; + } use base qw/Class::DBI OpenILS::Application::Storage/; use DBI; use OpenSRF::EX qw/:try/; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/cdbi.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/cdbi.pm index 196ba39538..20d88c5662 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/cdbi.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/cdbi.pm @@ -1,7 +1,10 @@ { # Based on the change to Class::DBI in OpenILS::Application::Storage. This will # allow us to use TSearch2 via a simple cdbi "search" interface. #------------------------------------------------------------------------------- - use Class::DBI; + use UNIVERSAL::require; + BEGIN { + 'Class::DBI::Frozen::301'->use or 'Class::DBI'->use or die $@; + } package Class::DBI; sub search_fts { diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm index f881a22f1d..eb1a97f9af 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm @@ -237,7 +237,10 @@ sub sql_where_clause { } #------------------------------------------------------------------------------- -use Class::DBI; +use UNIVERSAL::require; +BEGIN { + 'Class::DBI::Frozen::301'->use or 'Class::DBI'->use or die $@; +} package Class::DBI;