[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. e411c1cf41cdcd138a5163dc5361fe6d13d5e1aa

Evergreen Git git at git.evergreen-ils.org
Wed Oct 23 10:35:07 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_4 has been updated
       via  e411c1cf41cdcd138a5163dc5361fe6d13d5e1aa (commit)
      from  e0d535c28fe023698dd7bc268677286c84737454 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e411c1cf41cdcd138a5163dc5361fe6d13d5e1aa
Author: Jason Stephenson <jason at sigio.com>
Date:   Sun Jul 7 07:18:01 2019 -0400

    Lp 1835620: Require some Storage submodules instead of use them
    
    Switch from "use" to "require" for submodules in OpenILS::Application
    ::Storage::CDBI and OpenILS::Application::Storage::Driver::Pg.
    Circular dependencies and other issues cause the following errors at
    compile time for those modules:
    
    Compilation failed in require at
    /usr/local/share/perl/5.28.1/OpenILS/Application/Storage/CDBI.pm line
    9.
    
    Compilation failed in require at
    /usr/local/share/perl/5.26.1/OpenILS/Application/Storage/Driver/Pg.pm
    line 15.
    
    Require loads the submodules at run time and does not attempt to
    import any methods.  This is the behavior we want, eliminates the
    above errors, and everything still works.
    
    Add comments above the required modules explaining why require is
    needed and not use.
    
    Enable and reorder all of the tests in Open-ILS/src/perlmods/t/
    09-OpenILS-Application-Storage-Driver.t.  Repairing the above issue
    also repairs these tests.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jason Boyer <jboyer at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm
index d164251ad6..ac5779494d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm
@@ -6,18 +6,22 @@ BEGIN {
 use base qw/Class::DBI/;
 use Class::DBI::AbstractSearch;
 
-use OpenILS::Application::Storage::CDBI::actor;
-use OpenILS::Application::Storage::CDBI::action;
-use OpenILS::Application::Storage::CDBI::booking;
-use OpenILS::Application::Storage::CDBI::asset;
-use OpenILS::Application::Storage::CDBI::serial;
-use OpenILS::Application::Storage::CDBI::authority;
-use OpenILS::Application::Storage::CDBI::biblio;
-use OpenILS::Application::Storage::CDBI::config;
-use OpenILS::Application::Storage::CDBI::metabib;
-use OpenILS::Application::Storage::CDBI::money;
-use OpenILS::Application::Storage::CDBI::permission;
-use OpenILS::Application::Storage::CDBI::container;
+# The following modules add, or use, subroutines in modules that are
+# not available when this module is compiled.  We therefore "require"
+# these modules rather than "use" them.  Everything is available at
+# run time.
+require OpenILS::Application::Storage::CDBI::actor;
+require OpenILS::Application::Storage::CDBI::action;
+require OpenILS::Application::Storage::CDBI::booking;
+require OpenILS::Application::Storage::CDBI::asset;
+require OpenILS::Application::Storage::CDBI::serial;
+require OpenILS::Application::Storage::CDBI::authority;
+require OpenILS::Application::Storage::CDBI::biblio;
+require OpenILS::Application::Storage::CDBI::config;
+require OpenILS::Application::Storage::CDBI::metabib;
+require OpenILS::Application::Storage::CDBI::money;
+require OpenILS::Application::Storage::CDBI::permission;
+require OpenILS::Application::Storage::CDBI::container;
 
 use OpenSRF::Utils::JSON;
 use OpenSRF::Utils::Logger qw(:level);
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg.pm
index 3a645953a4..6105d7ae50 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg.pm
@@ -10,10 +10,15 @@
   # OpenILS::Application::Storage.
   #-------------------------------------------------------------------------------
     package OpenILS::Application::Storage::Driver::Pg;
-    use OpenILS::Application::Storage::Driver::Pg::cdbi;
-    use OpenILS::Application::Storage::Driver::Pg::fts;
-    use OpenILS::Application::Storage::Driver::Pg::storage;
-    use OpenILS::Application::Storage::Driver::Pg::dbi;
+    # The following modules add, or use, subroutines in modules that
+    # are not available when this module is compiled.  We therefore
+    # "require" these modules rather than "use" them.  Everything is
+    # available at run time.
+    require OpenILS::Application::Storage::Driver::Pg::cdbi;
+    require OpenILS::Application::Storage::Driver::Pg::fts;
+    require OpenILS::Application::Storage::Driver::Pg::storage;
+    require OpenILS::Application::Storage::Driver::Pg::dbi;
+
     use UNIVERSAL::require; 
     BEGIN {                 
         'Class::DBI::Frozen::301'->use or 'Class::DBI'->use or die $@;
diff --git a/Open-ILS/src/perlmods/t/09-OpenILS-Application-Storage-Driver.t b/Open-ILS/src/perlmods/t/09-OpenILS-Application-Storage-Driver.t
index 9e93ade705..4ccba01bf9 100644
--- a/Open-ILS/src/perlmods/t/09-OpenILS-Application-Storage-Driver.t
+++ b/Open-ILS/src/perlmods/t/09-OpenILS-Application-Storage-Driver.t
@@ -1,12 +1,10 @@
 #!perl -T
 
-use Test::More tests => 3;
+use Test::More tests => 6;
 
+use_ok( 'OpenILS::Application::Storage::Driver::Pg' );
 use_ok( 'OpenILS::Application::Storage::Driver::Pg::cdbi' );
 use_ok( 'OpenILS::Application::Storage::Driver::Pg::fts' );
+use_ok( 'OpenILS::Application::Storage::Driver::Pg::storage' );
+use_ok( 'OpenILS::Application::Storage::Driver::Pg::dbi' );
 use_ok( 'OpenILS::Application::Storage::Driver::Pg::QueryParser' );
-
-# These modules are not meant to be loaded as a normal Perl module
-# use_ok( 'OpenILS::Application::Storage::Driver::Pg' );
-# use_ok( 'OpenILS::Application::Storage::Driver::Pg::dbi' );
-# use_ok( 'OpenILS::Application::Storage::Driver::Pg::storage' );

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Storage/CDBI.pm        | 28 ++++++++++++----------
 .../lib/OpenILS/Application/Storage/Driver/Pg.pm   | 13 ++++++----
 .../t/09-OpenILS-Application-Storage-Driver.t      | 10 ++++----
 3 files changed, 29 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list