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 in1c2c7c6cb3
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 in1c2c7c6cb3
, 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.
This commit is contained in:
parent
bea3d64a73
commit
23bdba61b1
|
@ -66,6 +66,7 @@ rootprefix_default = split_usr ? '/' : '/usr'
|
||||||
if rootprefixdir == ''
|
if rootprefixdir == ''
|
||||||
rootprefixdir = rootprefix_default
|
rootprefixdir = rootprefix_default
|
||||||
endif
|
endif
|
||||||
|
rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
|
||||||
|
|
||||||
sysvinit_path = get_option('sysvinit-path')
|
sysvinit_path = get_option('sysvinit-path')
|
||||||
sysvrcnd_path = get_option('sysvrcnd-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.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
|
||||||
conf.set('HIGH_RLIMIT_NOFILE', 512*1024)
|
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
|
# encountered, so this should canonicalize various paths when they are
|
||||||
# absolute or relative.
|
# absolute or relative.
|
||||||
prefixdir = get_option('prefix')
|
prefixdir = get_option('prefix')
|
||||||
|
@ -235,6 +236,7 @@ conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_
|
||||||
|
|
||||||
substs.set('prefix', prefixdir)
|
substs.set('prefix', prefixdir)
|
||||||
substs.set('rootprefix', rootprefixdir)
|
substs.set('rootprefix', rootprefixdir)
|
||||||
|
substs.set('rootprefix_noslash', rootprefixdir_noslash)
|
||||||
substs.set('exec_prefix', prefixdir)
|
substs.set('exec_prefix', prefixdir)
|
||||||
substs.set('libdir', libdir)
|
substs.set('libdir', libdir)
|
||||||
substs.set('rootlibdir', rootlibdir)
|
substs.set('rootlibdir', rootlibdir)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
prefix=@prefix@
|
prefix=@prefix@
|
||||||
rootprefix=@rootprefix@
|
rootprefix=@rootprefix_noslash@
|
||||||
sysconfdir=@sysconfdir@
|
sysconfdir=@sysconfdir@
|
||||||
systemdutildir=${rootprefix}/lib/systemd
|
systemdutildir=${rootprefix}/lib/systemd
|
||||||
systemdsystemunitdir=${rootprefix}/lib/systemd/system
|
systemdsystemunitdir=${rootprefix}/lib/systemd/system
|
||||||
|
|
Loading…
Reference in New Issue