From a20b6896b3803ad6e9e8b08518799a0e599436f9 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 10 Sep 2010 16:08:30 +0000 Subject: [PATCH] Enable Class::DBI::Frozen::301 use for offline transaction management Most modern systems will install Class::DBI::Frozen::301 to avoid conflicts with incompatible Class::DBI packages. We need to teach offline.pl how to use Class::DBI::Frozen::301 if it is available. Note that we're using "use parent" instead of "use base" per the recommendation of "perldoc base"; accordingly, we're adding the system prerequisite for the parent pragma. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17575 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/Makefile.install | 2 ++ Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 7df8e18af..3011e59f7 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -91,6 +91,7 @@ DEBS = \ libnet-server-perl\ libnspr4-dev\ libole-storage-lite-perl\ + libparent-perl libpq-dev\ libreadline5-dev\ libspreadsheet-writeexcel-perl\ @@ -162,6 +163,7 @@ FEDORA_13_RPMS = \ mod_ssl \ ncurses-devel \ ncurses-libs \ + perl-parent \ perl-Business-CreditCard \ perl-Business-ISBN \ perl-Business-ISBN-Data \ diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm b/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm index abb50a32f..ec8448acd 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm @@ -1,6 +1,15 @@ package OpenILS::Utils::OfflineStore; use strict; use warnings; -use base 'Class::DBI'; + +use UNIVERSAL::require; +if ('Class::DBI::Frozen::301'->use) { + use parent 'Class::DBI::Frozen::301'; +} elsif ('Class::DBI'->use) { + use parent 'Class::DBI'; +} else { + die $@; +} + use DBI; use OpenSRF::Utils::Config; -- 2.11.0