From 71cf4446ea227147366f9888f90b0fbbec6aa285 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 1 Feb 2013 18:44:46 +0100 Subject: [PATCH] Add tools.isinitialized() Return whether the tools module still needs to be initialized or not. Signed-off-by: Tobias Ulmer --- generic/tools.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generic/tools.lua b/generic/tools.lua index 9bfc015..9c4dc0f 100644 --- a/generic/tools.lua +++ b/generic/tools.lua @@ -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: -- 2.39.5