]> git.e2factory.org Git - e2factory.git/commitdiff
git: register flag, implement is_scm and is_selected
authorTobias Ulmer <tu@emlix.com>
Thu, 19 Jan 2017 17:18:32 +0000 (18:18 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 30 Jan 2017 13:33:34 +0000 (14:33 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/git.lua

index f168be194bc761b105595ca077fab9b1c9cc542d..23f5c7db4a0ba0fa2a50abbbe0da7400de8a4cff 100644 (file)
@@ -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 ~= "")