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.
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 },
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 = {}
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