]> git.e2factory.org Git - e2factory.git/commitdiff
build: rotate build logfiles
authorGordon Hecker <gh@emlix.com>
Tue, 10 Nov 2009 13:51:50 +0000 (14:51 +0100)
committerGordon Hecker <gh@emlix.com>
Wed, 18 Nov 2009 09:10:37 +0000 (10:10 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
Changelog
local/e2build.lua
local/policy.lua

index 81c7db9b6146e3844536e693a1caaa27eabf192b..83d069b11183dc5b6daca5449cb00692db5a5516 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,7 @@
 NEXT:
  * use sha1 module instead of calling the sha1sum tool
  * optimization: use stat() instead of calling 'test -f'
+ * rotate build logfiles
 
 e2factory-2.3.2
  * temporary build directories are located in a version specific directory
index 4929980738a05005ee588ea5973c7782251c746e..0707586b057be6991c0ea442ef45e57d2623a283 100644 (file)
 
 e2build = e2lib.module("e2build")
 
-function e2build.remove_logfile(info, r, return_flags)
-  local res = info.results[r]
-  local rc = os.remove(res.build_config.buildlog)
-  -- always return true
-  return true, nil
-end
-
 --- cache a result
 -- @param info
 -- @param server
@@ -372,6 +365,10 @@ function e2build.runbuild(info, r, return_flags)
                                res.build_config.chroot_call_prefix, e2_su, 
                                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
+    return false, e:cat(re)
+  end
   local out = luafile.open(res.build_config.buildlog, "w")
   local function logto(output)
     e2lib.log(3, output)
index 9e900a0720ab2e59349eadfdff301faeac203615..9fdbd91d8b4e2a2d6d459c5fd311b26576c41eda 100644 (file)
@@ -221,7 +221,6 @@ end
 local default_build_process = {
        "build_config",
        "result_available",
-       "remove_logfile",
        "chroot_lock",
        "chroot_cleanup_if_exists",
        "setup_chroot",