meson: use warning() method

This bumps the required minimum version of meson to 0.44, as
`warning()` method is supported since 0.44.
This commit is contained in:
Yu Watanabe 2018-05-10 14:50:52 +09:00
parent 30a4ddff7f
commit 8ea9fad715

View file

@ -11,7 +11,7 @@ project('systemd', 'c',
'sysconfdir=/etc', 'sysconfdir=/etc',
'localstatedir=/var', 'localstatedir=/var',
], ],
meson_version : '>= 0.43', meson_version : '>= 0.44',
) )
libsystemd_version = '0.22.0' libsystemd_version = '0.22.0'
@ -680,18 +680,18 @@ getent_result = run_command('getent', 'passwd', '65534')
if getent_result.returncode() == 0 if getent_result.returncode() == 0
name = getent_result.stdout().split(':')[0] name = getent_result.stdout().split(':')[0]
if name != nobody_user if name != nobody_user
message('WARNING:\n' + warning('\n' +
' The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) + 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
' Your build will result in an user table setup that is incompatible with the local system.') 'Your build will result in an user table setup that is incompatible with the local system.')
endif endif
endif endif
id_result = run_command('id', '-u', nobody_user) id_result = run_command('id', '-u', nobody_user)
if id_result.returncode() == 0 if id_result.returncode() == 0
id = id_result.stdout().to_int() id = id_result.stdout().to_int()
if id != 65534 if id != 65534
message('WARNING:\n' + warning('\n' +
' The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) + 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
' Your build will result in an user table setup that is incompatible with the local system.') 'Your build will result in an user table setup that is incompatible with the local system.')
endif endif
endif endif
@ -699,24 +699,24 @@ getent_result = run_command('getent', 'group', '65534')
if getent_result.returncode() == 0 if getent_result.returncode() == 0
name = getent_result.stdout().split(':')[0] name = getent_result.stdout().split(':')[0]
if name != nobody_group if name != nobody_group
message('WARNING:\n' + warning('\n' +
' The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) + 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
' Your build will result in an group table setup that is incompatible with the local system.') 'Your build will result in an group table setup that is incompatible with the local system.')
endif endif
endif endif
id_result = run_command('id', '-g', nobody_group) id_result = run_command('id', '-g', nobody_group)
if id_result.returncode() == 0 if id_result.returncode() == 0
id = id_result.stdout().to_int() id = id_result.stdout().to_int()
if id != 65534 if id != 65534
message('WARNING:\n' + warning('\n' +
' The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) + 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
' Your build will result in an group table setup that is incompatible with the local system.') 'Your build will result in an group table setup that is incompatible with the local system.')
endif endif
endif endif
if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup') if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
message('WARNING:\n' + warning('\n' +
' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) + 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.') 'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
endif endif
conf.set_quoted('NOBODY_USER_NAME', nobody_user) conf.set_quoted('NOBODY_USER_NAME', nobody_user)
@ -2953,8 +2953,8 @@ status += [
message('\n '.join(status)) message('\n '.join(status))
if rootprefixdir != rootprefix_default if rootprefixdir != rootprefix_default
message('WARNING:\n' + warning('\n' +
' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) + 'Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
' systemd used fixed names for unit file directories and other paths, so anything\n' + 'systemd used fixed names for unit file directories and other paths, so anything\n' +
' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default)) 'except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
endif endif