From 4af05398af9f96ed30a7102428cd1071b6fbafec Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 12 Apr 2017 14:18:15 +0100 Subject: [PATCH] trivial: Define the plugindir in one central place --- src/Makefile.am | 1 + src/fu-main.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index d4110f830..e28420878 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,6 +25,7 @@ AM_CPPFLAGS = \ -DVERSION="\"$(VERSION)\"" \ -DDAEMON_USER="\"$(daemon_user)\"" \ -DTESTDATADIR=\""$(top_srcdir)/data/tests"\" \ + -DPLUGINDIR=\""$(libdir)/fwupd-plugins-2"\" \ -DG_UDEV_API_IS_SUBJECT_TO_CHANGE \ -DLOCALEDIR=\""$(localedir)"\" diff --git a/src/fu-main.c b/src/fu-main.c index 62b27798f..654634870 100644 --- a/src/fu-main.c +++ b/src/fu-main.c @@ -2622,12 +2622,10 @@ static gboolean fu_main_load_plugins (FuMainPrivate *priv, GError **error) { const gchar *fn; - g_autofree gchar *plugin_dir = NULL; g_autoptr(GDir) dir = NULL; /* search */ - plugin_dir = g_build_filename (LIBDIR, "fwupd-plugins-2", NULL); - dir = g_dir_open (plugin_dir, 0, error); + dir = g_dir_open (PLUGINDIR, 0, error); if (dir == NULL) return FALSE; while ((fn = g_dir_read_name (dir)) != NULL) { @@ -2640,7 +2638,7 @@ fu_main_load_plugins (FuMainPrivate *priv, GError **error) continue; /* open module */ - filename = g_build_filename (plugin_dir, fn, NULL); + filename = g_build_filename (PLUGINDIR, fn, NULL); plugin = fu_plugin_new (); fu_plugin_set_usb_context (plugin, priv->usb_ctx); g_debug ("adding plugin %s", filename);