[gtkmm/gtkmm-3-24] meson.build: Compress the Python code for is_git_build
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3-24] meson.build: Compress the Python code for is_git_build
- Date: Tue, 27 Sep 2022 06:22:10 +0000 (UTC)
commit 1c3532e3042d189121551bb0aa544f1edeef456e
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Sep 27 08:16:44 2022 +0200
meson.build: Compress the Python code for is_git_build
meson.build | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/meson.build b/meson.build
index 620007ed..4ecabdf0 100644
--- a/meson.build
+++ b/meson.build
@@ -59,17 +59,11 @@ endif
# Do we build from a git repository?
# Suppose we do if and only if the meson.build file is tracked by git.
cmd_py = '''
-import os
-import sys
-import subprocess
-import shutil
-
+import shutil, subprocess, sys
if not shutil.which('git'):
sys.exit(1)
-
cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ]
sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode)
-
'''.format(project_source_root)
is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]