#####################################################################
+fs = import('fs')
if get_option('split-usr') == 'auto'
- split_usr = run_command('test', '-L', '/bin').returncode() != 0
+ split_usr = not fs.is_symlink('/bin')
else
split_usr = get_option('split-usr') == 'true'
endif
description : '/usr/bin and /bin directories are separate')
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
split_bin = get_option('split-bin') == 'true'
endif
sh = find_program('sh')
echo = find_program('echo')
-test = find_program('test')
sed = find_program('sed')
awk = find_program('awk')
stat = find_program('stat')
time_epoch = get_option('time-epoch')
if time_epoch == -1
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.
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()
'/usr/lib/gnuefi' / efi_arch[0],
run_command('realpath', '-e',
'/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
break
endif
efi_libdir / 'gnuefi' / 'crt0-efi-@0@.o'.format(efi_arch[1])],
[efi_libdir / 'elf_@0@_efi.lds'.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_crt0 = location[1]
break