chiark / gitweb /
Remove /sbin from paths if split-bin is false (#8324)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Mar 2018 20:48:36 +0000 (21:48 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:59:11 +0000 (07:59 +0200)
Follow-up for 157baa87e4.

meson.build
src/basic/path-util.h

index a10499131f6c38cf8dea6488e64bc1a5e994ebe7..163e27b129e20f0554685164deef60b1e0d15d7e 100644 (file)
@@ -75,13 +75,16 @@ if get_option('split-usr') == 'auto'
 else
         split_usr = get_option('split-usr') == 'true'
 endif
-conf.set10('HAVE_SPLIT_USR', split_usr)
+conf.set10('HAVE_SPLIT_USR', split_usr,
+           description : '/usr/bin and /bin directories are separate')
 
 if get_option('split-bin') == 'auto'
         split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
 else
         split_bin = get_option('split-bin') == 'true'
 endif
+conf.set10('HAVE_SPLIT_BIN', split_bin,
+           description : 'bin and sbin directories are separate')
 
 rootprefixdir = get_option('rootprefix')
 # Unusual rootprefixdir values are used by some distros
index 9faa128e3747fa3b48140cf04c2a8589efe43604..38cd89e32ad1cb1ac1200a13e1a08e25792b5dca 100644 (file)
 #include "string-util.h"
 #include "time-util.h"
 
-#define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
-#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin"
+#if HAVE_SPLIT_BIN
+#  define PATH_SBIN_BIN(x) x "sbin:" x "bin"
+#else
+#  define PATH_SBIN_BIN(x) x "bin"
+#endif
+
+#define DEFAULT_PATH_NORMAL PATH_SBIN_BIN("/usr/local/") ":" PATH_SBIN_BIN("/usr/")
+#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":" PATH_SBIN_BIN("/")
 
 #if HAVE_SPLIT_USR
 #  define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR