]> git.e2factory.org Git - e2factory.git/commitdiff
e2build: Remove shell quoting and prepare an arg vector
authorTobias Ulmer <tu@emlix.com>
Tue, 19 Nov 2013 18:56:39 +0000 (19:56 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2build.lua

index 62df6f39665dbcb900a60665c9206e036159d706..bfd3ac1907aa2efcc68e8ec74f90e0d07b89a055 100644 (file)
@@ -418,18 +418,10 @@ local function runbuild(info, r, return_flags)
     local rc, re
     local e = err.new("build failed")
     e2lib.logf(3, "building %s ...", r)
-    local runbuild = string.format("/bin/bash -e -x %s/%s/%s",
-        e2lib.shquote(res.build_config.Tc),
-        e2lib.shquote(res.build_config.scriptdir),
-        e2lib.shquote(res.build_config.build_driver_file))
     local e2_su, re = tools.get_tool("e2-su-2.2")
     if not e2_su then
         return false, e:cat(re)
     end
-    local cmd = string.format("%s %s chroot_2_3 %s %s",
-        res.build_config.chroot_call_prefix,
-        e2lib.shquote(e2_su),
-        e2lib.shquote(res.build_config.base), runbuild)
     -- the build log is written to an external logfile
     rc, re = e2lib.rotate_log(res.build_config.buildlog)
     if not rc then
@@ -445,6 +437,18 @@ local function runbuild(info, r, return_flags)
         out:flush()
     end
     e2tool.set_umask(info)
+
+    local cmd = {
+        res.build_config.chroot_call_prefix,
+        e2_su,
+        "chroot_2_3",
+        res.build_config.base,
+        "/bin/bash",
+        "-e", "-x",
+        e2lib.join(res.build_config.Tc, res.build_config.scriptdir,
+            res.build_config.build_driver_file)
+    }
+
     rc, re = e2lib.callcmd_capture(cmd, logto)
     if not rc then
         return false, e:cat(re)