On Wed, Jul 20, 2022 at 05:31:52PM +0100, Daniel P. Berrangé wrote: > > > diff --git a/meson.build b/meson.build > > > index 65a885ea69..d8ef24bacb 100644 > > > --- a/meson.build > > > +++ b/meson.build > > > @@ -18,6 +18,8 @@ config_host = keyval.load(meson.current_build_dir() / > > > 'config-host.mak') > > > enable_modules = 'CONFIG_MODULES' in config_host > > > enable_static = 'CONFIG_STATIC' in config_host > > > > > > +in_gitrepo = run_command('test', '-d', '.git', check: > > > false).returncode() == 0 > > > > Should we use Meson's fs.is_dir() rather than running a shell? > > (https://mesonbuild.com/Fs-module.html) > > Will investigate
Probably not a good idea as-is; .git need not be a directory, but can also be a symlink. So 'test -e .git' is the better check (see scripts/qemu-version.sh); but if you can write an existence check in meson (instead of a directory check), then go for it. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org