qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] SIMPLE_PATH_RE should match the full path token. Maybe also apply to others such as STRING_RE and TOPLEVEL_RE, not for sure
@ 2020-08-24 22:59 luoyonggang
  2020-08-24 22:59 ` [PATCH 2/2] fixes relpath may fail on win32 luoyonggang
  0 siblings, 1 reply; 2+ messages in thread
From: luoyonggang @ 2020-08-24 22:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Yonggang Luo

From: Yonggang Luo <luoyonggang@gmail.com>

---
 scripts/ninjatool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py
index cc77d51aa8..6ca8be6f10 100755
--- a/scripts/ninjatool.py
+++ b/scripts/ninjatool.py
@@ -55,7 +55,7 @@ else:
 
 PATH_RE = r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}"
 
-SIMPLE_PATH_RE = re.compile(r"[^$\s:|]+")
+SIMPLE_PATH_RE = re.compile(r"^[^$\s:|]+$")
 IDENT_RE = re.compile(r"[a-zA-Z0-9_.-]+$")
 STRING_RE = re.compile(r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?|.")
 TOPLEVEL_RE = re.compile(r"([=:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*|.")
-- 
2.27.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] fixes relpath may fail on win32.
  2020-08-24 22:59 [PATCH 1/2] SIMPLE_PATH_RE should match the full path token. Maybe also apply to others such as STRING_RE and TOPLEVEL_RE, not for sure luoyonggang
@ 2020-08-24 22:59 ` luoyonggang
  0 siblings, 0 replies; 2+ messages in thread
From: luoyonggang @ 2020-08-24 22:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Yonggang Luo

From: 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-24 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-24 22:59 [PATCH 1/2] SIMPLE_PATH_RE should match the full path token. Maybe also apply to others such as STRING_RE and TOPLEVEL_RE, not for sure luoyonggang
2020-08-24 22:59 ` [PATCH 2/2] fixes relpath may fail on win32 luoyonggang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).