]> git.e2factory.org Git - e2factory.git/commitdiff
files: register flag, implement is_scm and is_selected
authorTobias Ulmer <tu@emlix.com>
Thu, 19 Jan 2017 17:18:20 +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/files.lua

index 2dc029a6b28da566806645a79bd8d388d97b1d9c..4e6bf718a5b935a3d54b54ccdb9931311cf081ed 100644 (file)
@@ -1,7 +1,7 @@
 --- Files Plugin
 -- @module plugins.files
 
--- Copyright (C) 2007-2016 emlix GmbH, see file AUTHORS
+-- Copyright (C) 2007-2017 emlix GmbH, see file AUTHORS
 --
 -- This file is part of e2factory, the emlix embedded build system.
 -- For more information see http://www.e2factory.org
@@ -22,6 +22,7 @@ local files = {}
 local cache = require("cache")
 local class = require("class")
 local e2lib = require("e2lib")
+local e2option = require("e2option")
 local e2tool = require("e2tool")
 local eio = require("eio")
 local err = require("err")
@@ -49,6 +50,10 @@ plugin_descriptor = {
             return false, re
         end
 
+        if e2tool.current_tool() == "fetch-sources" then
+            e2option.flag("files", "select files sources")
+        end
+
         return true
     end,
     exit = function (ctx) return true end,
@@ -56,6 +61,16 @@ plugin_descriptor = {
 
 files.files_source = class("files_source", source.basic_source)
 
+function files.files_source.static:is_selected_source_class(opts)
+    assertIsTable(self)
+    assertIsTable(opts)
+
+    if e2tool.current_tool() == "fetch-sources" and opts["files"] then
+        return true
+    end
+    return false
+end
+
 function files.files_source:initialize(rawsrc)
     assert(type(rawsrc) == "table")
     assert(type(rawsrc.name) == "string" and #rawsrc.name > 0)