[gobject-introspection/wip/meson: 11/14] meson: Handle spaces in the full python path



commit 154c16dfe88b22478c0ef4dc718de7cbb9e54d60
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Wed Nov 29 08:45:56 2017 +0530

    meson: Handle spaces in the full python path
    
    If there is a space in the path to python, we cannot use it in the
    shebang since there is no way to quote spaces. Use the basename
    instead since we pass it to /usr/bin/env anyway.

 tools/meson.build |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tools/meson.build b/tools/meson.build
index e32937b..1b4c6e9 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -1,6 +1,11 @@
 libdir_abs = join_paths(get_option('prefix'), get_option('libdir'))
 datadir_abs = join_paths(get_option('prefix'), get_option('datadir'))
 python_path = python3.path()
+# If there is a space in the path to python, we cannot use it in the shebang
+# since there is no way to quote spaces. Use the basename instead.
+if python_path.contains(' ')
+  python_path = python_path.split('/')[-1]
+endif
 
 tools = [
   ['g-ir-scanner', 'scannermain', 'scanner_main'],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]