[dbus PATCH] meson: fix construction of data directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to use prefix for all directories and there is no need to check
if the user provided path starts with '/' as that is done automatically
by the join_paths() function or '/' operator.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 meson.build | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/meson.build b/meson.build
index 472e4e2..b293b8c 100644
--- a/meson.build
+++ b/meson.build
@@ -9,12 +9,30 @@ project(
     ],
 )
 
+prefix = get_option('prefix')
+datadir = prefix / get_option('datadir')
+sbindir = prefix / get_option('sbindir')
+
+opt_dirs = [
+    'dbus_interfaces',
+    'dbus_services',
+    'dbus_system_services',
+    'dbus_system_policies',
+    'polkit_rules',
+]
+
+foreach opt_dir : opt_dirs
+    value = get_option(opt_dir)
+    varname = '@0@_dir'.format(opt_dir)
+    set_variable(varname, datadir / value)
+endforeach
+
 conf = configuration_data()
 conf.set('MESON_VERSION', '0.49.0')
 conf.set('PACKAGE', meson.project_name())
 conf.set('VERSION', meson.project_version())
 conf.set('build_root', meson.build_root())
-conf.set('sbindir', get_option('sbindir'))
+conf.set('sbindir', sbindir)
 conf.set('source_root', meson.source_root())
 
 
@@ -40,24 +58,6 @@ git = run_command('test', '-d', '.git').returncode() == 0
 
 conf.set('SYSTEM_USER', get_option('system_user'))
 
-opt_dirs = [
-    'dbus_interfaces',
-    'dbus_services',
-    'dbus_system_services',
-    'dbus_system_policies',
-    'polkit_rules',
-]
-
-foreach opt_dir : opt_dirs
-    value = get_option(opt_dir)
-    varname = '@0@_dir'.format(opt_dir)
-    if opt_dir.startswith('/')
-        set_variable(varname, value)
-    else
-        set_variable(varname, join_paths(get_option('datadir'), value))
-    endif
-endforeach
-
 
 # Compile flags
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux