diff --git a/meson.build b/meson.build index 87e67c9c32..6bbb2db55d 100644 --- a/meson.build +++ b/meson.build @@ -795,7 +795,7 @@ if default_net_naming_scheme != 'latest' endif time_epoch = get_option('time-epoch') -if time_epoch == -1 +if time_epoch <= 0 time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"', check : true).stdout().strip() if time_epoch == '' and git.found() and fs.exists('.git') # If we're in a git repository, use the creation time of the latest git tag. @@ -813,7 +813,7 @@ if time_epoch == -1 time_epoch = run_command(stat, '-c', '%Y', NEWS, check : true).stdout() endif - time_epoch = time_epoch.to_int() + time_epoch = time_epoch.strip().to_int() endif conf.set('TIME_EPOCH', time_epoch) @@ -828,7 +828,7 @@ foreach tuple : [['system-alloc-uid-min', 'SYS_UID_MIN', 1], # Also see login.d ['system-alloc-gid-min', 'SYS_GID_MIN', 1], ['system-gid-max', 'SYS_GID_MAX', 999]] v = get_option(tuple[0]) - if v == -1 + if v <= 0 v = run_command( awk, '/^\s*@0@\s+/ { uid=$2 } END { print uid }'.format(tuple[1]), @@ -874,7 +874,7 @@ if not meson.is_cross_build() endif id_result = run_command('id', '-u', nobody_user, check : false) if id_result.returncode() == 0 - id = id_result.stdout().to_int() + id = id_result.stdout().strip().to_int() if id != 65534 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) + @@ -893,7 +893,7 @@ if not meson.is_cross_build() endif id_result = run_command('id', '-g', nobody_group, check : false) if id_result.returncode() == 0 - id = id_result.stdout().to_int() + id = id_result.stdout().strip().to_int() if id != 65534 warning('\n' + 'The local group with the configured group name "@0@" of the nobody group does not have GID 65534 (it has @1@).\n'.format(nobody_group, id) + @@ -936,8 +936,8 @@ foreach option : ['adm-gid', val = get_option(option) # Ensure provided GID argument is numeric, otherwise fall back to default assignment - conf.set(name, val >= 0 ? val : '-') - if val >= 0 + conf.set(name, val > 0 ? val : '-') + if val > 0 static_ugids += '@0@:@1@'.format(option, val) endif endforeach @@ -2229,7 +2229,7 @@ exe = executable( dependencies : [versiondep, libseccomp], install_rpath : rootpkglibdir, - install : conf.get('ENABLE_ANALYZE')) + install : conf.get('ENABLE_ANALYZE') == 1) public_programs += exe if want_tests != 'false' diff --git a/meson_options.txt b/meson_options.txt index d8c0c581c2..d5237f02ae 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -38,7 +38,7 @@ option('static-libsystemd', type : 'combo', option('static-libudev', type : 'combo', choices : ['false', 'true', 'pic', 'no-pic'], description : 'install a static library for libudev') -option('standalone-binaries', type : 'boolean', value : 'false', +option('standalone-binaries', type : 'boolean', value : false, description : 'also build standalone versions of supported binaries') option('sysvinit-path', type : 'string', value : '/etc/init.d', @@ -51,7 +51,7 @@ option('rc-local', type : 'string', value : '/etc/rc.local') option('initrd', type : 'boolean', description : 'install services for use when running systemd in initrd') -option('compat-mutable-uid-boundaries', type : 'boolean', value : 'false', +option('compat-mutable-uid-boundaries', type : 'boolean', value : false, description : 'look at uid boundaries in /etc/login.defs for compatibility') option('nscd', type : 'boolean', description : 'build support for flushing of the nscd caches') @@ -220,20 +220,20 @@ option('default-net-naming-scheme', type : 'string', value : 'latest', option('status-unit-format-default', type : 'combo', choices : ['auto', 'description', 'name', 'combined'], description : 'use unit name or description in messages by default') -option('time-epoch', type : 'integer', value : '-1', +option('time-epoch', type : 'integer', value : 0, description : 'time epoch for time clients') -option('clock-valid-range-usec-max', type : 'integer', value : '473364000000000', # 15 years +option('clock-valid-range-usec-max', type : 'integer', value : 473364000000000, # 15 years description : 'maximum value in microseconds for the difference between RTC and epoch, exceeding which is considered an RTC error') option('default-user-shell', type : 'string', value : '/bin/bash', description : 'default interactive shell') -option('system-alloc-uid-min', type : 'integer', value : '-1', +option('system-alloc-uid-min', type : 'integer', value : 0, description : 'minimum system UID used when allocating') -option('system-alloc-gid-min', type : 'integer', value : '-1', +option('system-alloc-gid-min', type : 'integer', value : 0, description : 'minimum system GID used when allocating') -option('system-uid-max', type : 'integer', value : '-1', +option('system-uid-max', type : 'integer', value : 0, description : 'maximum system UID') -option('system-gid-max', type : 'integer', value : '-1', +option('system-gid-max', type : 'integer', value : 0, description : 'maximum system GID') option('dynamic-uid-min', type : 'integer', value : 0x0000EF00, description : 'minimum dynamic UID') @@ -253,47 +253,47 @@ option('nobody-user', type : 'string', option('nobody-group', type : 'string', description : 'The name of the nobody group (the one with GID 65534)', value : 'nobody') -option('adm-gid', type : 'integer', value : '-1', +option('adm-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "adm" group') -option('audio-gid', type : 'integer', value : '-1', +option('audio-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "audio" group') -option('cdrom-gid', type : 'integer', value : '-1', +option('cdrom-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "cdrom" group') -option('dialout-gid', type : 'integer', value : '-1', +option('dialout-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "dialout" group') -option('disk-gid', type : 'integer', value : '-1', +option('disk-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "disk" group') -option('input-gid', type : 'integer', value : '-1', +option('input-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "input" group') -option('kmem-gid', type : 'integer', value : '-1', +option('kmem-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "kmem" group') -option('kvm-gid', type : 'integer', value : '-1', +option('kvm-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "kvm" group') -option('lp-gid', type : 'integer', value : '-1', +option('lp-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "lp" group') -option('render-gid', type : 'integer', value : '-1', +option('render-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "render" group') -option('sgx-gid', type : 'integer', value : '-1', +option('sgx-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "sgx" group') -option('tape-gid', type : 'integer', value : '-1', +option('tape-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "tape" group') option('tty-gid', type : 'integer', value : 5, description : 'the numeric GID of the "tty" group') -option('users-gid', type : 'integer', value : '-1', +option('users-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "users" group') -option('utmp-gid', type : 'integer', value : '-1', +option('utmp-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "utmp" group') -option('video-gid', type : 'integer', value : '-1', +option('video-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "video" group') -option('wheel-gid', type : 'integer', value : '-1', +option('wheel-gid', type : 'integer', value : 0, description : 'soft-static allocation for the "wheel" group') -option('systemd-journal-gid', type : 'integer', value : '-1', +option('systemd-journal-gid', type : 'integer', value : 0, description : 'soft-static allocation for the systemd-journal group') -option('systemd-network-uid', type : 'integer', value : '-1', +option('systemd-network-uid', type : 'integer', value : 0, description : 'soft-static allocation for the systemd-network user') -option('systemd-resolve-uid', type : 'integer', value : '-1', +option('systemd-resolve-uid', type : 'integer', value : 0, description : 'soft-static allocation for the systemd-resolve user') -option('systemd-timesync-uid', type : 'integer', value : '-1', +option('systemd-timesync-uid', type : 'integer', value : 0, description : 'soft-static allocation for the systemd-timesync user') option('dev-kvm-mode', type : 'string', value : '0666', @@ -442,7 +442,7 @@ option('efi-libdir', type : 'string', description : 'path to the EFI lib directory') option('efi-includedir', type : 'string', value : '/usr/include/efi', description : 'path to the EFI header directory') -option('efi-tpm-pcr-compat', type : 'boolean', value : 'false', +option('efi-tpm-pcr-compat', type : 'boolean', value : false, description : 'Measure kernel command line also into TPM PCR 8 (in addition to 12)') option('sbat-distro', type : 'string', value : 'auto', description : 'SBAT distribution ID, e.g. fedora, or auto for autodetection') @@ -472,11 +472,11 @@ option('zshcompletiondir', type : 'string', option('tests', type : 'combo', choices : ['true', 'unsafe', 'false'], description : 'enable extra tests with =unsafe') -option('slow-tests', type : 'boolean', value : 'false', +option('slow-tests', type : 'boolean', value : false, description : 'run the slow tests by default') -option('fuzz-tests', type : 'boolean', value : 'false', +option('fuzz-tests', type : 'boolean', value : false, description : 'run the fuzzer regression tests by default (with sanitizers)') -option('install-tests', type : 'boolean', value : 'false', +option('install-tests', type : 'boolean', value : false, description : 'install test executables') option('log-message-verification', type : 'combo', choices : ['auto', 'true', 'false'], description : 'do fake printf() calls to verify format strings') @@ -488,18 +488,18 @@ option('ok-color', type : 'combo', 'highlight-cyan', 'highlight-white'], value : 'green', description: 'color of the "OK" status message') -option('urlify', type : 'boolean', value : 'true', +option('urlify', type : 'boolean', value : true, description : 'enable pager Hyperlink ANSI sequence support') -option('fexecve', type : 'boolean', value : 'false', +option('fexecve', type : 'boolean', value : false, description : 'use fexecve() to spawn children') -option('oss-fuzz', type : 'boolean', value : 'false', +option('oss-fuzz', type : 'boolean', value : false, description : 'build against oss-fuzz') -option('llvm-fuzz', type : 'boolean', value : 'false', +option('llvm-fuzz', type : 'boolean', value : false, description : 'build against LLVM libFuzzer') -option('kernel-install', type: 'boolean', value: 'true', +option('kernel-install', type: 'boolean', value: true, description : 'install kernel-install and associated files') -option('analyze', type: 'boolean', value: 'true', +option('analyze', type: 'boolean', value: true, description : 'install systemd-analyze') option('bpf-compiler', type : 'combo', choices : ['clang', 'gcc'], @@ -507,5 +507,5 @@ option('bpf-compiler', type : 'combo', choices : ['clang', 'gcc'], option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build BPF programs from source code in restricted C') -option('skip-deps', type : 'boolean', value : 'false', +option('skip-deps', type : 'boolean', value : false, description : 'skip optional dependencies') diff --git a/po/meson.build b/po/meson.build index 139f393e33..0a140b40b5 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,9 +1,9 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -i18n = import('i18n') want_translations = get_option('translations') if want_translations + i18n = import('i18n') i18n.gettext(meson.project_name(), preset : 'glib', data_dirs : '.') diff --git a/src/basic/meson.build b/src/basic/meson.build index 84576efd89..19d3395a49 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -385,7 +385,7 @@ filesystem_includes = ['linux/magic.h', 'linux/gfs2_ondisk.h'] check_filesystems = find_program('check-filesystems.sh') -r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes, check: false) +r = run_command([check_filesystems, cpp, files('filesystems-gperf.gperf')] + filesystem_includes, check: false) if r.returncode() != 0 error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout()) r.stdout()