From ddfb084a8d939a01b7b3f539ec74a58ef06b54a5 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 29 Jul 2018 14:56:19 +0200 Subject: [PATCH] Bugfix: also recognize plugins when the main binary is installed in a different place than the libs. --- src/db/db/dbInit.cc | 14 ++++++++------ src/db/db/dbStream.cc | 6 ------ src/lay/lay/layInit.cc | 14 ++++++++------ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/db/db/dbInit.cc b/src/db/db/dbInit.cc index 6e3781ab9..273f9913c 100644 --- a/src/db/db/dbInit.cc +++ b/src/db/db/dbInit.cc @@ -98,11 +98,11 @@ static PluginDescriptor load_plugin (const std::string &pp) void init (const std::vector &_paths) { std::vector paths = _paths; - if (paths.empty ()) { - std::string module_path = tl::get_module_path ((void *) &init); - if (! module_path.empty ()) { - paths.push_back (tl::absolute_path (module_path)); - } + + // add the module path so we also look beside the "db" library + std::string module_path = tl::get_module_path ((void *) &init); + if (! module_path.empty ()) { + paths.push_back (tl::absolute_path (module_path)); } if (paths.empty ()) { @@ -119,7 +119,9 @@ void init (const std::vector &_paths) const char *db_plugin_dir = "db_plugins"; std::string pp = tl::combine_path (*p, db_plugin_dir); - tl::log << tl::sprintf (tl::to_string (tr ("Scanning '%s' for plugins ..")), pp); + if (tl::verbosity () >= 20) { + tl::info << "Scanning for db plugins: " << pp; + } std::vector ee = tl::dir_entries (pp, true, false); diff --git a/src/db/db/dbStream.cc b/src/db/db/dbStream.cc index 59f9df92a..b4861e761 100644 --- a/src/db/db/dbStream.cc +++ b/src/db/db/dbStream.cc @@ -51,9 +51,6 @@ tl::XMLElementList load_options_xml_element_list () } } - // ignore all unknown elements - elements.append (tl::make_member ("*")); - return elements; } @@ -68,9 +65,6 @@ tl::XMLElementList save_options_xml_element_list () } } - // ignore all unknown elements - elements.append (tl::make_member ("*")); - return elements; } diff --git a/src/lay/lay/layInit.cc b/src/lay/lay/layInit.cc index 1c51777a6..b6c8facf4 100644 --- a/src/lay/lay/layInit.cc +++ b/src/lay/lay/layInit.cc @@ -99,11 +99,11 @@ void load_plugin (const std::string &pp) void init (const std::vector &_paths) { std::vector paths = _paths; - if (paths.empty ()) { - std::string module_path = tl::get_module_path ((void *) &init); - if (! module_path.empty ()) { - paths.push_back (module_path); - } + + // add the module path so we also look beside the "db" library + std::string module_path = tl::get_module_path ((void *) &init); + if (! module_path.empty ()) { + paths.push_back (tl::absolute_path (module_path)); } if (paths.empty ()) { @@ -120,7 +120,9 @@ void init (const std::vector &_paths) const char *lay_plugin_dir = "lay_plugins"; std::string pp = tl::combine_path (*p, lay_plugin_dir); - tl::log << tl::sprintf (tl::to_string (tr ("Scanning '%s' for plugins ..")), pp); + if (tl::verbosity () >= 20) { + tl::info << "Scanning for lay plugins: " << pp; + } std::vector ee = tl::dir_entries (pp, true, false);