summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-01 11:33:28 +0800
committerruki <[email protected]>2020-03-01 11:33:28 +0800
commit6018704f4bfdf1906b6a45f4bb92679cefc57629 (patch)
treec3e29b11a3050d12a179751d2d811309355a8021
parent4a15e79d3d83174b8a81bb192bcb3d86692b2cab (diff)
improve os.argw and disable wildcards for os.execv
-rw-r--r--xmake/core/base/os.lua17
-rw-r--r--xmake/rules/wdk/inf/xmake.lua2
-rw-r--r--xmake/rules/wdk/tracewpp/xmake.lua2
3 files changed, 5 insertions, 16 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index ff0b494e8..92545d261 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -205,10 +205,8 @@ function os.argw(argv)
-- match all arguments
local results = {}
for _, arg in ipairs(table.wrap(argv)) do
-
- -- exists wildcards?
- if arg:find("([%+%-%^%$%*%[%]%%])") then
- local pathes = os.match(arg, 'a')
+ if arg:find("*", 1, true) then
+ local pathes = os.filedirs(arg)
if #pathes > 0 then
table.join2(results, pathes)
else
@@ -682,7 +680,7 @@ end
-- @param program "clang", "xcrun -sdk macosx clang", "~/dir/test\ xxx/clang"
-- filename "clang", "xcrun"", "~/dir/test\ xxx/clang"
-- @param argv the arguments
--- @param opt the options, e.g. {wildcards = false, stdout = filepath/file/pipe, stderr = filepath/file/pipe,
+-- @param opt the options, e.g. {stdout = filepath/file/pipe, stderr = filepath/file/pipe,
-- envs = {PATH = "xxx;xx", CFLAGS = "xx"}}
--
function os.execv(program, argv, opt)
@@ -690,15 +688,6 @@ function os.execv(program, argv, opt)
-- init options
opt = opt or {}
- -- enable wildcards? default enabled
- local wildcards = opt.wildcards
- if wildcards == nil then
- wildcards = true
- end
-
- -- translate arguments for wildcards
- argv = wildcards and os.argw(argv) or argv
-
-- is not executable program file?
local filename = program
if not os.isexec(program) then
diff --git a/xmake/rules/wdk/inf/xmake.lua b/xmake/rules/wdk/inf/xmake.lua
index 99422a957..c354c4753 100644
--- a/xmake/rules/wdk/inf/xmake.lua
+++ b/xmake/rules/wdk/inf/xmake.lua
@@ -100,7 +100,7 @@ rule("wdk.inf")
-- update the timestamp
os.cp(sourcefile, targetfile)
- os.vrunv(stampinf, args, {wildcards = false})
+ os.vrunv(stampinf, args)
-- update files and values to the dependent file
dependinfo.files = {sourcefile}
diff --git a/xmake/rules/wdk/tracewpp/xmake.lua b/xmake/rules/wdk/tracewpp/xmake.lua
index 383dbf372..fc822b7fc 100644
--- a/xmake/rules/wdk/tracewpp/xmake.lua
+++ b/xmake/rules/wdk/tracewpp/xmake.lua
@@ -109,7 +109,7 @@ rule("wdk.tracewpp")
os.tryrm(targetfile)
-- generate the *.tmh file
- os.vrunv(tracewpp, args, {wildcards = false})
+ os.vrunv(tracewpp, args)
-- update files and values to the dependent file
dependinfo.files = {sourcefile}