From 7bda2b9bbffb9722252bfcf43378efd71cfb3aff Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 6 Dec 2013 14:34:49 +0100 Subject: [PATCH] Extend e2lib.call_tool_argv() with optional workdir and envdict args Both are passed to callcmd() Signed-off-by: Tobias Ulmer --- generic/e2lib.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.5