diff options
| -rw-r--r-- | xmake/plugins/pack/batchcmds.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/pack/srpm/main.lua | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua index 9f74ad606..3d9229cce 100644 --- a/xmake/plugins/pack/batchcmds.lua +++ b/xmake/plugins/pack/batchcmds.lua @@ -192,7 +192,7 @@ end -- on build target command function _on_target_buildcmd(target, batchcmds_, opt) local package = opt.package - batchcmds_:vrunv("xmake", {"build", target:name()}) + batchcmds_:vrunv("xmake", {"build", "-y", target:name()}) end -- on install target command 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 |
