summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-05 16:46:52 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-05 18:49:28 +0100
commit23bdba61b10963878b45a485e0e3c1963a8d2ea8 (patch)
tree95b2732f852315d92057b04ec354991f40bb3905
parentbea3d64a73bb9313feed01b6ba9038dab04b9953 (diff)
downloadsystemd-23bdba61b10963878b45a485e0e3c1963a8d2ea8.tar.gz
systemd-23bdba61b10963878b45a485e0e3c1963a8d2ea8.tar.bz2
systemd-23bdba61b10963878b45a485e0e3c1963a8d2ea8.zip
pkgconfig: avoid double slash with split-usr configuration
By defining rootprefix= we avoid a double slash in $systemdsystemunitdir and other variables. This fixes a regression introduced in 1c2c7c6cb3d92315624f3711114e86b0acfbce63 where the variables using rootprefix=/ would start with a double slash. This should be interpreted the same, but is certainly ugly. The rootprefix variable was added to systemd.pc in 1c2c7c6cb3d92315624f3711114e86b0acfbce63, so there is no question of backwards compatiblity. If people try to "override" the prefix and specify --define-variable=rootprefix=/, they will get a double slash, which should be OK, and is the same as --define-variable=rootprefix=/something/, which also results in a double slash somewhere in the strings.
-rw-r--r--meson.build4
-rw-r--r--src/core/systemd.pc.in2
2 files changed, 4 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index f2b975abc5..23a606fb90 100644
--- a/meson.build
+++ b/meson.build
@@ -66,6 +66,7 @@ rootprefix_default = split_usr ? '/' : '/usr'
if rootprefixdir == ''
rootprefixdir = rootprefix_default
endif
+rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
sysvinit_path = get_option('sysvinit-path')
sysvrcnd_path = get_option('sysvrcnd-path')
@@ -76,7 +77,7 @@ conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
conf.set('HIGH_RLIMIT_NOFILE', 512*1024)
-# join_paths ignore the preceding arguments if an absolute component is
+# join_paths ignores the preceding arguments if an absolute component is
# encountered, so this should canonicalize various paths when they are
# absolute or relative.
prefixdir = get_option('prefix')
@@ -235,6 +236,7 @@ conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_
substs.set('prefix', prefixdir)
substs.set('rootprefix', rootprefixdir)
+substs.set('rootprefix_noslash', rootprefixdir_noslash)
substs.set('exec_prefix', prefixdir)
substs.set('libdir', libdir)
substs.set('rootlibdir', rootlibdir)
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
index f6a9d30ab5..5d1ddd7620 100644
--- a/src/core/systemd.pc.in
+++ b/src/core/systemd.pc.in
@@ -8,7 +8,7 @@
# (at your option) any later version.
prefix=@prefix@
-rootprefix=@rootprefix@
+rootprefix=@rootprefix_noslash@
sysconfdir=@sysconfdir@
systemdutildir=${rootprefix}/lib/systemd
systemdsystemunitdir=${rootprefix}/lib/systemd/system