mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-04 05:26:58 +00:00
trivial: Don't assume that plugins end in .so
This commit is contained in:
parent
89a9e245f9
commit
00d6f4734f
@ -4373,6 +4373,7 @@ fu_engine_load_plugins (FuEngine *self, GError **error)
|
||||
const gchar *fn;
|
||||
g_autoptr(GDir) dir = NULL;
|
||||
g_autofree gchar *plugin_path = NULL;
|
||||
g_autofree gchar *suffix = g_strdup_printf (".%s", G_MODULE_SUFFIX);
|
||||
|
||||
/* search */
|
||||
plugin_path = fu_common_get_path (FU_PATH_KIND_PLUGINDIR_PKG);
|
||||
@ -4386,7 +4387,7 @@ fu_engine_load_plugins (FuEngine *self, GError **error)
|
||||
g_autoptr(GError) error_local = NULL;
|
||||
|
||||
/* ignore non-plugins */
|
||||
if (!g_str_has_suffix (fn, ".so"))
|
||||
if (!g_str_has_suffix (fn, suffix))
|
||||
continue;
|
||||
|
||||
/* is blacklisted */
|
||||
|
@ -1192,7 +1192,7 @@ fu_engine_history_func (void)
|
||||
fu_engine_set_silo (engine, silo_empty);
|
||||
|
||||
/* set up dummy plugin */
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
fu_engine_add_plugin (engine, plugin);
|
||||
@ -1322,7 +1322,7 @@ fu_engine_history_inherit (void)
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv ("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
fu_engine_add_plugin (engine, plugin);
|
||||
@ -1432,7 +1432,7 @@ fu_engine_history_error_func (void)
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv ("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
fu_engine_add_plugin (engine, plugin);
|
||||
@ -2271,7 +2271,7 @@ fu_plugin_hash_func (void)
|
||||
|
||||
/* create a tainted plugin */
|
||||
g_setenv ("FWUPD_PLUGIN_TEST", "build-hash", TRUE);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* make sure it tainted now */
|
||||
@ -2304,7 +2304,7 @@ fu_plugin_module_func (void)
|
||||
/* create a fake device */
|
||||
plugin = fu_plugin_new ();
|
||||
g_setenv ("FWUPD_PLUGIN_TEST", "registration", TRUE);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
ret = fu_plugin_runner_startup (plugin, &error);
|
||||
@ -3141,7 +3141,7 @@ fu_plugin_composite_func (void)
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv ("FWUPD_PLUGIN_TEST", "composite", TRUE);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test.so", &error);
|
||||
ret = fu_plugin_open (plugin, PLUGINBUILDDIR "/libfu_plugin_test." G_MODULE_SUFFIX, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_true (ret);
|
||||
fu_engine_add_plugin (engine, plugin);
|
||||
|
Loading…
Reference in New Issue
Block a user