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

index a23d1bf1619522184abc3cc39af8347c7a56aebd..136945dcdcabfe53dfe2723d83f892453d314c80 100644 (file)
@@ -1,7 +1,7 @@
 --- CVS Plugin
 -- @module plugins.cvs
 
--- 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,16 +22,17 @@ local cvs = {}
 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")
 local hash = require("hash")
 local licence = require("licence")
 local scm = require("scm")
+local source = require("source")
 local strict = require("strict")
 local tools = require("tools")
 local url = require("url")
-local source = require("source")
 
 plugin_descriptor = {
     description = "CVS SCM Plugin",
@@ -48,6 +49,10 @@ plugin_descriptor = {
             return false, re
         end
 
+        if e2tool.current_tool() == "fetch-sources" then
+            e2option.flag("cvs", "select cvs sources")
+        end
+
         return true
     end,
     exit = function (ctx) return true end,
@@ -75,6 +80,19 @@ local function cvs_tool(argv, workdir)
     return e2lib.callcmd_log(cvscmd, workdir, { CVS_RSH=rsh })
 end
 
+function cvs.cvs_source.static:is_scm_source_class()
+    return true
+end
+
+function cvs.cvs_source.static:is_selected_source_class(opts)
+    assertIsTable(self)
+    assertIsTable(opts)
+
+    if e2tool.current_tool() == "fetch-sources" and opts["cvs"] then
+        return true
+    end
+    return false
+end
 
 function cvs.cvs_source:initialize(rawsrc)
     assert(type(rawsrc) == "table")