From: Tobias Ulmer Date: Thu, 19 Jan 2017 17:18:32 +0000 (+0100) Subject: git: register flag, implement is_scm and is_selected X-Git-Tag: e2factory-2.3.17~65 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=adb34c2ba3942ce43fbb420570fb71a3b8b9bb99;p=e2factory.git git: register flag, implement is_scm and is_selected Signed-off-by: Tobias Ulmer --- diff --git a/plugins/git.lua b/plugins/git.lua index f168be1..23f5c7d 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -63,6 +63,10 @@ local function git_plugin_init(ctx) return false, re end + if e2tool.current_tool() == "fetch-sources" then + e2option.flag("git", "select git sources") + end + return true end @@ -74,6 +78,20 @@ plugin_descriptor = { git.git_source = class("git_source", source.basic_source) +function git.git_source.static:is_scm_source_class() + return true +end + +function git.git_source.static:is_selected_source_class(opts) + assertIsTable(self) + assertIsTable(opts) + + if e2tool.current_tool() == "fetch-sources" and opts["git"] then + return true + end + return false +end + function git.git_source:initialize(rawsrc) assert(type(rawsrc) == "table") assert(type(rawsrc.name) == "string" and rawsrc.name ~= "")