meson: use modern syntax for dict checks

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-07-03 15:32:02 +02:00
parent 9155c0a5b9
commit f731334d84
2 changed files with 4 additions and 4 deletions

View File

@@ -2354,7 +2354,7 @@ foreach dict : executables
sources += exe_sources
endif
if dict.has_key('export')
if 'export' in dict
exported_by_name += {
name : {
'exported' : exe.extract_objects(dict['export']),
@@ -2718,7 +2718,7 @@ if meson.version().version_compare('>=1.4.0')
uniq = {}
foreach source : sources
if uniq.has_key(source.full_path())
if source.full_path() in uniq
continue
endif
uniq += {source.full_path(): source}

View File

@@ -98,7 +98,7 @@ endif
############################################################
test_compare_versions_sh = files('test-compare-versions.sh')
if want_tests != 'false' and executables_by_name.has_key('systemd-analyze')
if want_tests != 'false' and 'systemd-analyze' in executables_by_name
exe = executables_by_name.get('systemd-analyze')
test('test-compare-versions',
test_compare_versions_sh,
@@ -156,7 +156,7 @@ endif
############################################################
test_fstab_generator_sh = files('test-fstab-generator.sh')
if want_tests != 'false' and executables_by_name.has_key('systemd-fstab-generator')
if want_tests != 'false' and 'systemd-fstab-generator' in executables_by_name
exe = executables_by_name.get('systemd-fstab-generator')
test('test-fstab-generator',
test_fstab_generator_sh,