mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
meson: Correctly validate that prefix is a child of rootprefix
In commit d895e10a
a test was introduced to validate that prefix is a
child of rootprefix. However, it only works when rootprefix is "/".
Since the test is ignored when rootprefix is equal to prefix, this is
only noticed if specifying both -Drootprefix= and -Dprefix=, e.g.:
$ meson foo -Drootprefix=/foo -Dprefix=/foo/bar
meson.build:111:8: ERROR: Problem encountered: Prefix is not below
root prefix (now rootprefix=/foo prefix=/foo/bar)
This commit is contained in:
parent
4e95bc56df
commit
b2d7487071
@ -107,7 +107,7 @@ prefixdir = get_option('prefix')
|
||||
if not prefixdir.startswith('/')
|
||||
error('Prefix is not absolute: "@0@"'.format(prefixdir))
|
||||
endif
|
||||
if prefixdir != rootprefixdir and not prefixdir.startswith(rootprefixdir.strip('/') + '/')
|
||||
if prefixdir != rootprefixdir and rootprefixdir != '/' and not prefixdir.strip('/').startswith(rootprefixdir.strip('/') + '/')
|
||||
error('Prefix is not below root prefix (now rootprefix=@0@ prefix=@1@)'.format(
|
||||
rootprefixdir, prefixdir))
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user