From 86a01f53bdd3c57953d032636bfe630317bda305 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Thu, 8 Sep 2016 18:17:11 +0200 Subject: [PATCH] result: build_process() returns a new build_process_class object Signed-off-by: Tobias Ulmer --- local/result.lua | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/local/result.lua b/local/result.lua index f150353..39a399d 100644 --- a/local/result.lua +++ b/local/result.lua @@ -19,10 +19,12 @@ -- more details. local result = {} +package.loaded["result"] = result local buildconfig = require("buildconfig") local chroot = require("chroot") local class = require("class") +local e2build = require("e2build") local e2lib = require("e2lib") local e2tool = require("e2tool") local environment = require("environment") @@ -67,7 +69,6 @@ function result.basic_result:initialize(rawres) -- e2build currently needs this stuff in every result. -- self._build_mode = false - self._build_process = false end --- Constructor that's called by load_result_configs() after all results @@ -107,23 +108,6 @@ function result.basic_result:buildid() self._type, self._name)) end ---- Get the build proces to be used for this class -function result.basic_result:build_process() - return self._build_process -end - ---- Set a build process class --- @param build_process_class or false -function result.basic_result:set_build_process(build_process) - if build_process == false then - self._build_process = false - else - assertIsTable(build_process) - assertIsFunction(build_process.build) - self._build_process = build_process - end -end - --- Return list of depdencencies function result.basic_result:dlist() error(err.new("called dlist() of result base class, type %s name %s", @@ -218,6 +202,12 @@ function result.basic_result:merged_env() self._type, self._name)) end +--- Get the build process to be used for this class +function result.basic_result:build_process() + error(err.new("called build_process() of result base class, type %s name %s", + self._type, self._name)) +end + --- Get/set the settings class. Settings hold per-result information -- for the build process. Each result that's passed to a build process needs -- a valid settings_class @@ -536,6 +526,13 @@ function result.result_class:buildid() return build_mode.buildid(self._buildid) end + +function result.result_class:build_process() + assertIsTable(self._build_mode) + assertIsTable(self._build_settings) + return e2build.build_process_class:new() +end + function result.result_class:attribute_table(flagt) assert(flagt == nil or type(flagt) == "table") -- 2.39.5