Enable Class::DBI::Frozen::301 use for offline transaction management
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Sep 2010 16:08:30 +0000 (16:08 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Sep 2010 16:08:30 +0000 (16:08 +0000)
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
Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm

index 7df8e18..3011e59 100644 (file)
@@ -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 \
index abb50a3..ec8448a 100644 (file)
@@ -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;