From 1d6ce69bb1b58bda6ae5eb0231491898267357cf Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Thu, 11 Mar 2010 09:58:51 +0100 Subject: [PATCH] cleanup: use standard io library for logfiles Signed-off-by: Gordon Hecker --- local/e2build.lua | 5 ++++- local/e2tool.lua | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/local/e2build.lua b/local/e2build.lua index c74ad44..82af139 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -370,7 +370,10 @@ function runbuild(info, r, return_flags) if not rc then return false, e:cat(re) end - local out = luafile.open(res.build_config.buildlog, "w") + local out, msg = io.open(res.build_config.buildlog, "w") + if not out then + return false, e:cat(msg) + end local function logto(output) e2lib.log(3, output) out:write(output) diff --git a/local/e2tool.lua b/local/e2tool.lua index c4b8ec6..44d1182 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -48,9 +48,7 @@ require("url") require("hash") require("lock") require("e2util") -require("luafile_ll") require("e2option") -require("luafile") require("generic_git") require("policy") @@ -272,10 +270,10 @@ function opendebuglogfile(info) end local logfile = info.root .. "/log/debug.log" local rc, re = e2lib.rotate_log(logfile) - local debuglogfile, re = luafile.open(logfile, "w") + local debuglogfile, msg = io.open(logfile, "w") if not debuglogfile then local e = new_error("error opening debug logfile") - return false, e:cat(re) + return false, e:append(msg) end e2lib.globals.debuglogfile = debuglogfile return true, nil -- 2.39.5