From: Tobias Ulmer Date: Fri, 6 Dec 2013 13:34:49 +0000 (+0100) Subject: Extend e2lib.call_tool_argv() with optional workdir and envdict args X-Git-Tag: e2factory-2.3.15rc1~300 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=7bda2b9bbffb9722252bfcf43378efd71cfb3aff;p=e2factory.git Extend e2lib.call_tool_argv() with optional workdir and envdict args Both are passed to callcmd() Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 8f77bca..ec02ad1 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1804,9 +1804,12 @@ end -- @param tool Tool name as registered in the tools library (string). -- @param argv Vector of arguments, escaping is handled by the function -- (table of strings). +-- @param workdir Working directory of tool (optional). +-- @param envdict Environment dictionary of tool (optional). -- @return True when the tool returned 0, false on error. -- @return Error object on failure. -function e2lib.call_tool_argv(tool, argv) +-- @see callcmd_log +function e2lib.call_tool_argv(tool, argv, workdir, envdict) local rc, re, cmd, flags, call cmd, re = tools.get_tool(tool) @@ -1829,7 +1832,7 @@ function e2lib.call_tool_argv(tool, argv) table.insert(cmd, arg) end - rc, re = e2lib.callcmd_log(cmd) + rc, re = e2lib.callcmd_log(cmd, workdir, envdict) if not rc or rc ~= 0 then return false, re end