gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-build-common] 01/02: add GenericTool


From: gnunet
Subject: [taler-build-common] 01/02: add GenericTool
Date: Mon, 03 Aug 2020 09:50:29 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository build-common.

commit d399a1bc794576a0c3932d92ff63f0ae97300570
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Mon Aug 3 13:12:56 2020 +0530

    add GenericTool
---
 talerbuildconfig.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/talerbuildconfig.py b/talerbuildconfig.py
index db451c0..d2fe3b0 100644
--- a/talerbuildconfig.py
+++ b/talerbuildconfig.py
@@ -438,7 +438,7 @@ class NodeJsTool(Tool):
         pass
 
     def check(self, buildconfig):
-        if existence("node") is None:
+        if not existence("node"):
             return False
         if (
             subprocess.getstatusoutput(
@@ -452,6 +452,22 @@ class NodeJsTool(Tool):
         buildconfig._set_tool("node", "node", version=node_version)
         return True
 
+class GenericTool(Tool):
+    def __init__(self, name, hint, version_arg="-v"):
+        self.name = name
+        self.hint = hint
+        self.version_arg = version_arg
+
+    def args(self, parser):
+        pass
+
+    def check(self, buildconfig):
+        if not existence(self.name):
+            return False
+        vers = tool_version(f"{self.name} {self.version_arg}")
+        buildconfig._set_tool(self.name, self.name, version=vers)
+        return True
+
 
 class PosixTool(Tool):
     def __init__(self, name):
@@ -461,7 +477,7 @@ class PosixTool(Tool):
         pass
 
     def check(self, buildconfig):
-        found = existence("find")
+        found = existence(self.name)
         if found:
             buildconfig._set_tool(self.name, self.name)
             return True

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]