From: Tobias Ulmer Date: Tue, 8 Oct 2013 13:48:05 +0000 (+0200) Subject: Remove all of e2lib.touch() and friends X-Git-Tag: e2factory-2.3.15rc1~445 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=aafc62592ffe91b14d49b78c60e161e336fc1b7d;p=e2factory.git Remove all of e2lib.touch() and friends Replace one usage with basic open()/close() to create the chroot marker Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 3a954b9..8503bc8 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1675,18 +1675,6 @@ function e2lib.rmtempfiles() end end ---- call the touch tool with flags and filename --- @param file string: the file parameter --- @param flags string: flags to pass to touch (optional) --- @return bool -function e2lib.touch(file, flags) - if not flags then - flags = "" - end - local args = string.format("%s %s", flags, file) - return e2lib.call_tool("touch", args) -end - --- Remove regular and special files, except dirs. -- @param pathname Path to file (string). -- @return True on success, false on error. diff --git a/generic/tools.lua b/generic/tools.lua index 1aa0bb2..529b4ad 100644 --- a/generic/tools.lua +++ b/generic/tools.lua @@ -50,7 +50,6 @@ local toollist = { sha1sum = { name = "sha1sum", flags = "", optional = false }, md5sum = { name = "md5sum", flags = "", optional = false }, cat = { name = "cat", flags = "", optional = false }, - touch = { name = "touch", flags = "", optional = false }, uname = { name = "uname", flags = "", optional = false }, patch = { name = "patch", flags = "", optional = false }, gzip = { name = "gzip", flags = "", optional = false }, diff --git a/local/e2build.lua b/local/e2build.lua index 4eeb2f1..cc95e50 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -38,6 +38,7 @@ local environment = require("environment") local e2tool = require("e2tool") local strict = require("strict") local buildconfig = require("buildconfig") +local luafile = require("luafile") -- Table driving the build process, see documentation at the bottom. local build_process = {} @@ -288,8 +289,14 @@ local function setup_chroot(info, r, return_flags) if not rc then return false, e:cat(re) end - local rc, re = e2lib.touch(res.build_config.chroot_marker) - if not rc then + + local cm = luafile.open(res.build_config.chroot_marker, "w") + if not cm then + re = err.new("could not create chroot marker") + return false, e:cat(re) + end + if not luafile.close(cm) then + re = err.new("failed to close chroot marker file") return false, e:cat(re) end