Windows fixes for scripts
authorScott D Phillips <scott.d.phillips@intel.com>
Mon, 17 Oct 2016 14:42:07 +0000 (07:42 -0700)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Thu, 20 Oct 2016 11:55:06 +0000 (08:55 -0300)
subprocess.call runs programs directly when shell=False and can't
take advantage of the association that makes python scripts
executable in shells, so explicitly add the interpreter to the
args for call.

Run the windows command prompt by default in gst-uninstalled.

configure
gst-uninstalled.py

index 4d835dc..66bf858 100755 (executable)
--- a/configure
+++ b/configure
@@ -63,8 +63,8 @@ def configure_meson(args, options):
     os.mkdir(build_dir)
 
     try:
-        subprocess.check_call([meson, "../"] + args, cwd=build_dir)
-        subprocess.check_call([os.path.join(ROOTDIR, 'meson', 'mesonconf.py')]
+        subprocess.check_call([sys.executable, meson, "../"] + args, cwd=build_dir)
+        subprocess.check_call([sys.executable, os.path.join(ROOTDIR, 'meson', 'mesonconf.py')]
                               + get_configs(meson), cwd=build_dir)
     except subprocess.CalledProcessError as e:
         print("EXIT meson return %s" % e.returncode)
index a6e1592..a698bf9 100755 (executable)
@@ -123,7 +123,10 @@ if __name__ == "__main__":
         exit(1)
 
     if not args:
-        args = [os.environ.get("SHELL", os.path.realpath("/bin/sh"))]
+        if os.name is 'nt':
+            args = [os.environ.get("COMSPEC", r"C:\WINDOWS\system32\cmd.exe")]
+        else:
+            args = [os.environ.get("SHELL", os.path.realpath("/bin/sh"))]
         if args[0] == "/bin/bash":
             args.append("--noprofile")