]> git.e2factory.org Git - e2factory.git/commitdiff
Remove all of e2lib.touch() and friends
authorTobias Ulmer <tu@emlix.com>
Tue, 8 Oct 2013 13:48:05 +0000 (15:48 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:01:23 +0000 (15:01 +0100)
Replace one usage with basic open()/close() to create the chroot marker

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

index 3a954b91f734ed9100b8873a11b92fde0a12d152..8503bc859a7cd353bc131c8af51aa50365e8f4e5 100644 (file)
@@ -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.
index 1aa0bb2489bcf6e6fb681c7b58e60ec8a983b4bb..529b4ad62c0ec300a692fb891b9545d3655b5ef7 100644 (file)
@@ -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 },
index 4eeb2f1300db576fb2285fb6d97b3d03023f7a74..cc95e5081cbe3ee5acc7f1037e144996c9b831a4 100644 (file)
@@ -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