]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: correct git detection
authorJohn Levon <john.levon@nutanix.com>
Wed, 24 Jul 2024 08:56:04 +0000 (09:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Jul 2024 10:41:58 +0000 (12:41 +0200)
The current "building from git" test uses "test -d .git"; however, that
doesn't work when libvirt is used as a submodule, as in that case .git
is a normal file. Use "test -e .git" instead.

Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
meson.build

index 3ab8e57e4aa44b93a0f7d1e369ea0aba84110e02..231470e2ee0fbcf9f7ae582686a5b0fe009491c8 100644 (file)
@@ -17,7 +17,7 @@ endif
 
 # figure out if we are building from git
 
-git = run_command('test', '-d', '.git', check: false).returncode() == 0
+git = run_command('test', '-e', '.git', check: false).returncode() == 0
 
 if git and not get_option('no_git')
   run_command('git', 'submodule', 'update', '--init', check: true)