MINGW-packages/mingw-w64-cvise/004-add-basic-bash-support.patch
oltolm 68f7d4665c
cvise: fix paths in cvise.py (#24165)
* cvise: fix paths in cvise.py

* cvise: more fixes

* 002-make-relocatable.patch: replace the main lookup paths
  so we notice when things break. Otherwise the hardcoded paths
  would work locally, but then fail if built in CI.
* 003-fix-cvise-delta.patch: fix cvise-delta, calling python scripts
  as is doesn't work on windows
* 004-add-basic-bash-support.patch: add basic support for bash test scripts
  as long as they end with .sh. Also fixes the "--commands" switch which
  creates a bash script internally.

---------

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2025-05-12 09:36:44 +02:00

15 lines
558 B
Diff

--- cvise-2.11.0/cvise/passes/abstract.py.orig 2024-11-10 10:58:12.000000000 +0100
+++ cvise-2.11.0/cvise/passes/abstract.py 2025-05-12 08:54:29.014145800 +0200
@@ -126,6 +126,11 @@
def run_process(self, cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False):
if shell:
assert isinstance(cmd, str)
+
+ import os
+ if isinstance(cmd, str) and os.path.splitext(cmd)[1] == '.sh':
+ cmd = [shutil.which('bash'), cmd]
+
proc = subprocess.Popen(
cmd,
stdout=stdout,