[open-ils-commits] r17575 - in trunk/Open-ILS/src: extras perlmods/OpenILS/Utils (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 10 12:08:33 EDT 2010


Author: dbs
Date: 2010-09-10 12:08:30 -0400 (Fri, 10 Sep 2010)
New Revision: 17575

Modified:
   trunk/Open-ILS/src/extras/Makefile.install
   trunk/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm
Log:
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.


Modified: trunk/Open-ILS/src/extras/Makefile.install
===================================================================
--- trunk/Open-ILS/src/extras/Makefile.install	2010-09-10 16:04:51 UTC (rev 17574)
+++ trunk/Open-ILS/src/extras/Makefile.install	2010-09-10 16:08:30 UTC (rev 17575)
@@ -91,6 +91,7 @@
 	libnet-server-perl\
 	libnspr4-dev\
 	libole-storage-lite-perl\
+	libparent-perl
 	libpq-dev\
 	libreadline5-dev\
 	libspreadsheet-writeexcel-perl\
@@ -162,6 +163,7 @@
 	mod_ssl \
 	ncurses-devel \
 	ncurses-libs \
+	perl-parent \
 	perl-Business-CreditCard \
 	perl-Business-ISBN \
 	perl-Business-ISBN-Data \

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm	2010-09-10 16:04:51 UTC (rev 17574)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm	2010-09-10 16:08:30 UTC (rev 17575)
@@ -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;
 



More information about the open-ils-commits mailing list