From: Tobias Ulmer Date: Mon, 27 Feb 2017 12:44:30 +0000 (+0100) Subject: source: make sourceset argument non-optional, add to display() X-Git-Tag: e2factory-2.3.17~19 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=0f0f6fa75cf1d1585e282f487cec4392bafe6153;p=e2factory.git source: make sourceset argument non-optional, add to display() Signed-off-by: Tobias Ulmer --- diff --git a/local/e2-ls-project.lua b/local/e2-ls-project.lua index be1fe62..7b33a0b 100644 --- a/local/e2-ls-project.lua +++ b/local/e2-ls-project.lua @@ -249,7 +249,7 @@ local function e2_ls_project(arg) s2 = "|" end p2(s1, s2, sourcename) - local t, re = source.sources[sourcename]:display() + local t, re = source.sources[sourcename]:display(build_mode.source_set()) if not t then error(re) end diff --git a/local/source.lua b/local/source.lua index da9a729..5aa7028 100644 --- a/local/source.lua +++ b/local/source.lua @@ -131,10 +131,11 @@ end --- Abstract display method. Every child class must overwrite this -- method with an implementation. Calling this method throws an error. +-- @param sourceset Source set (ex: "tag", "branch", ...) -- @return Array of strings containing free form information about source. -function source.basic_source:display() - error(err.new("called display() of source base class, type %s name %s", - self._type, self._name)) +function source.basic_source:display(sourceset) + error(err.new("called display(%s) of source base class, type %s name %s", + tostring(sourceset), self._type, self._name)) end --- Check whether the working copy is available. Sources that don't have a diff --git a/plugins/files.lua b/plugins/files.lua index b41e102..ca83423 100644 --- a/plugins/files.lua +++ b/plugins/files.lua @@ -388,10 +388,12 @@ end --- create a table of lines for display -- @return a table -function files.files_source:display() +function files.files_source:display(sourceset) + assertIsStringN(sourceset) + local s, sid, d, licences - self:sourceid() + self:sourceid(sourceset) d = {} table.insert(d, string.format("type = %s", self:get_type()))