]> git.e2factory.org Git - e2factory.git/commitdiff
Add tools.isinitialized()
authorTobias Ulmer <tu@emlix.com>
Fri, 1 Feb 2013 17:44:46 +0000 (18:44 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:14 +0000 (19:07 +0100)
Return whether the tools module still needs to be initialized or not.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/tools.lua

index 9bfc015d62d47515885d824035cfafaa33375a8a..9c4dc0fbb2019fe5166cbcf79633d0a84833f54f 100644 (file)
@@ -33,6 +33,8 @@ local e2lib = require("e2lib")
 local strict = require("strict")
 require("buildconfig")
 
+local initialized = false
+
 local toollist = {
     which = { name = "which", flags = "", optional = false },
     curl = { name = "curl", flags = "", optional = false },
@@ -192,9 +194,16 @@ function tools.init()
     if error then
         return false, "missing mandatory tools"
     end
+    initialized = true
     return true, nil
 end
 
+--- Check whether the tools library is initialized.
+-- @return True or false.
+function tools.isinitialized()
+    return initialized
+end
+
 return strict.lock(tools)
 
 -- vim:sw=4:sts=4:et: