mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
meson: Use fs module
Turns out that meson provides a fs module since 0.53.0, making it unnecessary to call out to test.
This commit is contained in:
parent
4728625490
commit
4cf8a6092e
@ -55,8 +55,9 @@ endif
|
|||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
fs = import('fs')
|
||||||
if get_option('split-usr') == 'auto'
|
if get_option('split-usr') == 'auto'
|
||||||
split_usr = run_command('test', '-L', '/bin').returncode() != 0
|
split_usr = not fs.is_symlink('/bin')
|
||||||
else
|
else
|
||||||
split_usr = get_option('split-usr') == 'true'
|
split_usr = get_option('split-usr') == 'true'
|
||||||
endif
|
endif
|
||||||
@ -69,7 +70,7 @@ conf.set10('HAVE_SPLIT_USR', split_usr,
|
|||||||
description : '/usr/bin and /bin directories are separate')
|
description : '/usr/bin and /bin directories are separate')
|
||||||
|
|
||||||
if get_option('split-bin') == 'auto'
|
if get_option('split-bin') == 'auto'
|
||||||
split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
|
split_bin = not fs.is_symlink('/usr/sbin')
|
||||||
else
|
else
|
||||||
split_bin = get_option('split-bin') == 'true'
|
split_bin = get_option('split-bin') == 'true'
|
||||||
endif
|
endif
|
||||||
@ -593,7 +594,6 @@ versiondep = declare_dependency(sources: version_h)
|
|||||||
|
|
||||||
sh = find_program('sh')
|
sh = find_program('sh')
|
||||||
echo = find_program('echo')
|
echo = find_program('echo')
|
||||||
test = find_program('test')
|
|
||||||
sed = find_program('sed')
|
sed = find_program('sed')
|
||||||
awk = find_program('awk')
|
awk = find_program('awk')
|
||||||
stat = find_program('stat')
|
stat = find_program('stat')
|
||||||
@ -742,7 +742,7 @@ endif
|
|||||||
time_epoch = get_option('time-epoch')
|
time_epoch = get_option('time-epoch')
|
||||||
if time_epoch == -1
|
if time_epoch == -1
|
||||||
time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip()
|
time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip()
|
||||||
if time_epoch == '' and git.found() and run_command('test', '-e', '.git').returncode() == 0
|
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.
|
# If we're in a git repository, use the creation time of the latest git tag.
|
||||||
latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags').stdout().strip()
|
latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags').stdout().strip()
|
||||||
time_epoch = run_command(git, 'log', '--no-show-signature', '-1', '--format=%at', latest_tag).stdout()
|
time_epoch = run_command(git, 'log', '--no-show-signature', '-1', '--format=%at', latest_tag).stdout()
|
||||||
|
@ -61,7 +61,7 @@ foreach dir : [get_option('efi-libdir'),
|
|||||||
'/usr/lib/gnuefi' / efi_arch[0],
|
'/usr/lib/gnuefi' / efi_arch[0],
|
||||||
run_command('realpath', '-e',
|
run_command('realpath', '-e',
|
||||||
'/usr/lib' / run_command(efi_cc, '-print-multi-os-directory').stdout().strip()).stdout().strip()]
|
'/usr/lib' / run_command(efi_cc, '-print-multi-os-directory').stdout().strip()).stdout().strip()]
|
||||||
if run_command(test, '-d', dir).returncode() == 0
|
if dir != '' and fs.is_dir(dir)
|
||||||
efi_libdir = dir
|
efi_libdir = dir
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
@ -83,7 +83,7 @@ foreach location : [ # New locations first introduced with gnu-efi 3.0.11
|
|||||||
efi_libdir / 'gnuefi' / 'crt0-efi-@0@.o'.format(efi_arch[1])],
|
efi_libdir / 'gnuefi' / 'crt0-efi-@0@.o'.format(efi_arch[1])],
|
||||||
[efi_libdir / 'elf_@0@_efi.lds'.format(efi_arch[1]),
|
[efi_libdir / 'elf_@0@_efi.lds'.format(efi_arch[1]),
|
||||||
efi_libdir / 'crt0-efi-@0@.o'.format(efi_arch[1])]]
|
efi_libdir / 'crt0-efi-@0@.o'.format(efi_arch[1])]]
|
||||||
if run_command(test, '-f', location[0], '-a', '-f', location[1]).returncode() == 0
|
if fs.is_file(location[0]) and fs.is_file(location[1])
|
||||||
efi_lds = location[0]
|
efi_lds = location[0]
|
||||||
efi_crt0 = location[1]
|
efi_crt0 = location[1]
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user