]> git.e2factory.org Git - e2factory.git/commitdiff
Extend e2lib.call_tool_argv() with optional workdir and envdict args
authorTobias Ulmer <tu@emlix.com>
Fri, 6 Dec 2013 13:34:49 +0000 (14:34 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Both are passed to callcmd()

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 8f77bcab7b7316256a99ab66361802b7147a3d3f..ec02ad17369d18c44a1a3179fa2f48232102098f 100644 (file)
@@ -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