]> git.e2factory.org Git - e2factory.git/commitdiff
e2build: fix wrong use of shquote(), makes x86_64 chroot work
authorTobias Ulmer <tu@emlix.com>
Tue, 6 Oct 2015 12:21:58 +0000 (14:21 +0200)
committerTobias Ulmer <tu@emlix.com>
Thu, 8 Oct 2015 15:49:17 +0000 (17:49 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
Changelog
local/e2build.lua

index e2c58be139499bf707f4ed959bd3f669f594844b..63bd17dda5c0348fe1ecd362692f8d99a36659ac 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
 NEXT:
+ * Fix incorrect use of shquote(), preventing x86_64 chroot builds
  * Fix regression preventing use of x86_64 chroot
  * Fix hashcache problem causing an incorrect BuildID
  * Reset all signal handlers to their default values
index 2bd525c8e4a1220c61bb18a3136b76405b24b217..037e37d6a6ee2d07ff8b11d0e96f730d69be8bb2 100644 (file)
@@ -208,7 +208,13 @@ function e2build.build_config(info, r)
     tab.T = string.format("%s/%s/%s/chroot/%s", tmpdir, project, r, builddir)
     tab.Tc = string.format("/%s", builddir)
     tab.r = string.format("%s", r)
-    tab.chroot_call_prefix = info.chroot_call_prefix[info.project.chroot_arch]
+    if info.chroot_call_prefix[info.project.chroot_arch] == "" then
+        -- escape only if non-empty, otherwise we fail to start "''"
+        tab.chroot_call_prefix = ""
+    else
+        tab.chroot_call_prefix =
+            e2lib.shquote(info.chroot_call_prefix[info.project.chroot_arch])
+    end
     tab.buildlog = string.format("%s/log/build.%s.log", info.root, r)
     tab.scriptdir = "script"
     tab.build_driver = ""
@@ -333,9 +339,11 @@ function e2build.enter_playground(info, r, chroot_command)
     e2lib.log(4, "entering playground for " .. r .. " ...")
     local term = e2lib.globals.terminal
     local e2_su = tools.get_tool("e2-su-2.2")
-    local cmd = string.format("%s %s chroot_2_3 '%s' %s",
-    res.build_config.chroot_call_prefix, e2_su,
-    res.build_config.base, chroot_command)
+    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),
+        chroot_command)
     e2tool.set_umask(info)
     os.execute(cmd)
     e2tool.reset_umask(info)
@@ -389,9 +397,10 @@ local function runbuild(info, r, return_flags)
     e2lib.shquote(res.build_config.build_driver_file))
     local e2_su = tools.get_tool("e2-su-2.2")
     local cmd = string.format("%s %s chroot_2_3 %s %s",
-    e2lib.shquote(res.build_config.chroot_call_prefix),
-    e2lib.shquote(e2_su),
-    e2lib.shquote(res.build_config.base), runbuild)
+        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