summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/srpm/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-22 00:56:55 +0800
committerruki <[email protected]>2023-12-22 00:56:55 +0800
commite7e4a16ed6bb8e2f1db5fc28d5ad2920e3c8e41b (patch)
treef3eca9ea26e28627a9ff697d4d6072d60a670226 /xmake/plugins/pack/srpm/main.lua
parent6417898f2e1076a642d85fc91478c84b9e67a39a (diff)
translate path
Diffstat (limited to 'xmake/plugins/pack/srpm/main.lua')
-rw-r--r--xmake/plugins/pack/srpm/main.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index 1ffbdc6ed..1f6a52b57 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -99,8 +99,16 @@ function _get_customcmd(package, installcmds, cmd)
local dir = _translate_filepath(package, cmd.dir)
table.insert(installcmds, string.format("mkdir -p \"%s\"", dir))
elseif cmd.program then
- -- TODO translate path
- table.insert(installcmds, string.format("%s", os.args(table.join(cmd.program, cmd.argv))))
+ local argv = {}
+ for _, arg in ipairs(cmd.argv) do
+ if path.instance_of(arg) then
+ arg = arg:clone():set(_translate_filepath(package, arg:rawstr())):str()
+ elseif path.is_absolute(arg) then
+ arg = _translate_filepath(package, arg)
+ end
+ table.insert(argv, arg)
+ end
+ table.insert(installcmds, string.format("%s", os.args(table.join(cmd.program, argv))))
end
end