[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/6] meson: fixes relpath may fail on win32.
From: |
luoyonggang |
Subject: |
[PATCH v2 2/6] meson: fixes relpath may fail on win32. |
Date: |
Thu, 27 Aug 2020 13:05:39 +0800 |
From: Yonggang Luo <luoyonggang@gmail.com>
On win32, os.path.relpath would raise exception when do the following relpath:
C:/msys64/mingw64/x.exe relative to E:/path/qemu-build would fail.
So we try catch it for stopping it from raise exception on msys2
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
scripts/mtest2make.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index bdb257bbd9..d7a51bf97e 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -53,9 +53,16 @@ i = 0
for test in json.load(sys.stdin):
env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v))
for k, v in test['env'].items()))
- executable = os.path.relpath(test['cmd'][0])
+ executable = test['cmd'][0]
+ try:
+ executable = os.path.relpath(executable)
+ except:
+ pass
if test['workdir'] is not None:
- test['cmd'][0] = os.path.relpath(test['cmd'][0], test['workdir'])
+ try:
+ test['cmd'][0] = os.path.relpath(executable, test['workdir'])
+ except:
+ test['cmd'][0] = executable
else:
test['cmd'][0] = executable
cmd = '$(.test.env) %s %s' % (env, ' '.join((shlex.quote(x) for x in
test['cmd'])))
--
2.27.0.windows.1
- [PATCH v2 0/6] Fixes msys2 building after the meson convert, luoyonggang, 2020/08/27
- [PATCH v2 2/6] meson: fixes relpath may fail on win32.,
luoyonggang <=
- [PATCH v2 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja, luoyonggang, 2020/08/27
- [PATCH v2 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2, luoyonggang, 2020/08/27
- [PATCH v2 4/6] configure: Fix include and linkage issue on msys2, luoyonggang, 2020/08/27
- [PATCH v2 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2, luoyonggang, 2020/08/27
- [PATCH v2 6/6] meson: Convert undefsym.sh to undefsym.py, luoyonggang, 2020/08/27